aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2013-03-22 12:53:08 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-04-04 17:01:00 -0400
commit1c74a244fcb61e6e1983d5725b8ccd5d3f51889c (patch)
treeeff47c8ae8eae01b7754d850877ee28ddaba149e /net/sunrpc
parent4edaa308888b4bd629fa025cc6d5b2bf1a2a51db (diff)
SUNRPC: Don't recognize RPC_AUTH_MAXFLAVOR
RPC_AUTH_MAXFLAVOR is an invalid flavor, on purpose. Don't allow any processing whatsoever if a caller passes it to rpcauth_create() or rpcauth_get_gssinfo(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/auth.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
index 2bc0cc2196e0..ed2fdd210c0b 100644
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -82,7 +82,7 @@ MODULE_PARM_DESC(auth_hashtable_size, "RPC credential cache hashtable size");
82 82
83static u32 83static u32
84pseudoflavor_to_flavor(u32 flavor) { 84pseudoflavor_to_flavor(u32 flavor) {
85 if (flavor >= RPC_AUTH_MAXFLAVOR) 85 if (flavor > RPC_AUTH_MAXFLAVOR)
86 return RPC_AUTH_GSS; 86 return RPC_AUTH_GSS;
87 return flavor; 87 return flavor;
88} 88}
@@ -173,6 +173,9 @@ rpcauth_get_gssinfo(rpc_authflavor_t pseudoflavor, struct rpcsec_gss_info *info)
173 const struct rpc_authops *ops; 173 const struct rpc_authops *ops;
174 int result; 174 int result;
175 175
176 if (flavor >= RPC_AUTH_MAXFLAVOR)
177 return -EINVAL;
178
176 ops = auth_flavors[flavor]; 179 ops = auth_flavors[flavor];
177 if (ops == NULL) 180 if (ops == NULL)
178 request_module("rpc-auth-%u", flavor); 181 request_module("rpc-auth-%u", flavor);