]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
NFS: Fix 2 use after free issues in the I/O code
authorTrond Myklebust <trond.myklebust@primarydata.com>
Sat, 9 Sep 2017 01:28:11 +0000 (21:28 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2017 21:17:30 +0000 (14:17 -0700)
commit6f50e3a1b8c3c08c6c45522c30a0f16f37b8efb8
tree84b0e8b78076b615744f229db70643b48e3cf742
parent7714f302294de71ce847b4c3b7dda3f885a08b7a
NFS: Fix 2 use after free issues in the I/O code

commit 196639ebbe63a037fe9a80669140bd292d8bcd80 upstream.

The writeback code wants to send a commit after processing the pages,
which is why we want to delay releasing the struct path until after
that's done.

Also, the layout code expects that we do not free the inode before
we've put the layout segments in pnfs_writehdr_free() and
pnfs_readhdr_free()

Fixes: 919e3bd9a875 ("NFS: Ensure we commit after writeback is complete")
Fixes: 4714fb51fd03 ("nfs: remove pgio_header refcount, related cleanup")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/internal.h
fs/nfs/pagelist.c
fs/nfs/pnfs.c