From: Trond Myklebust <trond.myklebust@hammerspace.com> stable inclusion from stable-v6.6.107 commit a022c9a46455b6315faa58d92c2a251ecd0ac6ef category: bugfix bugzilla: https://atomgit.com/src-openeuler/kernel/issues/8923 CVE: CVE-2025-39798 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=... -------------------------------- [ Upstream commit 31f1a960ad1a14def94fa0b8c25d62b4c032813f ] Don't clear the capabilities that are not going to get reset by the call to _nfs4_server_capabilities(). Reported-by: Scott Haiden <scott.b.haiden@gmail.com> Fixes: b01f21cacde9 ("NFS: Fix the setting of capabilities when automounting a new filesystem") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Wang Zhaolong <wangzhaolong@huaweicloud.com> --- fs/nfs/nfs4proc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 8f217629bc11..df26a1806472 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -3946,11 +3946,10 @@ int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle) struct nfs4_exception exception = { .interruptible = true, }; int err; - nfs_server_set_init_caps(server); do { err = nfs4_handle_exception(server, _nfs4_server_capabilities(server, fhandle), &exception); } while (exception.retry); -- 2.34.3