{"id":"CVE-2026-43121","aliases":["CVE-2026-43121"],"related":[],"kind":"vulnerability","state":"published","title":"io_uring/zcrx: fix user_ref race between scrub and refill paths","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nio_uring/zcrx: fix user_ref race between scrub and refill paths\n\nThe io_zcrx_put_niov_uref() function uses a non-atomic\ncheck-then-decrement pattern (atomic_read followed by separate\natomic_dec) to manipulate user_refs. This is serialized against other\ncallers by rq_lock, but io_zcrx_scrub() modifies the same counter with\natomic_xchg() WITHOUT holding rq_lock.\n\nOn SMP systems, the following race exists:\n\n  CPU0 (refill, holds rq_lock)          CPU1 (scrub, no rq_lock)\n  put_niov_uref:\n    atomic_read(uref) - 1\n    // window opens\n                                        atomic_xchg(uref, 0) - 1\n                                        return_niov_freelist(niov) [PUSH #1]\n    // window closes\n    atomic_dec(uref) - wraps to -1\n    returns true\n    return_niov(niov)\n    return_niov_freelist(niov)           [PUSH #2: DOUBLE-FREE]\n\nThe same niov is pushed to the freelist twice, causing free_count to\nexceed nr_iovs. Subsequent freelist pushes then perform an out-of-bounds\nwrite (a u32 value) past the kvmalloc'd freelist array into the adjacent\nslab object.\n\nFix this by replacing the non-atomic read-then-dec in\nio_zcrx_put_niov_uref() with an atomic_try_cmpxchg loop that atomically\ntests and decrements user_refs. This makes the operation safe against\nconcurrent atomic_xchg from scrub without requiring scrub to acquire\nrq_lock.\n\n[pavel: removed a warning and a comment]","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nio_uring/zcrx: fix user_ref race between scrub and refill paths\n\nThe io_zcrx_put_niov_uref() function uses a non-atomic\ncheck-then-decrement pattern (atomic_read followed by separate\natomic_dec) to manipulate user_refs. This is serialized against other\ncallers by rq_lock, but io_zcrx_scrub() modifies the same counter with\natomic_xchg() WITHOUT holding rq_lock.\n\nOn SMP systems, the following race exists:\n\n  CPU0 (refill, holds rq_lock)          CPU1 (scrub, no rq_lock)\n  put_niov_uref:\n    atomic_read(uref) - 1\n    // window opens\n                                        atomic_xchg(uref, 0) - 1\n                                        return_niov_freelist(niov) [PUSH #1]\n    // window closes\n    atomic_dec(uref) - wraps to -1\n    returns true\n    return_niov(niov)\n    return_niov_freelist(niov)           [PUSH #2: DOUBLE-FREE]\n\nThe same niov is pushed to the freelist twice, causing free_count to\nexceed nr_iovs. Subsequent freelist pushes then perform an out-of-bounds\nwrite (a u32 value) past the kvmalloc'd freelist array into the adjacent\nslab object.\n\nFix this by replacing the non-atomic read-then-dec in\nio_zcrx_put_niov_uref() with an atomic_try_cmpxchg loop that atomically\ntests and decrements user_refs. This makes the operation safe against\nconcurrent atomic_xchg from scrub without requiring scrub to acquire\nrq_lock.\n\n[pavel: removed a warning and a comment]","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nio_uring/zcrx: solución para la condición de carrera de user_ref entre las rutas de scrub y refill\n\nLa función io_zcrx_put_niov_uref() utiliza un patrón no atómico de ’verificar-y-luego-decrementar’ (atomic_read seguido de un atomic_dec separado) para manipular los user_refs. Esto se serializa frente a otros llamadores mediante rq_lock, pero io_zcrx_scrub() modifica el mismo contador con atomic_xchg() SIN mantener rq_lock.\n\nEn sistemas SMP, existe la siguiente condición de carrera:\n\n  CPU0 (refill, mantiene rq_lock)          CPU1 (scrub, sin rq_lock)\n  put_niov_uref:\n    atomic_read(uref) - 1\n    // la ventana se abre\n                                        atomic_xchg(uref, 0) - 1\n                                        return_niov_freelist(niov) [PUSH #1]\n    // la ventana se cierra\n    atomic_dec(uref) - se envuelve a -1\n    devuelve verdadero\n    return_niov(niov)\n    return_niov_freelist(niov)           [PUSH #2: DOBLE LIBERACIÓN]\n\nEl mismo niov se empuja a la freelist dos veces, haciendo que free_count exceda nr_iovs. Los empujes subsiguientes a la freelist luego realizan una escritura fuera de límites (un valor u32) más allá del array de freelist asignado con kvmalloc hacia el objeto slab adyacente.\n\nSolucione esto reemplazando la lectura-y-luego-decremento no atómica en io_zcrx_put_niov_uref() con un bucle atomic_try_cmpxchg que prueba y decrementa atómicamente los user_refs. Esto hace que la operación sea segura contra atomic_xchg concurrente de scrub sin requerir que scrub adquiera rq_lock.\n\n[pavel: se eliminó una advertencia y un comentario]","source":"nvd"}],"published":"2026-05-06T11:27:08.216Z","modified":"2026-11-11T21:10:00.200Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H","score":4.7,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H","score":4.7,"rating":"MEDIUM"}],"cwes":["CWE-362"],"affected":[{"ranges":[{"type":"git","introduced":"34a3e60821ab9f335a58d43a88cccdbefdebdec3","fixed":"a94f096e28bfc7975163a6b80f1c8f323efe317a","status":"affected"},{"type":"git","introduced":"34a3e60821ab9f335a58d43a88cccdbefdebdec3","fixed":"485dc691257b96e6d3bdc25b0eff2daadcc5c46c","status":"affected"},{"type":"git","introduced":"34a3e60821ab9f335a58d43a88cccdbefdebdec3","fixed":"003049b1c4fb8aabb93febb7d1e49004f6ad653b","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.15","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.15","status":"unaffected"},{"type":"semver","introduced":"6.18.16","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"6.19.6","lastAffected":"6.19.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.0","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"6.15","fixed":"6.18.16"},{"status":"affected","introduced":"6.19","fixed":"6.19.6"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/a94f096e28bfc7975163a6b80f1c8f323efe317a","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/485dc691257b96e6d3bdc25b0eff2daadcc5c46c","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/003049b1c4fb8aabb93febb7d1e49004f6ad653b","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-43121","url":"https://www.cve.org/CVERecord?id=CVE-2026-43121","licence":"CVE Terms of Use","modified":"2026-05-11T22:18:09.791Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-43121","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-43121","licence":"Public domain","modified":"2026-11-11T21:10:00.200Z"}],"updatedAt":"2026-11-25T22:59:20.686Z","epss":{"score":0.00111,"percentile":0.01477,"date":"2026-12-01T12:00:22.000Z"}}