]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
NFS: Fix use-after-free issues in nfs_pageio_add_request()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Sun, 29 Mar 2020 23:55:05 +0000 (19:55 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Apr 2020 14:13:43 +0000 (16:13 +0200)
commita73fc80715e3e2ee3bd59255825fedddea4f43dd
tree75847931d1d1a9d44f6537125a1c18d9627a3693
parent8af7a3035045dca1d06f3c326ad3d390c24fcaed
NFS: Fix use-after-free issues in nfs_pageio_add_request()

commit dc9dc2febb17f72e9878eb540ad3996f7984239a upstream.

We need to ensure that we create the mirror requests before calling
nfs_pageio_add_request_mirror() on the request we are adding.
Otherwise, we can end up with a use-after-free if the call to
nfs_pageio_add_request_mirror() triggers I/O.

Fixes: c917cfaf9bbe ("NFS: Fix up NFS I/O subrequest creation")
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/pagelist.c