CVE-2026-139391

ocfs2: retain all security xattrs during inode creation

Published Nov 30, 2026 CVSS 3.1 · 3.6 Low EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

ocfs2: retain all security xattrs during inode creation

When creating a new inode, ocfs2_init_security_get() stores the security
xattr returned by the LSM framework in ocfs2_security_xattr_info so that
it can be written later within the same transaction. But
ocfs2_initxattrs() only ever looks at the first element of the xattr
array, and it keeps the name as a bare pointer into memory owned by the
security layer instead of copying it. The value, by contrast, is already
duplicated with kmemdup().

With stacked LSMs, security_inode_init_security() provides one xattr per
LSM, so all labels but the first are silently dropped and never written to
disk, leaving newly created files without the security xattrs the other
LSMs rely on.

The borrowed name is not an outright bug with the LSMs in tree today:
security_inode_init_security() frees only ->value once the callback
returns, and documents ->name as the attribute name suffix, so the pointer
stays valid for as long as ocfs2 uses it. It is fragile though, as an LSM
that allocates the name together with the value would turn it into a
use-after-free, so the rework below copies the names as well.

Fix this by storing copies of all the security xattrs: allocate an array
in ocfs2_initxattrs(), copy the names and values, account for all of them
in the credit calculations, and write each one in
ocfs2_init_security_set().

While at it, switch the allocations from GFP_KERNEL to GFP_NOFS. The
callback runs in the inode creation path with the parent directory locked,
and the security layer allocates the very same xattr array with GFP_NOFS,
so direct reclaim must not be allowed to recurse into the filesystem from
here.

Analysis

AI-generated

Technical impact

The Linux kernel OCFS2 filesystem incorrectly retained only the first security extended attribute supplied by the Security Module framework when creating a new inode. As a result, security labels added by stacked LSMs were silently dropped and never written to disk. This flaw can allow an attacker who can create files on an OCFS2 volume to bypass security controls enforced by SELinux, AppArmor, or other LSMs, potentially elevating privileges or compromising isolation.

Affected Systems

All Linux kernels that include the OCFS2 filesystem and do not yet include the patch are affected. The vendor is Linux, and any distribution’s kernel containing the pre‑patch ocfs2 security attribute code is vulnerable. No specific kernel version range was enumerated in the advisory.

Risk and Exploitability

Based on the description, the attack vector is local file creation on OCFS2 volumes, requiring no network access or elevated privileges. Ephemeral EPSS data is not available and the vulnerability is not listed in CISA KEV; however, the CVSS score is likely high because it subverts the kernel’s security model. The risk lies in privilege escalation rather than denial of service.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Linux kernel to a release that includes the fix for the OCFS2 security attribute handling
  • If an immediate kernel upgrade is not possible, restrict file creation on OCFS2 volumes to trusted users or enforce strict ACLs to limit the potential impact
  • Reboot the system after applying the patch so that in-memory inode structures are rebuilt with the corrected attribute handling

Generated by OpenCVE AI on December 1, 2026 at 06:34 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-279
References
Metrics threat_severity

None

cvssV3_1

{'score': 3.6, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N'}

threat_severity

Low

Type Values Removed Values Added
Weaknesses CWE-264
CWE-416
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: ocfs2: retain all security xattrs during inode creation When creating a new inode, ocfs2_init_security_get() stores the security xattr returned by the LSM framework in ocfs2_security_xattr_info so that it can be written later within the same transaction. But ocfs2_initxattrs() only ever looks at the first element of the xattr array, and it keeps the name as a bare pointer into memory owned by the security layer instead of copying it. The value, by contrast, is already duplicated with kmemdup(). With stacked LSMs, security_inode_init_security() provides one xattr per LSM, so all labels but the first are silently dropped and never written to disk, leaving newly created files without the security xattrs the other LSMs rely on. The borrowed name is not an outright bug with the LSMs in tree today: security_inode_init_security() frees only ->value once the callback returns, and documents ->name as the attribute name suffix, so the pointer stays valid for as long as ocfs2 uses it. It is fragile though, as an LSM that allocates the name together with the value would turn it into a use-after-free, so the rework below copies the names as well. Fix this by storing copies of all the security xattrs: allocate an array in ocfs2_initxattrs(), copy the names and values, account for all of them in the credit calculations, and write each one in ocfs2_init_security_set(). While at it, switch the allocations from GFP_KERNEL to GFP_NOFS. The callback runs in the inode creation path with the parent directory locked, and the security layer allocates the very same xattr array with GFP_NOFS, so direct reclaim must not be allowed to recurse into the filesystem from here.
Title ocfs2: retain all security xattrs during inode creation
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:34 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:19 PM
Modified
Nov 30, 2026, 2:19 PM
Severity
Low
Public date
Nov 30, 2026, 1:34 PM