From: J. Bruce Fields Date: Wed, 7 Aug 2013 15:41:49 +0000 (-0400) Subject: nfsd4: Fix MACH_CRED NULL dereference X-Git-Tag: v3.12-rc1~276^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c47205914cf5a8cf564ca560aa6eaa2287867e58;p=kernel%2Fkernel-generic.git nfsd4: Fix MACH_CRED NULL dereference Fixes a NULL-dereference on attempts to use MACH_CRED protection over auth_sys. Signed-off-by: J. Bruce Fields --- diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 280acef..43f4229 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -1264,6 +1264,8 @@ static bool svc_rqst_integrity_protected(struct svc_rqst *rqstp) struct svc_cred *cr = &rqstp->rq_cred; u32 service; + if (!cr->cr_gss_mech) + return false; service = gss_pseudoflavor_to_service(cr->cr_gss_mech, cr->cr_flavor); return service == RPC_GSS_SVC_INTEGRITY || service == RPC_GSS_SVC_PRIVACY;