# CVE-2026-43121: io_uring/zcrx: fix user_ref race between scrub and refill paths

- Severity: Medium 4.7 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.11%, higher than 1% of CVEs (2026-12-01)
- Published: 2026-05-06T11:27:08.216Z
- Modified: 2026-11-11T21:10:00.200Z
- Weaknesses: CWE-362
- Assigned by: Linux

## Description

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

io_uring/zcrx: fix user_ref race between scrub and refill paths

The io_zcrx_put_niov_uref() function uses a non-atomic
check-then-decrement pattern (atomic_read followed by separate
atomic_dec) to manipulate user_refs. This is serialized against other
callers by rq_lock, but io_zcrx_scrub() modifies the same counter with
atomic_xchg() WITHOUT holding rq_lock.

On SMP systems, the following race exists:

  CPU0 (refill, holds rq_lock)          CPU1 (scrub, no rq_lock)
  put_niov_uref:
    atomic_read(uref) - 1
    // window opens
                                        atomic_xchg(uref, 0) - 1
                                        return_niov_freelist(niov) [PUSH #1]
    // window closes
    atomic_dec(uref) - wraps to -1
    returns true
    return_niov(niov)
    return_niov_freelist(niov)           [PUSH #2: DOUBLE-FREE]

The same niov is pushed to the freelist twice, causing free_count to
exceed nr_iovs. Subsequent freelist pushes then perform an out-of-bounds
write (a u32 value) past the kvmalloc'd freelist array into the adjacent
slab object.

Fix this by replacing the non-atomic read-then-dec in
io_zcrx_put_niov_uref() with an atomic_try_cmpxchg loop that atomically
tests and decrements user_refs. This makes the operation safe against
concurrent atomic_xchg from scrub without requiring scrub to acquire
rq_lock.

[pavel: removed a warning and a comment]

(As written by CVE List.)

## Affected

- Linux Linux: from 34a3e60821ab9f335a58d43a88cccdbefdebdec3 before a94f096e28bfc7975163a6b80f1c8f323efe317a; from 34a3e60821ab9f335a58d43a88cccdbefdebdec3 before 485dc691257b96e6d3bdc25b0eff2daadcc5c46c; from 34a3e60821ab9f335a58d43a88cccdbefdebdec3 before 003049b1c4fb8aabb93febb7d1e49004f6ad653b; 6.15 (not affected: before 6.15; from 6.18.16 up to 6.18.*; from 6.19.6 up to 6.19.*; from 7.0 up to *)
- linux linux_kernel: from 6.15 before 6.18.16; from 6.19 before 6.19.6

## References

- <https://git.kernel.org/stable/c/a94f096e28bfc7975163a6b80f1c8f323efe317a> (patch)
- <https://git.kernel.org/stable/c/485dc691257b96e6d3bdc25b0eff2daadcc5c46c> (patch)
- <https://git.kernel.org/stable/c/003049b1c4fb8aabb93febb7d1e49004f6ad653b> (patch)

## Sources

- CVE List: [CVE-2026-43121](https://www.cve.org/CVERecord?id=CVE-2026-43121), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2026-43121](https://nvd.nist.gov/vuln/detail/CVE-2026-43121), Public domain, modified 2026-11-11

---

Page: https://cve.day/CVE-2026-43121 · Whole record: https://cve.day/CVE-2026-43121.json · Rebuilt by cve.day 2026-11-25T22:59:20.686Z
