Skip to content

Commit 36e1e5b

Browse files
daimngoJ. Bruce Fields
authored andcommitted
NFSD: Fix use-after-free warning when doing inter-server copy
The source file nfsd_file is not constructed the same as other nfsd_file's via nfsd_file_alloc. nfsd_file_put should not be called to free the object; nfsd_file_put is not the inverse of kzalloc, instead kfree is called by nfsd4_do_async_copy when done. Fixes: ce0887a ("NFSD add nfs4 inter ssc to nfsd4_copy") Signed-off-by: Dai Ngo <dai.ngo@oracle.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
1 parent 66d60e3 commit 36e1e5b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/nfsd/nfs4proc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@ nfsd4_cleanup_inter_ssc(struct vfsmount *ss_mnt, struct nfsd_file *src,
12991299
struct nfsd_file *dst)
13001300
{
13011301
nfs42_ssc_close(src->nf_file);
1302-
nfsd_file_put(src);
1302+
/* 'src' is freed by nfsd4_do_async_copy */
13031303
nfsd_file_put(dst);
13041304
mntput(ss_mnt);
13051305
}

0 commit comments

Comments
 (0)