]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
NFS: Fix a page leak in nfs_destroy_unlinked_subrequests()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 1 Apr 2020 14:07:16 +0000 (10:07 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Apr 2020 14:13:43 +0000 (16:13 +0200)
commit add42de31721fa29ed77a7ce388674d69f9d31a4 upstream.

When we detach a subrequest from the list, we must also release the
reference it holds to the parent.

Fixes: 5b2b5187fa85 ("NFS: Fix nfs_page_group_destroy() and nfs_lock_and_join_requests() race cases")
Cc: stable@vger.kernel.org # v4.14+
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/write.c

index c478b772cc49a3a583611612ef54714cfbea5437..38abd130528a113e2b605f296e8816d1a36fa20d 100644 (file)
@@ -444,6 +444,7 @@ nfs_destroy_unlinked_subrequests(struct nfs_page *destroy_list,
                }
 
                subreq->wb_head = subreq;
+               nfs_release_request(old_head);
 
                if (test_and_clear_bit(PG_INODE_REF, &subreq->wb_flags)) {
                        nfs_release_request(subreq);