IPBUF安全漏洞报告
English
CVE-2026-43121 CVSS 4.7 中危

CVE-2026-43121: Linux内核io_uring竞态条件漏洞

披露日期: 2026-05-06
来源: 416baaa9-dc9f-4396-8d5f-8c081fb06d67

漏洞信息

漏洞编号
CVE-2026-43121
漏洞类型
竞态条件, 越界写入, 双重释放
CVSS评分
4.7 中危
攻击向量
本地 (AV:L)
认证要求
低权限 (PR:L)
用户交互
无需交互 (UI:N)
影响产品
Linux Kernel

相关标签

Linux KernelRace ConditionDouble FreeEoPio_uringCVE-2026-43121

漏洞概述

Linux内核io_uring子系统的zcrx模块存在一个竞态条件漏洞。该漏洞源于`io_zcrx_put_niov_uref`函数与`io_zcrx_scrub`函数在操作`user_refs`计数器时缺乏适当的同步机制。攻击者可利用此漏洞在多核系统上触发双重释放,导致内核堆越界写入,进而造成系统崩溃或潜在的权限提升。

技术细节

漏洞发生在Linux内核`io_uring`的零拷贝接收机制中。`refill`路径由`rq_lock`保护,但`scrub`路径在修改`user_refs`时未持有该锁。`put_niov_uref`函数采用非原子的'检查后减量'逻辑(先`atomic_read`再`atomic_dec`),而`scrub`直接使用`atomic_xchg`置零计数器。在SMP环境下,若`refill`线程读取计数器后,`scrub`线程将计数器置零并释放资源,随后`refill`线程完成减量操作,会导致引用计数回绕或逻辑错误。这使得同一个`niov`结构被两次放入空闲链表,导致`free_count`超过`nr_iovs`。后续操作会在`kvmalloc`分配的数组边界外写入数据,破坏相邻的slab对象,导致内核内存破坏。

攻击链分析

STEP 1
步骤1
攻击者在本地拥有低权限,能够调用io_uring相关接口。
STEP 2
步骤2
攻击者精心构造IO请求,触发io_uring的zcrx refill路径。
STEP 3
步骤3
同时或利用多核CPU调度,触发scrub路径修改user_refs计数器。
STEP 4
步骤4
利用竞态窗口,导致niov对象被双重释放并推入空闲链表。
STEP 5
步骤5
触发内核堆越界写入,破坏邻近内存对象,尝试提升权限或导致拒绝服务。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
/* * Conceptual PoC for CVE-2026-43121 Race Condition * This code simulates the race between io_zcrx_scrub and refill path. */ #include <pthread.h> #include <stdatomic.h> #include <stdio.h> #include <unistd.h> // Simulating kernel structure struct io_zcrx_queue { atomic_int user_refs; int free_count; int nr_iovs; }; struct io_zcrx_queue q; // Simulating io_zcrx_scrub (CPU1: no lock) void *scrub_thread(void *arg) { // Window opens: atomic_xchg without rq_lock int old = atomic_exchange(&q.user_refs, 0); printf("[Scrub] Exchanged ref %d to 0\n", old); // Simulate pushing to freelist (PUSH #1) q.free_count++; printf("[Scrub] Free count: %d\n", q.free_count); return NULL; } // Simulating io_zcrx_put_niov_uref (CPU0: holds rq_lock) void *refill_thread(void *arg) { // Simulate lock acquisition // Non-atomic check-then-decrement int ref = atomic_load(&q.user_refs); // Race window here usleep(100); if (ref > 0) { atomic_fetch_sub(&q.user_refs, 1); printf("[Refill] Decremented ref.\n"); // Simulate pushing to freelist (PUSH #2: DOUBLE-FREE) q.free_count++; printf("[Refill] Free count: %d (Potential OOB)\n", q.free_count); if (q.free_count > q.nr_iovs) { printf("[!!!] Out-of-bounds write triggered!\n"); } } return NULL; } int main() { atomic_init(&q.user_refs, 1); q.nr_iovs = 1; q.free_count = 0; pthread_t t1, t2; // Trigger race pthread_create(&t1, NULL, refill_thread, NULL); pthread_create(&t2, NULL, scrub_thread, NULL); pthread_join(t1, NULL); pthread_join(t2, NULL); return 0; }

影响范围

Linux Kernel (具体受影响版本需参考各发行商安全公告,主要涉及包含io_uring zcrx功能的版本)

防御指南

临时缓解措施
建议通过系统调用过滤(如seccomp)限制应用程序对io_uring的使用,或者在内核升级前临时禁用io_uring功能(例如通过/proc/sys/kernel/io_uring_disabled设置),以降低被利用的风险。

参考链接

快速导航: 前沿安全 最新收录域名列表 最新威胁情报列表 最新网站排名列表 最新工具资源列表 最新CVE漏洞列表