« Volver al listado

CVE-2026-23294

Estado: AnalizadaAlta (7)—

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.

Leer descripción completaMostrar menos

This leads to several races:

The race between task A (__dev_flush -> bq_xmit_all) and task B (bq_enqueue -> bq_xmit_all) on the same CPU:

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.

Detalles técnicos trazas, registros y código del informe original
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.

  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! */

CVSS

Probabilidad de explotación (EPSS)

EPSS (Exploit Prediction Scoring System, de FIRST) estima la probabilidad de que una vulnerabilidad sea explotada en 30 días. Complementa a CVSS (impacto) y a CISA KEV (explotación confirmada).

🎯 Técnicas ATT&CK

Cómo se explota esta vulnerabilidad y qué consigue el atacante, en el lenguaje de MITRE ATT&CK.

Race condition en kernel Linux con acceso local y privilegios limitados (PR:L) permite escalada via corrupción de memoria en devmap; impacto DoS por uso-after-free y corrupción.

Inferido por nuestro agente de análisis a partir de la descripción oficial, el vector CVSS y la CWE, y comprobado por un supervisor. Puede contener errores.

🛡️ Mitigaciones ATT&CK que cubren estas técnicas

Tecnologías afectadas (1)

CWE

Referencias

JSON original (NVD)

