]> git.hungrycats.org Git - linux/commit
NFSD: Initialize struct nfsd4_copy earlier
authorChuck Lever <chuck.lever@oracle.com>
Mon, 18 Nov 2024 21:18:59 +0000 (16:18 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 Nov 2024 14:37:33 +0000 (15:37 +0100)
commitc3074003fa6837c2b89a34d8d12d9463b59d22d6
tree356e406165c51cce937d9b3a4005c4b93384f555
parent7ea9260874b779637aff6d24c344b8ef4ac862a0
NFSD: Initialize struct nfsd4_copy earlier

[ Upstream commit 63fab04cbd0f96191b6e5beedc3b643b01c15889 ]

Ensure the refcount and async_copies fields are initialized early.
cleanup_async_copy() will reference these fields if an error occurs
in nfsd4_copy(). If they are not correctly initialized, at the very
least, a refcount underflow occurs.

Reported-by: Olga Kornievskaia <okorniev@redhat.com>
Fixes: aadc3bbea163 ("NFSD: Limit the number of concurrent async COPY operations")
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Tested-by: Olga Kornievskaia <okorniev@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/nfs4proc.c