Commit 483e8b32 authored by Dmitry Mastykin's avatar Dmitry Mastykin Committed by Wang Zhaolong
Browse files

NFSv4: Fix memory leak in nfs4_set_security_label

mainline inclusion
from mainline-v6.10-rc4
commit aad11473f8f4be3df86461081ce35ec5b145ba68
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAGELL
CVE: CVE-2024-41076

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=aad11473f8f4be3df86461081ce35ec5b145ba68



--------------------------------

We leak nfs_fattr and nfs4_label every time we set a security xattr.

Signed-off-by: default avatarDmitry Mastykin <mastichi@gmail.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: default avatarWang Zhaolong <wangzhaolong1@huawei.com>
parent c9a2f58b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6247,6 +6247,7 @@ nfs4_set_security_label(struct inode *inode, const void *buf, size_t buflen)
	if (status == 0)
		nfs_setsecurity(inode, fattr);

	nfs_free_fattr(fattr);
	return status;
}
#endif	/* CONFIG_NFS_V4_SECURITY_LABEL */