diff options
author | Scott Mayhew <smayhew@redhat.com> | 2018-11-08 17:11:36 +0100 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2018-11-08 18:11:45 +0100 |
commit | 01310bb7c9c98752cc763b36532fab028e0f8f81 (patch) | |
tree | 7d3ee070317b029e9f6b31ceeca8a96a4191afc4 /fs/nfsd/nfs4proc.c | |
parent | sunrpc: correct the computation for page_ptr when truncating (diff) | |
download | linux-01310bb7c9c98752cc763b36532fab028e0f8f81.tar.xz linux-01310bb7c9c98752cc763b36532fab028e0f8f81.zip |
nfsd: COPY and CLONE operations require the saved filehandle to be set
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 <smayhew@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4proc.c')
-rw-r--r-- | fs/nfsd/nfs4proc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index edff074d38c7..d505990dac7c 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1038,6 +1038,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) { |