# CVE-2026-23342: bpf: Fix race in cpumap on PREEMPT\_RT

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 4.7
- **CVSS:** 4.7 (v3.1, NVD) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: High; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.13% (percentile 1, 2026-11-26)
- **CWE:** CWE-362
- **Published:** 2026-03-25T10:27:30.285Z
- **Modified:** 2026-06-17T10:21:22.597Z

## Who should check

- Anyone running Linux \>= 3253cb49cbad4772389d6ef55be75db1f97da910, \< 7466ae2aeed483de80c5d8dea0913cf74038b652; \>= 3253cb49cbad4772389d6ef55be75db1f97da910, \< e67299e1044349ad0088d52c6bc5764cc1816c06; \>= 3253cb49cbad4772389d6ef55be75db1f97da910, \< 869c63d5975d55e97f6b168e885452b3da20ea47
- Anyone running Linux 6.18

## Description

In the Linux kernel, the following vulnerability has been resolved:

bpf: Fix race in cpumap on PREEMPT\_RT

On PREEMPT\_RT kernels, the per-CPU xdp\_bulk\_queue (bq) can be accessed
concurrently by multiple preemptible tasks on the same CPU.

The original code assumes bq\_enqueue() and \_\_cpu\_map\_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\_flush\_to\_queue(), 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 \_\_list\_del\_clearprev(): after bq-\>count is reset in
   bq\_flush\_to\_queue(), a preempting task can call bq\_enqueue() -\>
   bq\_flush\_to\_queue() on the same bq when bq-\>count reaches
   CPU\_MAP\_BULK\_SIZE. Both tasks then call \_\_list\_del\_clearprev()
   on the same bq-\>flush\_node, the second call dereferences the
   prev pointer that was already set to NULL by the first.

2. bq-\>count and bq-\>q\[\] races: concurrent bq\_enqueue() can corrupt
   the packet queue while bq\_flush\_to\_queue() is processing it.

The race between task A (\_\_cpu\_map\_flush -\> bq\_flush\_to\_queue) and
task B (bq\_enqueue -\> bq\_flush\_to\_queue) on the same CPU:

  Task A (xdp\_do\_flush)          Task B (cpu\_map\_enqueue)
  ----------------------         ------------------------
  bq\_flush\_to\_queue(bq)
    spin\_lock(&q-\>producer\_lock)
    /\* flush bq-\>q\[\] to ptr\_ring \*/
    bq-\>count = 0
    spin\_unlock(&q-\>producer\_lock)
                                   bq\_enqueue(rcpu, xdpf)
    \<-- CFS preempts Task A --\>      bq-\>q\[bq-\>count++\] = xdpf
                                     /\* ... more enqueues until full ... \*/
                                     bq\_flush\_to\_queue(bq)
                                       spin\_lock(&q-\>producer\_lock)
                                       /\* flush to ptr\_ring \*/
                                       spin\_unlock(&q-\>producer\_lock)
                                       \_\_list\_del\_clearprev(flush\_node)
                                         /\* sets flush\_node.prev = NULL \*/
    \<-- Task A resumes --\>
    \_\_list\_del\_clearprev(flush\_node)
      flush\_node.prev-\>next = ...
      /\* prev is NULL -\> kernel oops \*/

Fix this by adding a local\_lock\_t to xdp\_bulk\_queue and acquiring it
in bq\_enqueue() and \_\_cpu\_map\_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.

To reproduce, insert an mdelay(100) between bq-\>count = 0 and
\_\_list\_del\_clearprev() in bq\_flush\_to\_queue(), then run reproducer
provided by syzkaller.

## Affected and fixed versions

- Linux: \>= 3253cb49cbad4772389d6ef55be75db1f97da910, \< 7466ae2aeed483de80c5d8dea0913cf74038b652; \>= 3253cb49cbad4772389d6ef55be75db1f97da910, \< e67299e1044349ad0088d52c6bc5764cc1816c06; \>= 3253cb49cbad4772389d6ef55be75db1f97da910, \< 869c63d5975d55e97f6b168e885452b3da20ea47 (cvelist)
- Linux: 6.18 (cvelist)

## Mitigation

- Upgrade Linux to 869c63d5975d55e97f6b168e885452b3da20ea47 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-23342. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-23342.md
Affected: Linux >= 3253cb49cbad4772389d6ef55be75db1f97da910, < 7466ae2aeed483de80c5d8dea0913cf74038b652; >= 3253cb49cbad4772389d6ef55be75db1f97da910, < e67299e1044349ad0088d52c6bc5764cc1816c06; >= 3253cb49cbad4772389d6ef55be75db1f97da910, < 869c63d5975d55e97f6b168e885452b3da20ea47; Linux 6.18
Fixed in: Linux 7466ae2aeed483de80c5d8dea0913cf74038b652, Linux 869c63d5975d55e97f6b168e885452b3da20ea47

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-23342 being exploited?

There is no confirmed exploitation: CVE-2026-23342 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.13% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-23342?

Medium: CVSS 4.7 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2026-23342?

Linux \>= 3253cb49cbad4772389d6ef55be75db1f97da910, \< 7466ae2aeed483de80c5d8dea0913cf74038b652; \>= 3253cb49cbad4772389d6ef55be75db1f97da910, \< e67299e1044349ad0088d52c6bc5764cc1816c06; \>= 3253cb49cbad4772389d6ef55be75db1f97da910, \< 869c63d5975d55e97f6b168e885452b3da20ea47; Linux 6.18.

### Is there a fix for CVE-2026-23342?

Yes. Fixed in Linux 7466ae2aeed483de80c5d8dea0913cf74038b652, Linux 869c63d5975d55e97f6b168e885452b3da20ea47. Upgrade Linux to 869c63d5975d55e97f6b168e885452b3da20ea47 or later.

### How do I check if I'm affected by CVE-2026-23342?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/7466ae2aeed483de80c5d8dea0913cf74038b652>
- patch: <https://git.kernel.org/stable/c/e67299e1044349ad0088d52c6bc5764cc1816c06>
- patch: <https://git.kernel.org/stable/c/869c63d5975d55e97f6b168e885452b3da20ea47>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-23342>

HTML: <https://flawdb.com/CVE-2026-23342> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-23342>
