HIGH
kernel TaskDead Race
CVE-2026-46173
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.8HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: exit: prevent preemption of oopsing TASK_DEAD task When an already-exiting task oopses, make_task_dead() currently calls do_task_dead() with preemption enabled. That is forbidden: do_task_dead() calls __schedule(), which has a comment saying "WARNING: must be called with preemption disabled!". If an oopsing task is preempted in do_task_dead(), between becoming TASK_DEAD and entering the scheduler explicitly, bad things happen: finish_task_switch() assumes that once the scheduler has switched away from a TASK_DEAD task, the task can never run again and its stack is no longer needed; but that assumption apparently doesn't hold if the dead task was preempted (the SM_PREEMPT case). This means that the scheduler ends up repeatedly dropping references on the dead task's stack, which can lead to use-after-free or double-free of the entire task stack; in other words, two tasks can end up running on the same stack, resulting in various kinds of memory corruption. (This does not just affect "recursively oopsing" tasks; it is enough to oops once during task exit, for example in a file_operations::release handler)
02KernelScan AI Analysis
Risk summary
Local attackers with low privileges can trigger memory corruption by causing task oops during exit, leading to use-after-free of task stacks. This can result in arbitrary code execution or system crashes when multiple tasks run on the same corrupted stack.
Vulnerability analysis
The vulnerability occurs in make_task_dead() when an oopsing task calls do_task_dead() with preemption enabled, violating the scheduler's requirement that __schedule() be called with preemption disabled. If the TASK_DEAD task is preempted between setting its state and entering the scheduler, finish_task_switch() incorrectly assumes the task will never run again and drops references to its stack. This creates a race condition where the scheduler can repeatedly free the same task stack, leading to use-after-free or double-free conditions that allow multiple tasks to share the same stack memory. The fix adds preempt_disable() before calling do_task_dead() to prevent preemption during this critical window. The attack surface is local-only, requiring the ability to trigger task oops during exit (e.g., through file operation handlers).
03Fix Versions
| Branch | Fixed in | Patch commit |
|---|---|---|
| 6.1 | 6.1.175 | 3d6fb8a7690c |
| 6.12 | 6.12.88 | 7b2800ba5f5f |
| 6.18 | 6.18.30 | 6f49f94f3b11 |
| 6.6 | 6.6.140 | 640b4c00fb0e |
| 7.0 | 7.0.7 | 9756b3db5db6 |
| mainline | 7.1-rc4 | c1fa0bb633e4 |