Patch "nfsd: zero out pointers after putting nfsd_files on COPY setup error" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    nfsd: zero out pointers after putting nfsd_files on COPY setup error

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     nfsd-zero-out-pointers-after-putting-nfsd_files-on-c.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit a846e6b8dbad74c2d3739b22555370d62d8d3047
Author: Jeff Layton <jlayton@xxxxxxxxxx>
Date:   Tue Jan 17 14:38:30 2023 -0500

    nfsd: zero out pointers after putting nfsd_files on COPY setup error
    
    [ Upstream commit 1f0001d43d0c0ac2a19a34a914f6595ad97cbc1d ]
    
    At first, I thought this might be a source of nfsd_file overputs, but
    the current callers seem to avoid an extra put when nfsd4_verify_copy
    returns an error.
    
    Still, it's "bad form" to leave the pointers filled out when we don't
    have a reference to them anymore, and that might lead to bugs later.
    Zero them out as a defensive coding measure.
    
    Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
    Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 0a900b9e39eac..57af9c30eb48d 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1088,8 +1088,10 @@ nfsd4_verify_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 	return status;
 out_put_dst:
 	nfsd_file_put(*dst);
+	*dst = NULL;
 out_put_src:
 	nfsd_file_put(*src);
+	*src = NULL;
 	goto out;
 }
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux