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.
Published: 2026-05-28
Score: n/a
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

A time‑of‑check to time‑of‑use race exists between two passes over the block group RAID type lists in the function btrfs_ioctl_space_info. The first pass counts entries to size the buffer; after releasing the groups_sem rwlock, a concurrent block group removal can decrease the count. The second pass then copies fewer entries than were counted. As a result, copy_to_user copies the full allocated size, including trailing uninitialized kmalloc bytes, to user space, leaking kernel data. This flaw can expose sensitive data and provide an attacker with kernel memory contents, potentially facilitating further exploitation. The weakness is a race condition leading to an information‑leak vulnerability.

Affected Systems

The vulnerability affects the Linux kernel’s Btrfs filesystem implementation on all distributions that ship the kernel and enable the Btrfs module. No specific kernel version is enumerated; the fix replaces the old logic in newer patches. The vendor affected is the Linux kernel itself, i.e. Linux:Linux.

Risk and Exploitability

Because the flaw is triggered by a user‑land ioctl call, a local user with access to Btrfs can exploit it. The race requires that a concurrent kernel block group removal occurs between the two passes, which is possible when many concurrent filesystem operations happen. The exploit does not require elevated privileges, but the data leaked may be useful for privilege escalation or bypassing kernel mitigations. No CVSS score is provided. EPSS data are not available, and the vulnerability is not listed in the CISA KEV catalog, so the risk should be assessed as potential local information disclosure with moderate likelihood, warranting immediate attention for systems running vulnerable kernels.

Generated by OpenCVE AI on May 28, 2026 at 12:14 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the Linux kernel to a version that includes the btrfs_ioctl_space_info race fix, ensuring the btrfs module uses the corrected copy logic and kzalloc allocation.
  • If an immediate kernel upgrade is not feasible, limit or deny use of the Btrfs ioctl that triggers space_info by restricting file descriptor access to privileged users or by disabling the Btrfs filesystem on hosts that do not require it.
  • Deploy kernel lockdown or enable SELinux/AppArmor policies that prevent unprivileged users from obtaining direct Btrfs ioctl access, reducing the window for the race condition to be triggered.

Generated by OpenCVE AI on May 28, 2026 at 12:14 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 28 May 2026 12:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-200
CWE-635

Thu, 28 May 2026 10:15:00 +0000

Type Values Removed Values Added
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.
Title btrfs: fix btrfs_ioctl_space_info() slot_count TOCTOU which can lead to info-leak
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-05-28T09:36:14.676Z

Reserved: 2026-05-13T15:03:33.102Z

Link: CVE-2026-46159

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-05-28T10:16:31.553

Modified: 2026-05-28T10:16:31.553

Link: CVE-2026-46159

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-05-28T12:15:21Z

Weaknesses