HIGH Introduced in 5.8
kcov RemoteCoverage Race
CVE-2026-80916
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: kcov: fix data corruption and race conditions on PREEMPT_RT syzbot is reporting KCOV state corruption on PREEMPT_RT kernels, for the temporary storage used for saving/restoring remote KCOV state is currently allocated as the per-CPU area. On PREEMPT_RT kernels, softirq handlers run as preemptible task threads (e.g., ksoftirqd). If a softirq context preempts a task running a remote KCOV session, it safely saves the task's state into the per-CPU area. However, if that softirq thread is subsequently preempted by a higher- priority softirq thread on the same CPU, the second softirq will overwrite the same per-CPU area, permanently destroying the original task's KCOV state. Fix this data corruption by moving the temporary storage from the per-CPU area to the per-thread area. Since each softirq thread now owns its own task context, nested softirq preemption no longer causes data overwrites. Note that while the temporary storage is now on a per-thread basis, the per-CPU kcov_percpu_data.lock must be retained, for we need to ensure that kcov_remote_start() and kcov_remote_stop() operate atomically without racing against asynchronous interrupts that manipulate the current task's KCOV state. It is likely that GFP_KERNEL allocation by vmalloc_node() in kcov_init() has already called panic() before returning NULL, for there will be no OOM-killable userspace processes when __init function of built-in module runs. But this patch also fixes crashing the kernel when vmalloc_node() in kcov_init() returned NULL, for kcov_init() left per-CPU irq_area == NULL but kcov_remote_start() depends on per-CPU irq_area != NULL, resulting in (1) doing vmalloc() in kcov_remote_start() despite !in_task() context (2) out-of-array-bounds access if (1) succeeded but kcov->remote_size < CONFIG_KCOV_IRQ_AREA_SIZE (3) always leak memory allocated by (1), eventually killing all OOM-killable userspace processes problems.
02KernelScan AI Analysis
Risk summary
A race condition in the KCOV subsystem on PREEMPT_RT kernels allows a local unprivileged user to corrupt kernel memory by triggering nested softirq preemption during remote coverage collection, leading to potential use-after-free or out-of-bounds access. The bug is reachable by any local user with access to KCOV device nodes and is specific to real-time preemption configurations.
Vulnerability analysis
On PREEMPT_RT kernels, softirq handlers run as preemptible threads. When a softirq preempts a task running a remote KCOV session, the saved task state goes into a shared per-CPU buffer. If a second softirq then preempts the first on the same CPU, it overwrites that buffer, destroying the original saved state and causing data corruption when the state is later restored. The fix moves temporary storage from the per-CPU area to per-thread storage, so each softirq thread has its own context and nested preemption no longer causes overwrites. The fix also addresses a secondary issue where a failed early allocation could leave a NULL pointer that later leads to invalid allocations, out-of-bounds access, and memory leaks in interrupt context. The vulnerable path is reachable locally by any user with access to the KCOV interface on a PREEMPT_RT kernel.
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.10 | 5.8 | 5.10.269 | ef7048d8a614 |
| 5.15 | 5.8 | 5.15.220 | 8ed3ddf23d39 |
| 6.1 | 5.8 | 6.1.185 | 5dc59fc959b2 |
| 6.12 | 5.8 | 6.12.106 | 18799e858b40 |
| 6.18 | 5.8 | 6.18.47 | e11f5b48c827 |
| 6.6 | 5.8 | 6.6.154 | a2fb8222cde2 |
| 7.1 | 5.8 | 7.1.11 | 22670d1552fe |
| 7.2 | 5.8 | 7.2.1 | f8c9a3ec36b4 |
| mainline | 5.8 | 7.3-rc1 | 2eed77fdcb0c |