CVE-2026-139797

ocfs2/cluster: hold a reference on the heartbeat thread

Published Nov 30, 2026 CVSS n/a EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

ocfs2/cluster: hold a reference on the heartbeat thread

Since commit 688bc88e2046 ("ocfs2/cluster: keep heartbeat local node
stable"), o2hb_thread() leaves its loop and returns when the local node
changes, for example after "echo 0 > node/<name>/local". The thread was
started with kthread_run() and nothing holds a reference to its
task_struct, so the task is freed once it exits, while reg->hr_task still
points to it.

Reading the region's pid attribute then reads the freed task, and removing
the region calls kthread_stop() on it:

BUG: KASAN: slab-use-after-free in o2hb_region_pid_show+0xb3/0xc0
refcount_t: addition on 0; use-after-free.
Oops: Oops: 0000 [#1] SMP KASAN NOPTI
RIP: 0010:kthread_stop+0xb1/0x390

The thread could already return by itself before, when heartbeat start was
aborted or on an unclean stop, but the local node change makes it
reachable from userspace at any time.

Create the thread, take a reference on it and only then wake it, so the
reference cannot race with the thread exiting. Drop it with
kthread_stop_put().

Analysis

AI-generated

Technical impact

The vulnerability in the Linux kernel’s ocfs2 cluster subsystem occurs when the heartbeat thread is allowed to exit without a reference’s protection, leading to a use‑after‑free of its task_struct. When a local node change triggers the thread to terminate, the stale reference can be accessed via the region’s pid attribute or when the region is removed. This results in a kernel panic that KASAN reports, and a kernel‑level fault that allows an attacker to cause a denial‑of‑service or elevate privileges by manipulating the heartbeat thread lifecycle.

Affected Systems

All Linux kernels that did not incorporate the fix commit 688bc88e2046. The vulnerability affects the ocfs2 cluster implementation present in the kernel’s file system handling code and is not tied to a specific distribution version beyond the kernel inclusion.

Risk and Exploitability

No CVSS or EPSS score is publicly available, and the vulnerability is not listed in CISA KEV. The attack vector likely requires userspace interaction with the ocfs2 cluster, such as echoing a value to node/<name>/local to trigger a local node change. While no documented exploit exists, the use‑after‑free can crash the kernel, and on older kernel versions it could pivot to privilege escalation if an attacker can influence the execution context during the race. The exploitation complexity is high, but the impact is severe, causing kernel instability and potential privilege gain.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update the Linux kernel to a version that contains commit 688bc88e2046 and subsequent fixes that add a reference to the heartbeat thread before waking it.
  • If the ocfs2 cluster is not required for your environment, disable it in the kernel configuration or unload the module to mitigate risk until a patch is available.
  • Enable kernel debugging (e.g., CONFIG_DEBUG_KERNEL) and monitor logs for KASAN or kernel panic messages that could signal an exploitation attempt.

Generated by OpenCVE AI on December 1, 2026 at 02:15 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-416
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: ocfs2/cluster: hold a reference on the heartbeat thread Since commit 688bc88e2046 ("ocfs2/cluster: keep heartbeat local node stable"), o2hb_thread() leaves its loop and returns when the local node changes, for example after "echo 0 > node/<name>/local". The thread was started with kthread_run() and nothing holds a reference to its task_struct, so the task is freed once it exits, while reg->hr_task still points to it. Reading the region's pid attribute then reads the freed task, and removing the region calls kthread_stop() on it: BUG: KASAN: slab-use-after-free in o2hb_region_pid_show+0xb3/0xc0 refcount_t: addition on 0; use-after-free. Oops: Oops: 0000 [#1] SMP KASAN NOPTI RIP: 0010:kthread_stop+0xb1/0x390 The thread could already return by itself before, when heartbeat start was aborted or on an unclean stop, but the local node change makes it reachable from userspace at any time. Create the thread, take a reference on it and only then wake it, so the reference cannot race with the thread exiting. Drop it with kthread_stop_put().
Title ocfs2/cluster: hold a reference on the heartbeat thread
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:38 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:20 PM
Modified
Nov 30, 2026, 2:20 PM