Skip to content

Commit

Permalink
nfsd: COPY and CLONE operations require the saved filehandle to be set
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Scott Mayhew authored and J. Bruce Fields committed Nov 8, 2018
1 parent 5d7a5bc commit 01310bb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/nfsd/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 01310bb

Please sign in to comment.