Security Vulnerability Report
中文
CVE-2026-23294 CVSS 7.0 HIGH

CVE-2026-23294

Published: 2026-03-25 11:16:25
Last Modified: 2026-04-02 15:16:31
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67

Description

In the Linux kernel, the following vulnerability has been resolved: bpf: Fix race in devmap on PREEMPT_RT On PREEMPT_RT kernels, the per-CPU xdp_dev_bulk_queue (bq) can be accessed concurrently by multiple preemptible tasks on the same CPU. The original code assumes bq_enqueue() and __dev_flush() run atomically with respect to each other on the same CPU, relying on local_bh_disable() to prevent preemption. However, on PREEMPT_RT, local_bh_disable() only calls migrate_disable() (when PREEMPT_RT_NEEDS_BH_LOCK is not set) and does not disable preemption, which allows CFS scheduling to preempt a task during bq_xmit_all(), enabling another task on the same CPU to enter bq_enqueue() and operate on the same per-CPU bq concurrently. This leads to several races: 1. Double-free / use-after-free on bq->q[]: bq_xmit_all() snapshots cnt = bq->count, then iterates bq->q[0..cnt-1] to transmit frames. If preempted after the snapshot, a second task can call bq_enqueue() -> bq_xmit_all() on the same bq, transmitting (and freeing) the same frames. When the first task resumes, it operates on stale pointers in bq->q[], causing use-after-free. 2. bq->count and bq->q[] corruption: concurrent bq_enqueue() modifying bq->count and bq->q[] while bq_xmit_all() is reading them. 3. dev_rx/xdp_prog teardown race: __dev_flush() clears bq->dev_rx and bq->xdp_prog after bq_xmit_all(). If preempted between bq_xmit_all() return and bq->dev_rx = NULL, a preempting bq_enqueue() sees dev_rx still set (non-NULL), skips adding bq to the flush_list, and enqueues a frame. When __dev_flush() resumes, it clears dev_rx and removes bq from the flush_list, orphaning the newly enqueued frame. 4. __list_del_clearprev() on flush_node: similar to the cpumap race, both tasks can call __list_del_clearprev() on the same flush_node, the second dereferences the prev pointer already set to NULL. The race between task A (__dev_flush -> bq_xmit_all) and task B (bq_enqueue -> bq_xmit_all) on the same CPU: Task A (xdp_do_flush) Task B (ndo_xdp_xmit redirect) ---------------------- -------------------------------- __dev_flush(flush_list) bq_xmit_all(bq) cnt = bq->count /* e.g. 16 */ /* start iterating bq->q[] */ <-- CFS preempts Task A --> bq_enqueue(dev, xdpf) bq->count == DEV_MAP_BULK_SIZE bq_xmit_all(bq, 0) cnt = bq->count /* same 16! */ ndo_xdp_xmit(bq->q[]) /* frames freed by driver */ bq->count = 0 <-- Task A resumes --> ndo_xdp_xmit(bq->q[]) /* use-after-free: frames already freed! */ Fix this by adding a local_lock_t to xdp_dev_bulk_queue and acquiring it in bq_enqueue() and __dev_flush(). These paths already run under local_bh_disable(), so use local_lock_nested_bh() which on non-RT is a pure annotation with no overhead, and on PREEMPT_RT provides a per-CPU sleeping lock that serializes access to the bq.

CVSS Details

CVSS Score
7.0
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

No configuration data available.

