CVE-2026-99963: ocfs2/cluster: initialize heartbeat regions before publishing them
In the Linux kernel, the following vulnerability has been resolved:
ocfs2/cluster: initialize heartbeat regions before publishing them
A region on o2hballregions must have an initialized config item and name. o2hbheartbeatgroupmakeitem() currently links the zeroed region under o2hblivelock, drops the lock, and only then initializes hritem. The lock therefore protects the list without protecting initialization from readers of the published item.
With global heartbeat enabled, a DLMQUERYREGION from the current joining node can pass the existing-domain and protocol checks while a configfs mkdir creates another region. The DLM locks are not taken by the constructor, and the network worker does not take the configfs subsystem mutex. The following ordering is possible:
Configfs mkdir O2net receive worker -------------- -------------------- Allocate reg Lock o2hblivelock Link into o2hballregions Unlock o2hblivelock dlmqueryregionhandler() dlmmatchregions() o2hbgetallregions() Lock o2hblivelock Copy 32 bytes from NULL name Unlock o2hblivelock configiteminittypename()
The query thus dereferences NULL. Initialize hritem before linking the region so the existing list lock also orders name initialization before any reader. Reject a failed name allocation, since the initialization helper does not propagate that error.
Use configitemput() on initialized constructor failures to release the name and respect references retained by o2hbregionpin(). Initialize the list heads, mutex and delayed works needed by o2hbregionrelease() before any such put, and leave the list node self-linked after rollback. Keep the existing handler drain before removing a failed published item.
KASAN report as below:
================================================================== BUG: KASAN: null-ptr-deref in o2hbgetallregions+0xbb/0x1f0 Read of size 32 at addr 0000000000000000 by task kworker/u16:1/14
CPU: 2 UID: 0 PID: 14 Comm: kworker/u16:1 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 Workqueue: o2net o2netrxuntilempty Call Trace: <TASK> dumpstacklvl+0x93/0xd0 kasanreport+0xe0/0x110 ? o2hbgetallregions+0xbb/0x1f0 kasancheckrange+0x105/0x1b0 asanmemcpy+0x23/0x60 o2hbgetallregions+0xbb/0x1f0 dlmqueryregionhandler+0x4c2/0xc20 ? pfxdlmqueryregionhandler+0x10/0x10 ? srsoaliasreturnthunk+0x5/0xfbef5 ? srsoaliasreturnthunk+0x5/0xfbef5 ? tracehardirqson+0x18/0x160 ? srsoaliasreturnthunk+0x5/0xfbef5 ? kvmclockgetcycles+0x31/0x60 ? srsoaliasreturnthunk+0x5/0xfbef5 ? pfxdlmqueryregionhandler+0x10/0x10 o2netrxuntilempty+0x1a50/0x3200 ? reacquireheldlocks+0xdd/0x200 ? pfxo2netrxuntilempty+0x10/0x10 ? lockacquire+0x190/0x300 ? processonework+0x935/0x1b40 ? processonework+0x834/0x1b40 ? srsoaliasreturnthunk+0x5/0xfbef5 ? lockrelease+0xc8/0x290 ? srsoaliasreturnthunk+0x5/0xfbef5 processonework+0x9a8/0x1b40 ? pfxprocessonework+0x10/0x10 ? lockacquire+0x190/0x300 ? lockisheldtype+0x8f/0x100 ? srsoaliasreturnthunk+0x5/0xfbef5 workerthread+0x65c/0xe40 ? srsoaliasreturnthunk+0x5/0xfbef5 ? kthreadparkme+0x177/0x220 ? srsoaliasreturnthunk+0x5/0xfbef5 ? pfxworkerthread+0x10/0x10 kthread+0x351/0x460 ? srsoaliasreturnthunk+0x5/0xfbef5 ? pfxkthread+0x10/0x10 ---truncated---