AZL-116905: CVE-2026-139129 affecting package kernel 6.6.161.1-1
In the Linux kernel, the following vulnerability has been resolved:
xattr: always invoke capconvertnscap() for security.capability writes
Commit 8db6c34f1dbc ("Introduce v3 namespaced file capabilities") changed capinodesetxattr() to return 0 unconditionally for XATTRNAMECAPS ("security.capability") and moved capability validation into capconvertnscap(), but placed the call inside the "if (size)" block in setxattr(). Commit 7c03e2cda4a5 ("vfs: move capconvertnscap() call into vfssetxattr()") preserved that "size &&" condition in vfssetxattr():
if (size && strcmp(name, XATTRNAMECAPS) == 0) { error = capconvertnscap(idmap, dentry, &value, size); ... }
For security. extended attributes, xattrpermission() skips inodepermission(MAYWRITE) and leaves permission checks to the security module, while capinodesetxattr() returns 0 for XATTRNAMECAPS assuming capconvertnscap() has already validated the write. Because vfssetxattr() treats size == 0 as an empty attribute write (setting value = "") rather than a removal, calling setxattr(2) on "security.capability" with size == 0 bypasses capconvertnscap() and allows an unprivileged caller without CAPSETFCAP or write permission on the target inode to write a 0-byte security.capability xattr (or overwrite an existing one).
When that binary is subsequently executed, getvfscapsfromdisk() reads the 0-byte security.capability xattr and fails the size < sizeof(magicetc) check with -EINVAL, causing execve(2) to fail with -EINVAL.
Always invoke capconvertnscap() when strcmp(name, XATTRNAMECAPS) == 0 regardless of size, so that 0-byte writes hit the existing !ivalue / !validheader() checks in capconvertnscap() and are rejected with -EINVAL.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In cap_inode_setxattr(), invoke cap_convert_nscap() whenever strcmp(name, XATTR_NAME_CAPS) == 0, regardless of size.
Event History
Frequently Asked Questions
What access does an attacker need to exploit this issue?
An attacker needs the ability to call setxattr(2) on a file's security.capability extended attribute with a zero-length value. The described bypass allows an unprivileged caller lacking CAP_SETFCAP and write permission to perform that attribute write.
What condition triggers the permission-check bypass?
The bypass occurs specifically when security.capability is written with size set to zero. In this path, the kernel treats the operation as setting an empty attribute rather than removing it, while skipping cap_convert_nscap() validation.
How can I determine whether a system may be affected?
Systems using the Azure Linux kernel package version 6.6.161.1-1 are identified as affected by the provided data. A potentially affected system permits a zero-length setxattr(2) write to security.capability without the capability validation that normally enforces CAP_SETFCAP and write permission.