ocfs2: retain all security xattrs during inode creation

Summary

CVECVE-2026-139391
StatePUBLISHED
AssignerLinux
Source PriorityCVE Program / NVD first with legacy fallback
Published2026-11-30 14:19:07 UTC
Updated2026-11-30 14:19:07 UTC
DescriptionIn 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.

Vendor Declared Affected Products

SourceVendorProductVersionPlatforms
CNA Linux Linux affected c41324385aa7c9ac0fc1fa9c2521aacedea24788 ce055a1378e5b4e8fcaf1c8dc4df82c326bf9306 git Not specified
CNA Linux Linux affected 291fe3d6f5dbafa6dd87a510c1351e8ce8a8a52e 1b9930ebec9dc92b3cce3231dcb9ed8ebd5da7dd git Not specified
CNA Linux Linux affected 8bdf47f9dbeac6b247c8f14fbaebfe020d9a2ffa ae8ee59668124a4a544996727067cc5ae20af6dd git Not specified
CNA Linux Linux affected de3004c874e740304cc4f4a83d6200acb511bbda 3a6df319db221e1bc4eb0ce22218c904512b1f60 git Not specified
CNA Linux Linux affected de3004c874e740304cc4f4a83d6200acb511bbda 5c815fd8de4a7e935b287ebf980121876f229b76 git Not specified
CNA Linux Linux affected de3004c874e740304cc4f4a83d6200acb511bbda 5bc277c89570e096c574188dcfdd538e3c139bd1 git Not specified
CNA Linux Linux affected de3004c874e740304cc4f4a83d6200acb511bbda 314f6183f13fda459261a4723a453df67e15008b git Not specified
CNA Linux Linux affected de3004c874e740304cc4f4a83d6200acb511bbda d637475617d8468c2740a3436428681bcc8d3572 git Not specified
CNA Linux Linux affected 0c80524f34e66fed0bc837758c5a80b1527847a4 git Not specified
CNA Linux Linux affected 5.10.181 5.10.275 semver Not specified
CNA Linux Linux affected 5.15.114 5.15.226 semver Not specified
CNA Linux Linux affected 6.1.31 6.1.193 semver Not specified
CNA Linux Linux affected 6.3.5 6.4 semver Not specified
CNA Linux Linux affected 6.4 Not specified
CNA Linux Linux unaffected 6.4 semver Not specified
CNA Linux Linux unaffected 5.10.275 5.10.* semver Not specified
CNA Linux Linux unaffected 5.15.226 5.15.* semver Not specified
CNA Linux Linux unaffected 6.1.193 6.1.* semver Not specified
CNA Linux Linux unaffected 6.6.163 6.6.* semver Not specified
CNA Linux Linux unaffected 6.12.119 6.12.* semver Not specified
CNA Linux Linux unaffected 6.18.65 6.18.* semver Not specified
CNA Linux Linux unaffected 7.3.6 7.3.* semver Not specified
CNA Linux Linux unaffected 7.4-rc1 * original_commit_for_fix Not specified

References

ReferenceSourceLinkTags
git.kernel.org/stable/c/5c815fd8de4a7e935b287ebf980121876f229b76 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/3a6df319db221e1bc4eb0ce22218c904512b1f60 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/ce055a1378e5b4e8fcaf1c8dc4df82c326bf9306 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/ae8ee59668124a4a544996727067cc5ae20af6dd 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/5bc277c89570e096c574188dcfdd538e3c139bd1 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/d637475617d8468c2740a3436428681bcc8d3572 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/314f6183f13fda459261a4723a453df67e15008b 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/1b9930ebec9dc92b3cce3231dcb9ed8ebd5da7dd 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
CVE Program record CVE.ORG www.cve.org canonical
NVD vulnerability detail NVD nvd.nist.gov canonical, analysis

© CVE.report 2026

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report