Skip to content

Commit 6df164e

Browse files
LLfamchucklever
authored andcommitted
sunrpc: fix null pointer dereference on zero-length checksum
In xdr_stream_decode_opaque_auth(), zero-length checksum.len causes checksum.data to be set to NULL. This triggers a NPD when accessing checksum.data in gss_krb5_verify_mic_v2(). This patch ensures that the value of checksum.len is not less than XDR_UNIT. Fixes: 0653028 ("SUNRPC: Convert gss_verify_header() to use xdr_stream") Cc: stable@kernel.org Signed-off-by: Lei Lu <llfamsec@gmail.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent 07e27ad commit 6df164e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/sunrpc/auth_gss/svcauth_gss.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ svcauth_gss_verify_header(struct svc_rqst *rqstp, struct rsc *rsci,
724724
rqstp->rq_auth_stat = rpc_autherr_badverf;
725725
return SVC_DENIED;
726726
}
727-
if (flavor != RPC_AUTH_GSS) {
727+
if (flavor != RPC_AUTH_GSS || checksum.len < XDR_UNIT) {
728728
rqstp->rq_auth_stat = rpc_autherr_badverf;
729729
return SVC_DENIED;
730730
}

0 commit comments

Comments
 (0)