nfsd: fix potential UAF in nfsd4_cb_getattr_release
authorJeff Layton <jlayton@kernel.org>
Fri, 23 Aug 2024 22:27:39 +0000 (18:27 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 26 Aug 2024 15:53:05 +0000 (11:53 -0400)
commit1116e0e372eb16dd907ec571ce5d4af325c55c10
treef306c49e83fe3e1884fdce6a7c3413a1ebd58a6a
parentda05ba23d4c8d3e8a45846b952e53dd76c4b5e36
nfsd: fix potential UAF in nfsd4_cb_getattr_release

Once we drop the delegation reference, the fields embedded in it are no
longer safe to access. Do that last.

Fixes: c5967721e106 ("NFSD: handle GETATTR conflict with write delegation")
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4state.c