CVE-2026-142807: ocfs2: publish the filecheck owner before adding sysfs attributes
In the Linux kernel, the following vulnerability has been resolved:
ocfs2: publish the filecheck owner before adding sysfs attributes
ocfs2filecheckcreatesysfs() initializes the filecheck allocation before calling kobjectinitandadd(), but assigns entry->fsfcheck only after that call returns. The default attribute group can already be visible while registration is in progress. A concurrent read can therefore enter ocfs2filecheckattrshow() with a NULL fsfcheck and try to lock its fclock.
Assign the initialized owner before adding the kobject, so every activated attribute has valid state. Clear the pointer when addition fails, preserving the existing teardown guard and error cleanup.
A controlled probe-instrumented test kernel with the original OCFS2 registration ordering produced this Oops during a concurrent sysfs read:
KASAN: null-ptr-deref in range [0x0000000000000028-0x000000000000002f] RIP: 0010:kasanbyteaccessible+0x15/0x30 Call Trace: <TASK> kasancheckbyte+0x13/0x50 lockacquire+0x113/0x300 rawspinlock+0x31/0x40 ocfs2filecheckattrshow+0x138/0x5f0 ocfs2filecheckshow+0x5d/0x90 sysfskfseqshow+0x1d3/0x360 seqreaditer+0x480/0x1110 kernfsfopreaditer+0x419/0x5a0 vfsread+0x7d2/0xc20 ksysread+0x111/0x200 dosyscall64+0x114/0x620 entrySYSCALL64afterhwframe+0x77/0x7f </TASK> Modules linked in:
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In ocfs2_filecheck_create_sysfs(), publish the initialized filecheck owner before adding sysfs attributes; clear the pointer if the addition fails, preserving the existing teardown guard and error cleanup.