Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-3.10' of git://linux-nfs.org/~bfields/linux

Pull nfsd fixes from Bruce Fields:
"A couple minor fixes for the (new to 3.10) gss-proxy code.

And one regression from user-namespace changes. (XBMC clients were
doing something admittedly weird--sending -1 gid's--but something that
we used to allow.)"

* 'for-3.10' of git://linux-nfs.org/~bfields/linux:
svcrpc: fix failures to handle -1 uid's and gid's
svcrpc: implement O_NONBLOCK behavior for use-gss-proxy
svcauth_gss: fix error code in use_gss_proxy()

+12 -8
+5 -3
net/sunrpc/auth_gss/svcauth_gss.c
··· 1287 1287 1288 1288 #ifdef CONFIG_PROC_FS 1289 1289 1290 - static bool set_gss_proxy(struct net *net, int type) 1290 + static int set_gss_proxy(struct net *net, int type) 1291 1291 { 1292 1292 struct sunrpc_net *sn = net_generic(net, sunrpc_net_id); 1293 1293 int ret = 0; ··· 1317 1317 return false; 1318 1318 } 1319 1319 1320 - static int wait_for_gss_proxy(struct net *net) 1320 + static int wait_for_gss_proxy(struct net *net, struct file *file) 1321 1321 { 1322 1322 struct sunrpc_net *sn = net_generic(net, sunrpc_net_id); 1323 1323 1324 + if (file->f_flags & O_NONBLOCK && !gssp_ready(sn)) 1325 + return -EAGAIN; 1324 1326 return wait_event_interruptible(sn->gssp_wq, gssp_ready(sn)); 1325 1327 } 1326 1328 ··· 1364 1362 size_t len; 1365 1363 int ret; 1366 1364 1367 - ret = wait_for_gss_proxy(net); 1365 + ret = wait_for_gss_proxy(net, file); 1368 1366 if (ret) 1369 1367 return ret; 1370 1368
+7 -5
net/sunrpc/svcauth_unix.c
··· 810 810 goto badcred; 811 811 argv->iov_base = (void*)((__be32*)argv->iov_base + slen); /* skip machname */ 812 812 argv->iov_len -= slen*4; 813 - 813 + /* 814 + * Note: we skip uid_valid()/gid_valid() checks here for 815 + * backwards compatibility with clients that use -1 id's. 816 + * Instead, -1 uid or gid is later mapped to the 817 + * (export-specific) anonymous id by nfsd_setuser. 818 + * Supplementary gid's will be left alone. 819 + */ 814 820 cred->cr_uid = make_kuid(&init_user_ns, svc_getnl(argv)); /* uid */ 815 821 cred->cr_gid = make_kgid(&init_user_ns, svc_getnl(argv)); /* gid */ 816 - if (!uid_valid(cred->cr_uid) || !gid_valid(cred->cr_gid)) 817 - goto badcred; 818 822 slen = svc_getnl(argv); /* gids length */ 819 823 if (slen > 16 || (len -= (slen + 2)*4) < 0) 820 824 goto badcred; ··· 827 823 return SVC_CLOSE; 828 824 for (i = 0; i < slen; i++) { 829 825 kgid_t kgid = make_kgid(&init_user_ns, svc_getnl(argv)); 830 - if (!gid_valid(kgid)) 831 - goto badcred; 832 826 GROUP_AT(cred->cr_group_info, i) = kgid; 833 827 } 834 828 if (svc_getu32(argv) != htonl(RPC_AUTH_NULL) || svc_getu32(argv) != 0) {