Linux Kernel (PREEMPT_RT enabled, with commit < 1872e75375c40add4a35990de3be77b5741c252c)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
/* * Conceptual PoC for CVE-2026-23294 Race Condition * This demonstrates the logic flow causing the race. */ #include <linux/module.h> #include <linux/kernel.h> #include <linux/bpf.h> // Simulated structure based on vulnerability description struct xdp_dev_bulk_queue { void *q[16]; int count; }; static int __init poc_init(void) { // In a real exploit, this would involve triggering XDP redirects // on a PREEMPT_RT kernel to force preemption between: // Task A: cnt = bq->count; // Preemption happens here // Task B: bq_xmit_all(bq); // Frees frames // Task A: ndo_xdp_xmit(bq->q[]); // Use-after-free printk(KERN_INFO "CVE-2026-23294: Triggering race condition logic...\n"); // Logic simulation: // 1. Load BPF program with devmap redirect. // 2. Send packets to trigger redirect. // 3. Exploit CFS scheduler latency on RT kernel. return 0; } static void __exit poc_exit(void) { printk(KERN_INFO "CVE-2026-23294: Module unloaded.\n"); } module_init(poc_init); module_exit(poc_exit); MODULE_LICENSE("GPL");

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-23294", "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "published": "2026-03-25T11:16:24.697", "lastModified": "2026-04-02T15:16:30.507", "vulnStatus": "Undergoing Analysis", "cveTags": [], "descriptions": [{"lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Fix race in devmap on PREEMPT_RT\n\nOn PREEMPT_RT kernels, the per-CPU xdp_dev_bulk_queue (bq) can be\naccessed concurrently by multiple preemptible tasks on the same CPU.\n\nThe original code assumes bq_enqueue() and __dev_flush() run atomically\nwith respect to each other on the same CPU, relying on\nlocal_bh_disable() to prevent preemption. However, on PREEMPT_RT,\nlocal_bh_disable() only calls migrate_disable() (when\nPREEMPT_RT_NEEDS_BH_LOCK is not set) and does not disable\npreemption, which allows CFS scheduling to preempt a task during\nbq_xmit_all(), enabling another task on the same CPU to enter\nbq_enqueue() and operate on the same per-CPU bq concurrently.\n\nThis leads to several races:\n\n1. Double-free / use-after-free on bq->q[]: bq_xmit_all() snapshots\n cnt = bq->count, then iterates bq->q[0..cnt-1] to transmit frames.\n If preempted after the snapshot, a second task can call bq_enqueue()\n -> bq_xmit_all() on the same bq, transmitting (and freeing) the\n same frames. When the first task resumes, it operates on stale\n pointers in bq->q[], causing use-after-free.\n\n2. bq->count and bq->q[] corruption: concurrent bq_enqueue() modifying\n bq->count and bq->q[] while bq_xmit_all() is reading them.\n\n3. dev_rx/xdp_prog teardown race: __dev_flush() clears bq->dev_rx and\n bq->xdp_prog after bq_xmit_all(). If preempted between\n bq_xmit_all() return and bq->dev_rx = NULL, a preempting\n bq_enqueue() sees dev_rx still set (non-NULL), skips adding bq to\n the flush_list, and enqueues a frame. When __dev_flush() resumes,\n it clears dev_rx and removes bq from the flush_list, orphaning the\n newly enqueued frame.\n\n4. __list_del_clearprev() on flush_node: similar to the cpumap race,\n both tasks can call __list_del_clearprev() on the same flush_node,\n the second dereferences the prev pointer already set to NULL.\n\nThe race between task A (__dev_flush -> bq_xmit_all) and task B\n(bq_enqueue -> bq_xmit_all) on the same CPU:\n\n Task A (xdp_do_flush) Task B (ndo_xdp_xmit redirect)\n ---------------------- --------------------------------\n __dev_flush(flush_list)\n bq_xmit_all(bq)\n cnt = bq->count /* e.g. 16 */\n /* start iterating bq->q[] */\n <-- CFS preempts Task A -->\n bq_enqueue(dev, xdpf)\n bq->count == DEV_MAP_BULK_SIZE\n bq_xmit_all(bq, 0)\n cnt = bq->count /* same 16! */\n ndo_xdp_xmit(bq->q[])\n /* frames freed by driver */\n bq->count = 0\n <-- Task A resumes -->\n ndo_xdp_xmit(bq->q[])\n /* use-after-free: frames already freed! */\n\nFix this by adding a local_lock_t to xdp_dev_bulk_queue and acquiring\nit in bq_enqueue() and __dev_flush(). These paths already run under\nlocal_bh_disable(), so use local_lock_nested_bh() which on non-RT is\na pure annotation with no overhead, and on PREEMPT_RT provides a\nper-CPU sleeping lock that serializes access to the bq."}, {"lang": "es", "value": "En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nbpf: Corrige condición de carrera en devmap en PREEMPT_RT\n\nEn kernels PREEMPT_RT, la xdp_dev_bulk_queue (bq) por CPU puede ser accedida concurrentemente por múltiples tareas preemptivas en la misma CPU.\n\nEl código original asume que bq_enqueue() y __dev_flush() se ejecutan atómicamente con respecto la una a la otra en la misma CPU, confiando en local_bh_disable() para prevenir la expropiación. Sin embargo, en PREEMPT_RT, local_bh_disable() solo llama a migrate_disable() (cuando PREEMPT_RT_NEEDS_BH_LOCK no está configurado) y no deshabilita la expropiación, lo que permite que la planificación CFS expropie una tarea durante bq_xmit_all(), permitiendo que otra tarea en la misma CPU entre en bq_enqueue() y opere en la misma bq por CPU concurrentemente.\n\nEsto lleva a varias condiciones de carrera:\n\n1. Doble liberación / uso después de liberación en bq-&gt;q[]: bq_xmit_all() toma una instantánea de cnt = bq-&gt;count, luego itera bq-&gt;q[0..cnt-1] para transmitir tramas. Si es expropiada después de la instantánea, una segunda tarea puede llamar a bq_enqueue() -&gt; bq_xmit_all() en la misma bq, transmitiendo (y liberando) las mismas tramas. Cuando la primera tarea se reanuda, opera con punteros obsoletos en bq-&gt;q[], causando uso después de liberación.\n\n2. Corrupción de bq-&gt;count y bq-&gt;q[]: bq_enqueue() concurrente modificando bq-&gt;count y bq-&gt; ... (truncated)