NFS: nfs_delegation_find_inode_server must first reference the superblock
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Sun, 10 Jan 2021 20:46:06 +0000 (15:46 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Jan 2021 17:27:31 +0000 (18:27 +0100)
commitb4689562fa95100caf31b2190bba84cb0e10770f
treeae84c36eec0036e6e4cfd2cfe0f45b0aabe32e6d
parent01a12a24f9238024f69ee0b15ffa73511ba6c95f
NFS: nfs_delegation_find_inode_server must first reference the superblock

commit 113aac6d567bda783af36d08f73bfda47d8e9a40 upstream.

Before referencing the inode, we must ensure that the superblock can be
referenced. Otherwise, we can end up with iput() calling superblock
operations that are no longer valid or accessible.

Fixes: e39d8a186ed0 ("NFSv4: Fix an Oops during delegation callbacks")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/delegation.c