NFSv4: Fix a pNFS layout related use-after-free race when freeing the inode
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 25 Nov 2020 17:06:14 +0000 (12:06 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Jan 2021 13:56:54 +0000 (14:56 +0100)
commit3c0f0f5f58a785fa373fc38200d16feded0ceb5b
tree8c0f65204535506a78b2a42d84939e3fc9ff7b41
parent06ac2ca0989d6b60909abce0dc2b41c799a76d4c
NFSv4: Fix a pNFS layout related use-after-free race when freeing the inode

[ Upstream commit b6d49ecd1081740b6e632366428b960461f8158b ]

When returning the layout in nfs4_evict_inode(), we need to ensure that
the layout is actually done being freed before we can proceed to free the
inode itself.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/nfs4super.c
fs/nfs/pnfs.c
fs/nfs/pnfs.h