diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2023-01-08 11:31:05 -0500 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2023-02-20 09:20:31 -0500 |
commit | 4bcf0343e8a69eb22f7e83bfa7cfce32a28c9d95 (patch) | |
tree | 1cf874daa0358934fb3b259e8d8cbd0a99f98f56 /net/sunrpc/svcauth_unix.c | |
parent | cee4db19452467eef8ab93c6eb6a3a84d11d25d7 (diff) | |
download | lwn-4bcf0343e8a69eb22f7e83bfa7cfce32a28c9d95.tar.gz lwn-4bcf0343e8a69eb22f7e83bfa7cfce32a28c9d95.zip |
SUNRPC: Set rq_accept_statp inside ->accept methods
To navigate around the space that svcauth_gss_accept() reserves
for the RPC payload body length and sequence number fields,
svcauth_gss_release() does a little dance with the reply's
accept_stat, moving the accept_stat value in the response buffer
down by two words.
Instead, let's have the ->accept() methods each set the proper
final location of the accept_stat to avoid having to move
things.
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'net/sunrpc/svcauth_unix.c')
-rw-r--r-- | net/sunrpc/svcauth_unix.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c index b101700d155c..62dfc8cdf8c5 100644 --- a/net/sunrpc/svcauth_unix.c +++ b/net/sunrpc/svcauth_unix.c @@ -775,6 +775,8 @@ svcauth_null_accept(struct svc_rqst *rqstp) if (xdr_stream_encode_opaque_auth(&rqstp->rq_res_stream, RPC_AUTH_NULL, NULL, 0) < 0) return SVC_CLOSE; + if (!svcxdr_set_accept_stat(rqstp)) + return SVC_CLOSE; rqstp->rq_cred.cr_flavor = RPC_AUTH_NULL; return SVC_OK; @@ -866,6 +868,8 @@ svcauth_tls_accept(struct svc_rqst *rqstp) RPC_AUTH_NULL, NULL, 0) < 0) return SVC_CLOSE; } + if (!svcxdr_set_accept_stat(rqstp)) + return SVC_CLOSE; rqstp->rq_cred.cr_flavor = RPC_AUTH_TLS; return SVC_OK; @@ -960,6 +964,8 @@ svcauth_unix_accept(struct svc_rqst *rqstp) if (xdr_stream_encode_opaque_auth(&rqstp->rq_res_stream, RPC_AUTH_NULL, NULL, 0) < 0) return SVC_CLOSE; + if (!svcxdr_set_accept_stat(rqstp)) + return SVC_CLOSE; rqstp->rq_cred.cr_flavor = RPC_AUTH_UNIX; return SVC_OK; |