]> www.infradead.org Git - users/dwmw2/linux.git/commit
nfsd: make a copy of struct iattr before calling notify_change
authorJeff Layton <jlayton@kernel.org>
Wed, 17 May 2023 16:26:44 +0000 (12:26 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:19:28 +0000 (16:19 +0200)
commit645c1b4b139b43349ce47a1a5f375c87823809c5
treef973470b6d1c69963ed2208763612fda5ec96262
parent4e6e498291516f23068534e706c7e42158e20d05
nfsd: make a copy of struct iattr before calling notify_change

[ Upstream commit d53d70084d27f56bcdf5074328f2c9ec861be596 ]

notify_change can modify the iattr structure. In particular it can
end up setting ATTR_MODE when ATTR_KILL_SUID is already set, causing
a BUG() if the same iattr is passed to notify_change more than once.

Make a copy of the struct iattr before calling notify_change.

Reported-by: Zhi Li <yieli@redhat.com>
Link: https://bugzilla.redhat.com/show_bug.cgi?id=2207969
Tested-by: Zhi Li <yieli@redhat.com>
Fixes: 34b91dda7124 ("NFSD: Make nfsd4_setattr() wait before returning NFS4ERR_DELAY")
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/vfs.c