diff options
author | Jeff Layton <jlayton@kernel.org> | 2025-06-20 08:16:04 -0400 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2025-07-14 12:46:48 -0400 |
commit | 0f2b8ee6303da559bb73aed92d62d5928dac7b83 (patch) | |
tree | ccf31dcd222c4772d77cc1143ea54f30d0df4d34 | |
parent | c8af9d3d4be25dd25845c6d67b32f30d01bf921a (diff) |
sunrpc: return better error in svcauth_gss_accept() on alloc failure
This ends up returning AUTH_BADCRED when memory allocation fails today.
Fix it to return AUTH_FAILED, which better indicates a failure on the
server.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
-rw-r--r-- | net/sunrpc/auth_gss/svcauth_gss.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index 73a90ad873fb..e82212f6b562 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c @@ -1628,7 +1628,7 @@ svcauth_gss_accept(struct svc_rqst *rqstp) int ret; struct sunrpc_net *sn = net_generic(SVC_NET(rqstp), sunrpc_net_id); - rqstp->rq_auth_stat = rpc_autherr_badcred; + rqstp->rq_auth_stat = rpc_autherr_failed; if (!svcdata) svcdata = kmalloc(sizeof(*svcdata), GFP_KERNEL); if (!svcdata) @@ -1638,6 +1638,7 @@ svcauth_gss_accept(struct svc_rqst *rqstp) svcdata->rsci = NULL; gc = &svcdata->clcred; + rqstp->rq_auth_stat = rpc_autherr_badcred; if (!svcauth_gss_decode_credbody(&rqstp->rq_arg_stream, gc, &rpcstart)) goto auth_err; if (gc->gc_v != RPC_GSS_VERSION) |