Skip to contentSkip to conversation

CVE-2026-53397: nfsd: fix posix_acl leak on SETACL decode failure

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Jul 19

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

nfsd: fix posix_acl leak on SETACL decode failure

nfsaclsvc_decode_setaclargs() and nfs3svc_decode_setaclargs() each call nfs_stream_decode_acl() twice, first for NFS_ACL and then for NFS_DFACL. Each successful call transfers ownership of a freshly allocated posix_acl into argp->acl_access or argp->acl_default. If the first call succeeds but the second fails, the decoder returns false and argp->acl_access is left dangling.

ACLPROC2_SETACL.pc_release was wired to nfssvc_release_attrstat and ACLPROC3_SETACL.pc_release was wired to nfs3svc_release_fhandle. Both only call fh_put() and have no knowledge of the ACL fields on argp. The posix_acl_release() pairs sat at the out: labels inside nfsacld_proc_setacl() and nfsd3_proc_setacl(), but svc_process() skips pc_func when pc_decode returns false, so that cleanup is unreachable on decode failure:

svc_process_common()
pc_decode() /* decode_setaclargs: false */
/* pc_func skipped */
pc_release() /* fh_put only -- ACLs leaked */

The orphaned posix_acl is leaked for the lifetime of the server.

Fix by adding nfsaclsvc_release_setacl() and nfs3svc_release_setacl(), which release both argp->acl_access and argp->acl_default in addition to fh_put(), and wiring them as pc_release for their respective SETACL procedures. pc_release runs on every path svc_process() takes after decode, including decode failure, so the posix_acl_release() pairs are removed from the proc functions' out: labels to keep ownership in one place. This matches the existing release_getacl() pattern used by the sibling GETACL procedures.

The Linux kernel CVE team has assigned CVE-2026-53397 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 2.6.13 with commit a257cdd0e2179630d3201c32ba14d7fcb3c3a055 and fixed in 5.10.260 with commit b2eb1ffd511d1b3c3e21122f97cbbccea411e277
	Issue introduced in 2.6.13 with commit a257cdd0e2179630d3201c32ba14d7fcb3c3a055 and fixed in 5.15.211 with commit b94c4be77682aab06d65ca7296149e3bcfb37353
	Issue introduced in 2.6.13 with commit a257cdd0e2179630d3201c32ba14d7fcb3c3a055 and fixed in 6.1.177 with commit 887f92ceccf3eacd5f2402db21254d66372fae00
	Issue introduced in 2.6.13 with commit a257cdd0e2179630d3201c32ba14d7fcb3c3a055 and fixed in 6.6.144 with commit 1e96239fddcefacf6afe6c498357be68eacbcabc
	Issue introduced in 2.6.13 with commit a257cdd0e2179630d3201c32ba14d7fcb3c3a055 and fixed in 6.12.95 with commit bd69a825485168ef74e815ecb286754b570fdcc7
	Issue introduced in 2.6.13 with commit a257cdd0e2179630d3201c32ba14d7fcb3c3a055 and fixed in 6.18.38 with commit 136b416593f1349cf6f72c8e3d18f0f204ee8545
	Issue introduced in 2.6.13 with commit a257cdd0e2179630d3201c32ba14d7fcb3c3a055 and fixed in 7.1.3 with commit a5b42c1e4ff2befaa6b96f7cbf32174751eba083
	Issue introduced in 2.6.13 with commit a257cdd0e2179630d3201c32ba14d7fcb3c3a055 and fixed in 7.2-rc1 with commit 0853ac544c590880d797b04daa33fcb72b6be0e1

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-53397

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
fs/nfsd/nfs2acl.c
fs/nfsd/nfs3acl.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/b2eb1ffd511d1b3c3e21122f97cbbccea411e277
	https://git.kernel.org/stable/c/b94c4be77682aab06d65ca7296149e3bcfb37353
	https://git.kernel.org/stable/c/887f92ceccf3eacd5f2402db21254d66372fae00
	https://git.kernel.org/stable/c/1e96239fddcefacf6afe6c498357be68eacbcabc
	https://git.kernel.org/stable/c/bd69a825485168ef74e815ecb286754b570fdcc7
	https://git.kernel.org/stable/c/136b416593f1349cf6f72c8e3d18f0f204ee8545
	https://git.kernel.org/stable/c/a5b42c1e4ff2befaa6b96f7cbf32174751eba083
	https://git.kernel.org/stable/c/0853ac544c590880d797b04daa33fcb72b6be0e1