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

SUNRPC: rsi_parse() should use the current user namespace

rsi_parse() is part of a downcall, so we must assume that the uids
and gids are encoded using the current user namespace.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>

authored by

Trond Myklebust and committed by
J. Bruce Fields
e6667c73 ccfe51a5

+3 -3
+3 -3
net/sunrpc/auth_gss/svcauth_gss.c
··· 474 474 * treatment so are checked for validity here.) 475 475 */ 476 476 /* uid */ 477 - rsci.cred.cr_uid = make_kuid(&init_user_ns, id); 477 + rsci.cred.cr_uid = make_kuid(current_user_ns(), id); 478 478 479 479 /* gid */ 480 480 if (get_int(&mesg, &id)) 481 481 goto out; 482 - rsci.cred.cr_gid = make_kgid(&init_user_ns, id); 482 + rsci.cred.cr_gid = make_kgid(current_user_ns(), id); 483 483 484 484 /* number of additional gid's */ 485 485 if (get_int(&mesg, &N)) ··· 497 497 kgid_t kgid; 498 498 if (get_int(&mesg, &id)) 499 499 goto out; 500 - kgid = make_kgid(&init_user_ns, id); 500 + kgid = make_kgid(current_user_ns(), id); 501 501 if (!gid_valid(kgid)) 502 502 goto out; 503 503 rsci.cred.cr_group_info->gid[i] = kgid;