aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/auth_unix.c')
-rw-r--r--net/sunrpc/auth_unix.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/net/sunrpc/auth_unix.c b/net/sunrpc/auth_unix.c
index 52c5abdee21..e50502d8ceb 100644
--- a/net/sunrpc/auth_unix.c
+++ b/net/sunrpc/auth_unix.c
@@ -12,7 +12,6 @@
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/sunrpc/clnt.h> 13#include <linux/sunrpc/clnt.h>
14#include <linux/sunrpc/auth.h> 14#include <linux/sunrpc/auth.h>
15#include <linux/user_namespace.h>
16 15
17#define NFS_NGROUPS 16 16#define NFS_NGROUPS 16
18 17
@@ -79,11 +78,8 @@ unx_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags)
79 groups = NFS_NGROUPS; 78 groups = NFS_NGROUPS;
80 79
81 cred->uc_gid = acred->gid; 80 cred->uc_gid = acred->gid;
82 for (i = 0; i < groups; i++) { 81 for (i = 0; i < groups; i++)
83 gid_t gid; 82 cred->uc_gids[i] = GROUP_AT(acred->group_info, i);
84 gid = from_kgid(&init_user_ns, GROUP_AT(acred->group_info, i));
85 cred->uc_gids[i] = gid;
86 }
87 if (i < NFS_NGROUPS) 83 if (i < NFS_NGROUPS)
88 cred->uc_gids[i] = NOGROUP; 84 cred->uc_gids[i] = NOGROUP;
89 85
@@ -130,12 +126,9 @@ unx_match(struct auth_cred *acred, struct rpc_cred *rcred, int flags)
130 groups = acred->group_info->ngroups; 126 groups = acred->group_info->ngroups;
131 if (groups > NFS_NGROUPS) 127 if (groups > NFS_NGROUPS)
132 groups = NFS_NGROUPS; 128 groups = NFS_NGROUPS;
133 for (i = 0; i < groups ; i++) { 129 for (i = 0; i < groups ; i++)
134 gid_t gid; 130 if (cred->uc_gids[i] != GROUP_AT(acred->group_info, i))
135 gid = from_kgid(&init_user_ns, GROUP_AT(acred->group_info, i));
136 if (cred->uc_gids[i] != gid)
137 return 0; 131 return 0;
138 }
139 if (groups < NFS_NGROUPS && 132 if (groups < NFS_NGROUPS &&
140 cred->uc_gids[groups] != NOGROUP) 133 cred->uc_gids[groups] != NOGROUP)
141 return 0; 134 return 0;