CVE-2026-99428: ocfs2: snapshot dentry names in file and setattr traces
In the Linux kernel, the following vulnerability has been resolved:
ocfs2: snapshot dentry names in file and setattr traces
Patch series "ocfs2: stabilize dentry names in file and setattr traces", v4.
Snapshot names at all six users of ocfs2fileops and at the separate setattr event. Patch 1 handles the five ordinary file-operation callers and setattr. Patch 2 handles release separately to preserve its locked open-count sample and take the snapshot outside that critical section.
The release explanation distinguishes its existing RCU lifetime coverage from name/length consistency. It does not claim that the ordinary callers' external-name UAF interleaving crosses the held inode spinlock. The release source change is unchanged from v3.
Patch 1 also removes the read callback's redundant NULL-inode check. The two patches apply independently and leave trace formats unchanged.
This patch (of 2):
The open, fsync, read, write and splice-read trace calls pass the live dentry name and length to the shared ocfs2fileops event class. ocfs2setattr() passes the same unprotected arguments to its own event. Both events size and copy a string field separately. A reference to the dentry does not pin the external storage backing an individual name.
With an event enabled, a caller can be preempted after loading the name pointer. A long-to-short rename can then replace the name and reclaim its old external allocation before the trace callback sizes or copies it, provided no other snapshot retains that allocation.
The setattr inode lock does not exclude every rename: a same-directory rename of a source directory need not take that directory's inode lock. It can therefore change the dentry name while setattr records its event. Inline names and separately loaded lengths can also change during trace record sizing and copying.
Take a dentry name snapshot around each of these six trace calls and pass both the string and length from the snapshot. Check event enablement before taking a snapshot. Keep the event classes and formats unchanged.
Also remove the redundant NULL-inode check in the read callback. fileinode() returns the open file's inode, which is already used by the trace call above the check.
The historical report below is from the read path.
KASAN report as below:
BUG: KASAN: slab-use-after-free in strlen+0x85/0xa0 Read of size 1 at addr ffff88810a5b2b18 by task python3/496
[CPU and host details omitted.] Call Trace: <TASK> dumpstacklvl+0x93/0xd0 printreport+0xce/0x630 ? strlen+0x85/0xa0 ? srsoaliasreturnthunk+0x5/0xfbef5 ? virtaddrvalid+0x20e/0x420 ? strlen+0x85/0xa0 kasanreport+0xe0/0x110 ? strlen+0x85/0xa0 strlen+0x85/0xa0 traceeventraweventocfs2fileops+0xf0/0x480 ? pfxtraceeventraweventocfs2fileops+0x10/0x10 ? srsoaliasreturnthunk+0x5/0xfbef5 ? pmbdprobehitcookie+0xe7/0x1c0 ? srsoaliasreturnthunk+0x5/0xfbef5 ? pfxpmbdprobehitcookie+0x10/0x10 ocfs2filereaditer+0x6cd/0xb30 ? pfxocfs2filereaditer+0x10/0x10 ? selinuxfilepermission+0x11d/0x540 ? srsoaliasreturnthunk+0x5/0xfbef5 ? securityfilepermission+0x26/0x80 vfsread+0x7d2/0xc20 ? pfxvfsread+0x10/0x10 ? srsoaliasreturnthunk+0x5/0xfbef5 ? pfxdosysopenat2+0x10/0x10 ksysread+0x111/0x200 ? pfxksysread+0x10/0x10 ? irqentryexit+0xbe/0x820 ? srsoaliasreturnthunk+0x5/0xfbef5 ? tracehardirqsonprepare+0x11d/0x150 ? srsoaliasreturnthunk+0x5/0xfbef5 dosyscall64+0x114/0x620 entrySYSCALL64afterhwframe+0x77/0x7f [User register dump omitted.] </TASK>
Allocated by task 489: kasansavestack+0x33/0x60 kasansavetrack+0x14/0x30 kasankmalloc+0xaa/0xb0 kmallocnoprof+0x2de/0x780 dalloc+0x5fc/0x8c0 dallocparallel+0x106/0x11d0 lookupopen+0x3ff/0 ---truncated---
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.117 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.61 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.2