]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
NFSD: fix dest to src mount in inter-server COPY
authorOlga Kornievskaia <kolga@netapp.com>
Tue, 9 Mar 2021 14:41:14 +0000 (09:41 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Mar 2021 10:54:05 +0000 (11:54 +0100)
commit 614c9750173e412663728215152cc6d12bcb3425 upstream.

A cleanup of the inter SSC copy needs to call fput() of the source
file handle to make sure that file structure is freed as well as
drop the reference on the superblock to unmount the source server.

Fixes: 36e1e5ba90fb ("NFSD: Fix use-after-free warning when doing inter-server copy")
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Tested-by: Dai Ngo <dai.ngo@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/nfs4proc.c

index 8d6d2678abade46ac06ba69a8a84700335c424de..3581ce737e85341017a96943f9b2203de6ee9903 100644 (file)
@@ -1304,7 +1304,7 @@ nfsd4_cleanup_inter_ssc(struct vfsmount *ss_mnt, struct nfsd_file *src,
                        struct nfsd_file *dst)
 {
        nfs42_ssc_close(src->nf_file);
-       /* 'src' is freed by nfsd4_do_async_copy */
+       fput(src->nf_file);
        nfsd_file_put(dst);
        mntput(ss_mnt);
 }