]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd: zero out pointers after putting nfsd_files on COPY setup error
authorJeff Layton <jlayton@kernel.org>
Tue, 17 Jan 2023 19:38:30 +0000 (14:38 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:34:01 +0000 (09:34 +0100)
commit827c33c66ad2b06c04e899c51ade56d7285a359a
treeeaf2f17314f4a773dd8cbe576e4c9f921385cab9
parent7fc5c2701c14d4867329bb276467a7a8ffdef8b9
nfsd: zero out pointers after putting nfsd_files on COPY setup error

[ Upstream commit 2649aad0c83a71f65c3a469126d007c6b882fa38 ]

At first, I thought this might be a source of nfsd_file overputs, but
the current callers seem to avoid an extra put when nfsd4_verify_copy
returns an error.

Still, it's "bad form" to leave the pointers filled out when we don't
have a reference to them anymore, and that might lead to bugs later.
Zero them out as a defensive coding measure.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfsd/nfs4proc.c