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

CVE-2026-43404 Linux内核内存管理拒绝服务漏洞

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

漏洞信息

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

相关标签

Linux Kernel拒绝服务Livelock内存管理本地漏洞

漏洞概述

Linux内核内存管理模块存在一个拒绝服务漏洞。当`hmm_range_fault()`函数在处理设备私有内存页迁移时,如果获取页面锁失败,函数会进入自旋等待状态。然而,如果持有锁的进程依赖于同一CPU上的工作项来释放锁,该工作项可能会被饥饿,导致系统陷入活锁状态。攻击者可利用此漏洞导致系统挂起或无响应。该问题主要影响使用设备私有内存(如GPU内存)并进行迁移的场景。

技术细节

该漏洞源于Linux内核内存管理(MM)子系统中`hmm_range_fault()`函数在处理设备私有内存页迁移时的逻辑缺陷。当函数在`do_swap_page`中调用`folio_trylock()`尝试锁定一个正在进行迁移的设备私有页失败时,它会自旋等待。此时,如果持有该页锁的进程正在执行迁移操作(如`migrate_device_unmap()`),并调用了`lru_add_drain_all()`,这需要所有CPU上的工作项完成。由于自旋锁占用了CPU资源,阻止了工作项的调度执行,导致持有锁的进程无法完成并释放锁,系统陷入不可恢复的活锁状态。修复方案引入了等待机制,替代原有的自旋逻辑,避免CPU资源被独占。

攻击链分析

STEP 1
步骤1
攻击者在本地触发涉及设备私有内存页的迁移操作,该操作持有内存页锁并调用lru_add_drain_all等待CPU工作项。
STEP 2
步骤2
攻击者在同一CPU上触发hmm_range_fault()函数访问正在迁移的内存页。
STEP 3
步骤3
hmm_range_fault()尝试获取锁失败后进入自旋等待状态,持续占用CPU资源。
STEP 4
步骤4
由于CPU被自旋锁占用,步骤1中所需的工作项无法被调度执行,导致持有锁的进程无法继续。
STEP 5
步骤5
系统陷入死循环(活锁),导致CPU资源耗尽,系统挂起,造成拒绝服务。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
/* * PoC Concept for CVE-2026-43404 (Livelock in hmm_range_fault) * This requires a kernel module or specific hardware (e.g., GPU with xe driver) * to trigger the race condition described in the commit. * * Trigger Logic: * 1. Thread A: Pin to CPU 0. Start migration of a device-private folio. * The migration path calls migrate_device_unmap() -> lru_add_drain_all(). * This waits for a work item on CPU 0. * 2. Thread B: Pin to CPU 0. Call hmm_range_fault() on the folio being migrated. * folio_trylock() fails, and it enters a busy loop (spin). * 3. Result: Thread B spins on CPU 0, preventing the work item needed by Thread A * from running. System hangs (Livelock). */ #include <stdio.h> #include <pthread.h> #include <unistd.h> // Mocking the trigger interface which would normally be ioctl to GPU driver void trigger_migration_thread() { // Pin to CPU 0 cpu_set_t cpuset; CPU_ZERO(&cpuset); CPU_SET(0, &cpuset); pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); printf("[Thread A] Starting device private folio migration...\n"); // In a real scenario, this calls driver ioctl causing migrate_device_unmap() sleep(1); printf("[Thread A] Waiting for lru_add_drain_all() work item...\n"); while(1) { pause(); } // Simulate blocking on work item } void trigger_fault_thread() { // Pin to CPU 0 cpu_set_t cpuset; CPU_ZERO(&cpuset); CPU_SET(0, &cpuset); pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); printf("[Thread B] Waiting for migration to start...\n"); sleep(1); printf("[Thread B] Triggering hmm_range_fault() on locked folio...\n"); // In a real scenario, this accesses the device memory triggering the fault // which enters the spin loop in do_swap_page() while(1) { // Simulate the spin lock wait (livelock) // This prevents the work item from running on CPU 0 } } int main() { pthread_t t1, t2; pthread_create(&t1, NULL, (void*)trigger_migration_thread, NULL); pthread_create(&t2, NULL, (void*)trigger_fault_thread, NULL); pthread_join(t1, NULL); pthread_join(t2, NULL); return 0; }

影响范围

Linux Kernel (Stable branches prior to commit a69d1ab9)
Linux Kernel (Mainline prior to fix)

防御指南

临时缓解措施
建议限制非特权用户对设备内存访问API的调用权限,或通过内核配置禁用受影响的内存管理功能(如果业务允许),直至完成内核升级。

参考链接

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