Skip to content

Commit 0f2b8ee

Browse files
jtlaytonchucklever
authored andcommitted
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>
1 parent c8af9d3 commit 0f2b8ee

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

net/sunrpc/auth_gss/svcauth_gss.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1628,7 +1628,7 @@ svcauth_gss_accept(struct svc_rqst *rqstp)
16281628
int ret;
16291629
struct sunrpc_net *sn = net_generic(SVC_NET(rqstp), sunrpc_net_id);
16301630

1631-
rqstp->rq_auth_stat = rpc_autherr_badcred;
1631+
rqstp->rq_auth_stat = rpc_autherr_failed;
16321632
if (!svcdata)
16331633
svcdata = kmalloc(sizeof(*svcdata), GFP_KERNEL);
16341634
if (!svcdata)
@@ -1638,6 +1638,7 @@ svcauth_gss_accept(struct svc_rqst *rqstp)
16381638
svcdata->rsci = NULL;
16391639
gc = &svcdata->clcred;
16401640

1641+
rqstp->rq_auth_stat = rpc_autherr_badcred;
16411642
if (!svcauth_gss_decode_credbody(&rqstp->rq_arg_stream, gc, &rpcstart))
16421643
goto auth_err;
16431644
if (gc->gc_v != RPC_GSS_VERSION)

0 commit comments

Comments
 (0)