KernelScan.io

HIGH Introduced in 4.18

btrfs RootRef Overflow

CVE-2026-97415

CVSS 7.8 / 10.0 NVD

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

KernelScan AI7.8HIGH

01

In the Linux kernel, the following vulnerability has been resolved: btrfs: tree-checker: validate names in ROOT_REF and ROOT_BACKREF ROOT_REF and ROOT_BACKREF items contain a struct btrfs_root_ref followed by the subvolume name. Several readers assume that this layout is already valid and then use the on-disk name length directly. A corrupted item can therefore make those readers address bytes outside the item, and BTRFS_IOC_GET_SUBVOL_INFO can copy too many bytes into its fixed-size UAPI name buffer. Validate ROOT_REF and ROOT_BACKREF items in tree-checker before any reader uses them. Reject records that do not contain a non-empty name, whose name_len does not exactly describe the remaining item payload, or whose name exceeds BTRFS_NAME_LEN. For BTRFS_IOC_GET_SUBVOL_INFO, copy only the validated on-disk name_len instead of deriving the copy length from the item size. The ioctl result is zeroed when allocated. That leaves the existing trailing zero byte untouched.

02

Engine v0.6.0

Risk summary

A corrupted btrfs filesystem image can cause the kernel to read beyond item boundaries and overflow a fixed-size kernel heap buffer via the BTRFS_IOC_GET_SUBVOL_INFO ioctl, leading to memory corruption exploitable for code execution or denial of service. The vulnerability is reachable whenever a crafted btrfs image is mounted, whether by a privileged user or through removable media automount. Any local user who can access the mounted filesystem can trigger the overflow through the ioctl.

Affectedfs/btrfs/tree-checker.c, fs/btrfs/ioctl.c (btrfs filesystem)

Vulnerability analysis

A corrupted btrfs filesystem image can contain subvolume reference items whose stored name length does not match the actual item payload or exceeds the maximum allowed length. The kernel previously trusted this on-disk length without validation, causing internal readers to access memory beyond the item boundary and, most critically, causing the get-subvolume-info ioctl to copy more bytes than a fixed-size kernel buffer can hold — a heap buffer overflow with attacker-influenced data. The fix adds validation in the btrfs tree-checker that rejects any reference item whose name length is empty, inconsistent with the item size, or exceeds the maximum, and it changes the ioctl to copy only the validated name length rather than deriving the copy size from the total item size. The vulnerable path is reached by mounting a crafted btrfs image, which requires either root privileges to mount manually or physical access to insert removable media that triggers automount; once mounted, any local user can invoke the ioctl.

03

BranchIntroducedFixed inPatch commit
6.14.186.1.1891370badf6b82
6.124.186.12.1119154542070ca
6.184.186.18.5374f577c722c9
6.64.186.6.158ba6c4fc66285
mainline4.187.20af37c217edf
cip/6.14.186.1.189-cip611370badf6b82
cip/6.1-rt4.186.1.189-cip61-rt321370badf6b82
cip/6.124.186.12.111-cip329154542070ca

04

State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.

CIP treeState
cip/6.12Fixed in 6.12.111-cip32
cip/6.1Fixed in 6.1.189-cip61
cip/6.1-rtFixed in 6.1.189-cip61-rt32
cip/5.10Affected — no CIP fix yet (latest 5.10.271-cip78)
cip/5.10-rtAffected — no CIP fix yet (latest 5.10.268-cip77-rt34)
cip/4.19Affected — no CIP fix yet (latest 4.19.325-cip136)
cip/4.19-rtAffected — no CIP fix yet (latest 4.19.325-cip136-rt50)