From: Fred Isaman Date: Fri, 14 Apr 2017 18:24:28 +0000 (-0400) Subject: NFS: Fix use after free in write error path X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1f84ccdf37d0db3a70714d02d51b0b6d45887fb8;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git NFS: Fix use after free in write error path Signed-off-by: Fred Isaman Fixes: 0bcbf039f6b2b ("nfs: handle request add failure properly") Cc: stable@vger.kernel.org # v4.5+ Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/write.c b/fs/nfs/write.c index bdfe5a7c5874..e0bccbefbc9e 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -561,9 +561,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); } /*