CVE-2026-99691: ocfs2/cluster: unlink socket containers before releasing resources
In the Linux kernel, the following vulnerability has been resolved:
ocfs2/cluster: unlink socket containers before releasing resources
A socket container's node and socket must remain alive while the container is on sockcontainers. The debugfs formatter reads scnode and scsock under o2netdebuglock without taking their references, but sckrefrelease() releases both before taking that lock to unlink the container.
With CONFIGDEBUGFS enabled, a synchronous sender can retain its last socket-container reference after o2netdisconnectnode() has detached the connection and flushed o2netwq. The caller runs outside that workqueue. After the sender removes its configfs dependency, node removal can proceed without waiting for the sender's final scput():
Sender (final scput) Configfs rmdir Debugfs reader -------------------- -------------- -------------- o2nmundependitem() Drop node item refs o2nmnodeput() [node can be freed] scseqshow() Lock debug lock Read scnode->ndname Unlock debug lock scnode = NULL o2netdebugdelsc()
The earlier socket release has a similar window. The container is still selectable while its socket has been released and scsock has not yet been cleared:
Sender (final scput) Debugfs reader -------------------- -------------- sockrelease(sc->scsock) [socket can be freed] scseqshow() Lock debug lock Read scsock->sk fields Unlock debug lock scsock = NULL ... o2netdebugdelsc()
Move o2netdebugdelsc() before releasing either resource. Unlinking under the existing debug lock waits for an active formatter to finish and prevents later readers from selecting the container. This covers both socket fields and node fields, including ndnum in the stats formatter.
KASAN report as below:
BUG: KASAN: slab-use-after-free in string+0x42b/0x470 Read of size 1 at addr ffff88810f56fc90 by task python3/506
CPU: 0 UID: 0 PID: 506 Comm: python3 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: <TASK> dumpstacklvl+0x93/0xd0 printreport+0xce/0x630 kasanreport+0xe0/0x110 string+0x42b/0x470 vsnprintf+0x330/0x1110 seqprintf+0x1a8/0x260 scseqshow+0x604/0x9f0 seqreaditer+0x480/0x1110 seqread+0x362/0x5a0 fullproxyread+0x11f/0x180 vfsread+0x1a0/0xc20 ksysread+0x111/0x200 dosyscall64+0x114/0x620 entrySYSCALL64afterhwframe+0x77/0x7f
(User register dump omitted.)
</TASK>
Allocated by task 497: kasansavestack+0x33/0x60 kasansavetrack+0x14/0x30 kasankmalloc+0xaa/0xb0 kmalloccachenoprof+0x28d/0x610 o2nmnodegroupmakeitem+0xea/0x1a0 configfsmkdir+0x762/0xca0 vfsmkdir+0x399/0x7e0 filenamemkdirat+0x129/0x450 x64sysmkdir+0x70/0xa0 dosyscall64+0x114/0x620 entrySYSCALL64afterhwframe+0x77/0x7f
Freed by task 505: kasansavestack+0x33/0x60 kasansavetrack+0x14/0x30 kasansavefreeinfo+0x3b/0x60 kasanslabfree+0x5f/0x80 kfree+0x308/0x580 configitemcleanup+0x14b/0x230 configitemput+0x79/0x90 scput+0x454/0x6e0 o2netsendmessagevec+0x63d/0x1560 o2netsendmessage+0xa6/0xe0 validationsendwrite+0x17f/0x1d0 fullproxywrite+0x11f/0x180 vfswrite+0x25a/0x1010 ksyswrite+ ---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.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 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.5-1 - Compensating control
In sc_kref_release(), call o2net_debug_del_sc() before releasing either sc_sock or sc_node, unlinking the socket container before its resources are released.
Event History
Frequently Asked Questions
Which systems are exposed to this race condition?
The affected path is in the OCFS2 cluster code and requires CONFIG_DEBUG_FS to be enabled. The unsafe debugfs formatter can read socket-container node or socket fields while the container remains on the socket-container list but its resources have already been released.
What activity is required to trigger the use-after-free?
The described race involves a synchronous sender retaining the final socket-container reference after node disconnection, followed by configuration removal and a concurrent debugfs read. Node removal can then free the node before the debugfs reader accesses sc_node; a similar window exists for sc_sock after socket release.
Is there a documented workaround if the fix cannot be applied immediately?
No workaround is provided in the available data. The exposure described specifically depends on CONFIG_DEBUG_FS and concurrent access to the relevant debugfs formatter.