CVE-2026-142878: ocfs2: wait for filecheck kobject release after a failed add
In the Linux kernel, the following vulnerability has been resolved:
ocfs2: wait for filecheck kobject release after a failed add
The filecheck kobject and its release completion are embedded in ocfs2super, so the osb must outlive the kobject. On a failed kobjectinitandadd(), creation clears fsfcheck and calls kobjectput(), but returns without waiting for the release callback.
With CONFIGDEBUGKOBJECTRELEASE, the last put queues delayed cleanup. Mount failure can then free the containing osb before the embedded release timer expires:
Mount failure Delayed cleanup ------------- --------------- ocfs2filecheckcreatesysfs() kobjectinitandadd() fails fsfcheck = NULL kobjectput() queue delayed release return to mount error cleanup ocfs2dismountvolume() removesysfs() skips the wait kfree(osb) expire embedded release timer access freed osb
The normal removal path waits for fskobjunregister, but it returns early when fsfcheck is NULL. The failed-add path therefore leaves the delayed work and its completion in freed storage.
Wait for the existing release completion after the failed-add kobjectput(), before returning to mount error cleanup. This keeps the enclosing osb alive until the kobject has finished releasing, matching the normal teardown path.
KASAN report as below:
BUG: KASAN: slab-use-after-free in runtimers+0xa6d/0xa90 Write of size 8 at addr ffff8881178a5658 by task swapper/0/0 CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Not tainted 7.3.0-rc4-next-20260921-pmb-ocfs2-functional-v1+ #1 PREEMPT(lazy) Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, archcaps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: <IRQ> dumpstacklvl+0x93/0xd0 printreport+0xce/0x630 ? runtimers+0xa6d/0xa90 ? srsoaliasreturnthunk+0x5/0xfbef5 ? virtaddrvalid+0x20e/0x420 ? runtimers+0xa6d/0xa90 kasanreport+0xe0/0x110 ? runtimers+0xa6d/0xa90 runtimers+0xa6d/0xa90 ? srsoaliasreturnthunk+0x5/0xfbef5 ? pfxruntimers+0x10/0x10 ? lockacquire+0x5a3/0x2140 ? pfxdorawspinlock+0x10/0x10 ? srsoaliasreturnthunk+0x5/0xfbef5 timerexpireremote+0xfa/0x160 ? pfxtimerexpireremote+0x10/0x10 ? srsoaliasreturnthunk+0x5/0xfbef5 ? srsoaliasreturnthunk+0x5/0xfbef5 ? tracehardirqson+0x18/0x160 tmigrhandleremoteup+0x4ba/0x9d0 ? pfxtmigrhandleremoteup+0x10/0x10 ? tmigrhandleremote+0x21a/0x340 ? srsoaliasreturnthunk+0x5/0xfbef5 ? lockrelease+0xc8/0x290 ? pfxtmigrhandleremoteup+0x10/0x10 walkgroupsfrom+0x5a/0x160 tmigrhandleremote+0x24f/0x340 ? pfxtmigrhandleremote+0x10/0x10 ? lockacquire+0x190/0x300 ? srsoaliasreturnthunk+0x5/0xfbef5 ? lockrelease+0xc8/0x290 runtimersoftirq+0x222/0x270 ? pfxruntimersoftirq+0x10/0x10 ? srsoaliasreturnthunk+0x5/0xfbef5 ? srsoaliasreturnthunk+0x5/0xfbef5 ? lockdephardirqsonprepare+0xb8/0x1a0 ? srsoaliasreturnthunk+0x5/0xfbef5 handlesoftirqs+0x1fa/0x8d0 ? pfxhandlesoftirqs+0x10/0x10 ? srsoaliasreturnthunk+0x5/0xfbef5 ? rawspinunlock+0x23/0x40 ? srsoaliasreturnthunk+0x5/0xfbef5 ? hrtimerrearmdeferred+0x1fb/0x5d0 irqexitrcu+0x113/0x1e0 irqexitrcu+0xe/0x20 sysvecapictimerinterrupt+0x6c/0x80 </IRQ> <TASK> asmsysvecapictimerinterrupt+0x1a/0x20 RIP: 0010:pvnativesafehalt+0xf/0x20 Code: fa 18 01 e9 ee 37 ff fa 0f 1f 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa eb 07 0f 00 2d 23 c7 14 00 fb f4 <e9> c7 37 ff fa 66 2e 0f 1f 84 00 00 00 00 00 66 90 90 90 90 90 90 RSP: 0018:ffffffff87c07cf8 EFLAGS: 00000206 R ---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 4.20 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.2 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.10.275 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.15.226 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.1.193 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.6.163 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.118 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.64 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.5
Event History
Frequently Asked Questions
What systems are exposed to this use-after-free condition?
Systems mounting an OCFS2 filesystem can be exposed when creation of the filecheck kobject fails during mount. The failure path can free the containing ocfs2_super structure while the kobject release callback is still pending.
What makes the issue more likely to manifest?
With CONFIG_DEBUG_KOBJECT_RELEASE enabled, the final kobject_put() queues delayed cleanup, creating a window in which mount error cleanup can free the embedded object before its delayed release runs.
Why does the existing cleanup path not prevent the problem?
Normal removal waits for the filecheck kobject release completion, but the failed-add path clears fs_fcheck. The removal routine then skips that wait, leaving delayed release work referencing storage that may already have been freed.