aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_null.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/auth_null.c')
-rw-r--r--net/sunrpc/auth_null.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/net/sunrpc/auth_null.c b/net/sunrpc/auth_null.c
index 797f8472c21b..bf96975ffc4b 100644
--- a/net/sunrpc/auth_null.c
+++ b/net/sunrpc/auth_null.c
@@ -86,25 +86,19 @@ nul_refresh(struct rpc_task *task)
86 return 0; 86 return 0;
87} 87}
88 88
89static __be32 * 89static int
90nul_validate(struct rpc_task *task, __be32 *p) 90nul_validate(struct rpc_task *task, struct xdr_stream *xdr)
91{ 91{
92 rpc_authflavor_t flavor; 92 __be32 *p;
93 u32 size; 93
94 94 p = xdr_inline_decode(xdr, 2 * sizeof(*p));
95 flavor = ntohl(*p++); 95 if (!p)
96 if (flavor != RPC_AUTH_NULL) { 96 return -EIO;
97 printk("RPC: bad verf flavor: %u\n", flavor); 97 if (*p++ != rpc_auth_null)
98 return ERR_PTR(-EIO); 98 return -EIO;
99 } 99 if (*p != xdr_zero)
100 100 return -EIO;
101 size = ntohl(*p++); 101 return 0;
102 if (size != 0) {
103 printk("RPC: bad verf size: %u\n", size);
104 return ERR_PTR(-EIO);
105 }
106
107 return p;
108} 102}
109 103
110const struct rpc_authops authnull_ops = { 104const struct rpc_authops authnull_ops = {
@@ -134,6 +128,7 @@ const struct rpc_credops null_credops = {
134 .crwrap_req = rpcauth_wrap_req_encode, 128 .crwrap_req = rpcauth_wrap_req_encode,
135 .crrefresh = nul_refresh, 129 .crrefresh = nul_refresh,
136 .crvalidate = nul_validate, 130 .crvalidate = nul_validate,
131 .crunwrap_resp = rpcauth_unwrap_resp_decode,
137}; 132};
138 133
139static 134static