]> git.hungrycats.org Git - linux/commitdiff
NFS: Fix use after free in write error path
authorFred Isaman <fred.isaman@gmail.com>
Fri, 14 Apr 2017 18:24:28 +0000 (14:24 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 May 2017 13:46:29 +0000 (15:46 +0200)
commit 1f84ccdf37d0db3a70714d02d51b0b6d45887fb8 upstream.

Signed-off-by: Fred Isaman <fred.isaman@gmail.com>
Fixes: 0bcbf039f6b2b ("nfs: handle request add failure properly")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/write.c

index abb2c8a3be42e4755f747c62a1cec5466f13ee77..3d1c2842bb9d69568eb0f7841ae3b698ad3a81fe 100644 (file)
@@ -548,9 +548,9 @@ static void nfs_write_error_remove_page(struct nfs_page *req)
 {
        nfs_unlock_request(req);
        nfs_end_page_writeback(req);
-       nfs_release_request(req);
        generic_error_remove_page(page_file_mapping(req->wb_page),
                                  req->wb_page);
+       nfs_release_request(req);
 }
 
 /*