Mostrar
{
  "id": "CVE-2026-23294",
  "cveTags": [],
  "metrics": {
    "cvssMetricV31": [
      {
        "type": "Secondary",
        "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "cvssData": {
          "scope": "UNCHANGED",
          "version": "3.1",
          "baseScore": 7,
          "attackVector": "LOCAL",
          "baseSeverity": "HIGH",
          "vectorString": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H",
          "integrityImpact": "HIGH",
          "userInteraction": "NONE",
          "attackComplexity": "HIGH",
          "availabilityImpact": "HIGH",
          "privilegesRequired": "LOW",
          "confidentialityImpact": "HIGH"
        },
        "impactScore": 5.9,
        "exploitabilityScore": 1
      }
    ]
  },
  "affected": [
    {
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "affectedData": [
        {
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "product": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "3253cb49cbad4772389d6ef55be75db1f97da910",
              "lessThan": "6c10b019785dc282c5f45d21e4a3f468b8fd6476",
              "versionType": "git"
            },
            {
              "status": "affected",
              "version": "3253cb49cbad4772389d6ef55be75db1f97da910",
              "lessThan": "ab1a56c9d99189aa5c6e03940d06e40ba6a28240",
              "versionType": "git"
            },
            {
              "status": "affected",
              "version": "3253cb49cbad4772389d6ef55be75db1f97da910",
              "lessThan": "1872e75375c40add4a35990de3be77b5741c252c",
              "versionType": "git"
            }
          ],
          "programFiles": [
            "kernel/bpf/devmap.c"
          ],
          "defaultStatus": "unaffected"
        },
        {
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "product": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.18"
            },
            {
              "status": "unaffected",
              "version": "0",
              "lessThan": "6.18",
              "versionType": "semver"
            },
            {
              "status": "unaffected",
              "version": "6.18.17",
              "versionType": "semver",
              "lessThanOrEqual": "6.18.*"
            },
            {
              "status": "unaffected",
              "version": "6.19.7",
              "versionType": "semver",
              "lessThanOrEqual": "6.19.*"
            },
            {
              "status": "unaffected",
              "version": "7.0",
              "versionType": "original_commit_for_fix",
              "lessThanOrEqual": "*"
            }
          ],
          "programFiles": [
            "kernel/bpf/devmap.c"
          ],
          "defaultStatus": "affected"
        }
      ]
    }
  ],
  "published": "2026-03-25T11:16:24.697",
  "references": [
    {
      "url": "https://git.kernel.org/stable/c/1872e75375c40add4a35990de3be77b5741c252c",
      "tags": [
        "Patch"
      ],
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
    },
    {
      "url": "https://git.kernel.org/stable/c/6c10b019785dc282c5f45d21e4a3f468b8fd6476",
      "tags": [
        "Patch"
      ],
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
    },
    {
      "url": "https://git.kernel.org/stable/c/ab1a56c9d99189aa5c6e03940d06e40ba6a28240",
      "tags": [
        "Patch"
      ],
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
    }
  ],
  "vulnStatus": "Analyzed",
  "weaknesses": [
    {
      "type": "Primary",
      "source": "nvd@nist.gov",
      "description": [
        {
          "lang": "en",
          "value": "CWE-362"
        }
      ]
    }
  ],
  "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;q[] mientras bq_xmit_all() los está leyendo.\n\n3. Condición de carrera de desmontaje de dev_rx/xdp_prog: __dev_flush() borra bq-&gt;dev_rx y bq-&gt;xdp_prog después de bq_xmit_all(). Si es expropiada entre el retorno de bq_xmit_all() y bq-&gt;dev_rx = NULL, una bq_enqueue() expropiadora ve dev_rx aún configurado (no-NULL), omite añadir bq a la flush_list, y encola una trama. Cuando __dev_flush() se reanuda, borra dev_rx y elimina bq de la flush_list, dejando huérfana la trama recién encolada.\n\n4. __list_del_clearprev() en flush_node: similar a la condición de carrera de cpumap, ambas tareas pueden llamar a __list_del_clearprev() en el mismo flush_node, la segunda desreferencia el puntero prev ya establecido en NULL.\n\nLa condición de carrera entre la tarea A (__dev_flush -&gt; bq_xmit_all) y la tarea B (bq_enqueue -&gt; bq_xmit_all) en la misma CPU:\n\n  Tarea A (xdp_do_flush)          Tarea B (redirección ndo_xdp_xmit)\n  ----------------------         --------------------------------\n  __dev_flush(flush_list)\n    bq_xmit_all(bq)\n      cnt = bq-&gt;count  /* ej. 16 */\n      /* comienza a iterar bq-&gt;q[] */\n    &lt;-- CFS expropia la Tarea A --&gt;\n                                   bq_enqueue(dev, xdpf)\n                                     bq-&gt;count == DEV_MAP_BULK_SIZE\n                                     bq_xmit_all(bq, 0)\n                                       cnt = bq-&gt;count  /* ¡los mismos 16! */\n                                       ndo_xdp_xmit(bq-&gt;q[])\n                                       /* tramas liberadas por el controlador */\n                                       bq-&gt;count = 0\n    &lt;-- La Tarea A se reanuda --&gt;\n      ndo_xdp_xmit(bq-&gt;q[])\n      /* uso después de liberación: ¡tramas ya liberadas! */\n\nSolucione esto añadiendo un local_lock_t a xdp_dev_bulk_queue y adquiriéndolo en bq_enqueue() y __dev_flush(). Estas rutas ya se ejecutan bajo local_bh_disable(), así que use local_lock_nested_bh() que en no-RT es una anotación pura sin sobrecarga, y en PREEMPT_RT proporciona un bloqueo de suspensión por CPU que serializa el acceso a la bq."
    }
  ],
  "lastModified": "2026-06-17T10:21:16.460",
  "configurations": [
    {
      "nodes": [
        {
          "negate": false,
          "cpeMatch": [
            {
              "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
              "vulnerable": true,
              "matchCriteriaId": "91D34097-62D4-400A-8894-1A45A5B44EEA",
              "versionEndExcluding": "6.18.17",
              "versionStartIncluding": "6.18"
            },
            {
              "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
              "vulnerable": true,
              "matchCriteriaId": "69245D10-0B71-485E-80C3-A64F077004D3",
              "versionEndExcluding": "6.19.7",
              "versionStartIncluding": "6.19"
            },
            {
              "criteria": "cpe:2.3:o:linux:linux_kernel:7.0:rc1:*:*:*:*:*:*",
              "vulnerable": true,
              "matchCriteriaId": "F253B622-8837-4245-BCE5-A7BF8FC76A16"
            }
          ],
          "operator": "OR"
        }
      ]
    }
  ],
  "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
}