CVE-2026-46159

btrfs: fix btrfs_ioctl_space_info() slot_count TOCTOU which can lead to info-leak

MEDIUM
4.7
CVSS Score
Published: May 28, 2026 at 09:36 AM UTC
Updated: October 15, 2026 at 02:19 AM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM4.7
Exploit prediction
EPSS 0.1%

Description

In the Linux kernel, the following vulnerability has been resolved: btrfs: fix btrfs_ioctl_space_info() slot_count TOCTOU which can lead to info-leak btrfs_ioctl_space_info() has a TOCTOU race between two passes over the block group RAID type lists. The first pass counts entries to determine the allocation size, then the second pass fills the buffer. The groups_sem rwlock is released between passes, allowing concurrent block group removal to reduce the entry count. When the second pass fills fewer entries than the first pass counted, copy_to_user() copies the full alloc_size bytes including trailing uninitialized kmalloc bytes to userspace. Fix by copying only total_spaces entries (the actually-filled count from the second pass) instead of alloc_size bytes, and switch to kzalloc so any future copy size mismatch cannot leak heap data.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

2.6.34.1 ≤ v < 6.6.1406.13 ≤ v < 6.18.326.19 ≤ v < 7.0.76.7 ≤ v < 6.12.902.6.342.6.34 rc22.6.34 rc32.6.34 rc42.6.34 rc52.6.34 rc62.6.34 rc77fde62bffb576d384ea49a3aed3403d5609ee5bc
Vendor states this is fixed in 4fdc6ee0802121d9cd96b8d085e589f51e5a4ec3 (fixed)
Vendor states this is fixed in 5d12e0ab009ade48c1bff9324fd9bea2c773d088 (fixed)
Vendor states this is fixed in 973e57c726c1f8e77259d1c8e519519f1e9aea77 (fixed)
Vendor states this is fixed in d09d67d5de577cedae3de9497dff217e0ac8b641 (fixed)
Vendor states this is fixed in d69a4a6813fdba7c4cc3695a7e843842b240790d (fixed)
Vendor states this is fixed in d8224b1be6627c6c3b204bfb264508d27c65ac44 (fixed)
Vendor states this is fixed in f407aad350bdea4db300c47433573b7a41630d33 (fixed)
Vendor states this is fixed in f5ee467b56764964027c361641f64953fc0f8f9a (fixed)
Vendor states this is fixed in 2.6.34 (unaffected)
Vendor states this is fixed in 5.10.259 (unaffected)
Vendor states this is fixed in 5.15.210 (unaffected)
Vendor states this is fixed in 6.1.176 (unaffected)
Vendor states this is fixed in 6.12.90 (unaffected)
Vendor states this is fixed in 6.18.32 (unaffected)
Vendor states this is fixed in 6.6.140 (unaffected)
Vendor states this is fixed in 7.0.7 (unaffected)
Vendor states this is fixed in 7.1 (unaffected)

CVSS

Attack Vector
LOCAL
Complexity
HIGH
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-367

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card