diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2011-11-14 18:56:38 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2012-05-03 06:27:21 -0400 |
commit | ae2975bc3476243b45a1e2344236d7920c268f38 (patch) | |
tree | e4b2a8472f6047734b6e7e2bdc994375b2790323 /net/sunrpc/auth_gss | |
parent | 22d917d80e842829d0ca0a561967d728eb1d6303 (diff) |
userns: Convert group_info values from gid_t to kgid_t.
As a first step to converting struct cred to be all kuid_t and kgid_t
values convert the group values stored in group_info to always be
kgid_t values. Unless user namespaces are used this change should
have no effect.
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'net/sunrpc/auth_gss')
-rw-r--r-- | net/sunrpc/auth_gss/svcauth_gss.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index 1600cfb1618c..28b62dbb6d1e 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <linux/types.h> | 41 | #include <linux/types.h> |
42 | #include <linux/module.h> | 42 | #include <linux/module.h> |
43 | #include <linux/pagemap.h> | 43 | #include <linux/pagemap.h> |
44 | #include <linux/user_namespace.h> | ||
44 | 45 | ||
45 | #include <linux/sunrpc/auth_gss.h> | 46 | #include <linux/sunrpc/auth_gss.h> |
46 | #include <linux/sunrpc/gss_err.h> | 47 | #include <linux/sunrpc/gss_err.h> |
@@ -470,9 +471,13 @@ static int rsc_parse(struct cache_detail *cd, | |||
470 | status = -EINVAL; | 471 | status = -EINVAL; |
471 | for (i=0; i<N; i++) { | 472 | for (i=0; i<N; i++) { |
472 | gid_t gid; | 473 | gid_t gid; |
474 | kgid_t kgid; | ||
473 | if (get_int(&mesg, &gid)) | 475 | if (get_int(&mesg, &gid)) |
474 | goto out; | 476 | goto out; |
475 | GROUP_AT(rsci.cred.cr_group_info, i) = gid; | 477 | kgid = make_kgid(&init_user_ns, gid); |
478 | if (!gid_valid(kgid)) | ||
479 | goto out; | ||
480 | GROUP_AT(rsci.cred.cr_group_info, i) = kgid; | ||
476 | } | 481 | } |
477 | 482 | ||
478 | /* mech name */ | 483 | /* mech name */ |