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>
This commit is contained in:

committed by
J. Bruce Fields

parent
ccfe51a516
commit
e6667c73a2
@@ -474,12 +474,12 @@ static int rsc_parse(struct cache_detail *cd,
|
|||||||
* treatment so are checked for validity here.)
|
* treatment so are checked for validity here.)
|
||||||
*/
|
*/
|
||||||
/* uid */
|
/* uid */
|
||||||
rsci.cred.cr_uid = make_kuid(&init_user_ns, id);
|
rsci.cred.cr_uid = make_kuid(current_user_ns(), id);
|
||||||
|
|
||||||
/* gid */
|
/* gid */
|
||||||
if (get_int(&mesg, &id))
|
if (get_int(&mesg, &id))
|
||||||
goto out;
|
goto out;
|
||||||
rsci.cred.cr_gid = make_kgid(&init_user_ns, id);
|
rsci.cred.cr_gid = make_kgid(current_user_ns(), id);
|
||||||
|
|
||||||
/* number of additional gid's */
|
/* number of additional gid's */
|
||||||
if (get_int(&mesg, &N))
|
if (get_int(&mesg, &N))
|
||||||
@@ -497,7 +497,7 @@ static int rsc_parse(struct cache_detail *cd,
|
|||||||
kgid_t kgid;
|
kgid_t kgid;
|
||||||
if (get_int(&mesg, &id))
|
if (get_int(&mesg, &id))
|
||||||
goto out;
|
goto out;
|
||||||
kgid = make_kgid(&init_user_ns, id);
|
kgid = make_kgid(current_user_ns(), id);
|
||||||
if (!gid_valid(kgid))
|
if (!gid_valid(kgid))
|
||||||
goto out;
|
goto out;
|
||||||
rsci.cred.cr_group_info->gid[i] = kgid;
|
rsci.cred.cr_group_info->gid[i] = kgid;
|
||||||
|
Reference in New Issue
Block a user