From: Scott Mayhew Date: Thu, 8 Nov 2018 16:11:36 +0000 (-0500) Subject: nfsd: COPY and CLONE operations require the saved filehandle to be set X-Git-Tag: v4.9.138~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7291d95a97fc89044301b197c760555e894e82c7;p=platform%2Fkernel%2Flinux-amlogic.git nfsd: COPY and CLONE operations require the saved filehandle to be set commit 01310bb7c9c98752cc763b36532fab028e0f8f81 upstream. Make sure we have a saved filehandle, otherwise we'll oops with a null pointer dereference in nfs4_preprocess_stateid_op(). Signed-off-by: Scott Mayhew Cc: stable@vger.kernel.org Signed-off-by: J. Bruce Fields Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index e9495516527d..66985a6a7047 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1016,6 +1016,9 @@ nfsd4_verify_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, { __be32 status; + if (!cstate->save_fh.fh_dentry) + return nfserr_nofilehandle; + status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->save_fh, src_stateid, RD_STATE, src, NULL); if (status) {