linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nfsd: COPY and CLONE operations require the saved filehandle to be set
@ 2018-11-08 16:11 Scott Mayhew
  2018-11-08 17:12 ` J. Bruce Fields
  0 siblings, 1 reply; 2+ messages in thread
From: Scott Mayhew @ 2018-11-08 16:11 UTC (permalink / raw)
  To: bfields, jlayton; +Cc: linux-nfs

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>
---
 fs/nfsd/nfs4proc.c | 3 +++
 1 file changed, 3 insertions(+)

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) {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] nfsd: COPY and CLONE operations require the saved filehandle to be set
  2018-11-08 16:11 [PATCH] nfsd: COPY and CLONE operations require the saved filehandle to be set Scott Mayhew
@ 2018-11-08 17:12 ` J. Bruce Fields
  0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2018-11-08 17:12 UTC (permalink / raw)
  To: Scott Mayhew; +Cc: jlayton, linux-nfs

Applying for 4.20 and stable, thanks!

--b.

On Thu, Nov 08, 2018 at 11:11:36AM -0500, Scott Mayhew wrote:
> 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>
> ---
>  fs/nfsd/nfs4proc.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> 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) {
> -- 
> 2.17.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-08 17:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-08 16:11 [PATCH] nfsd: COPY and CLONE operations require the saved filehandle to be set Scott Mayhew
2018-11-08 17:12 ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).