CVE-2026-46159
btrfs: fix btrfs_ioctl_space_info() slot_count TOCTOU which can lead to info-leak
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.
INFO
Published Date :
May 28, 2026, 10:16 a.m.
Last Modified :
June 9, 2026, 9:06 p.m.
Remotely Exploit :
No
Source :
416baaa9-dc9f-4396-8d5f-8c081fb06d67
CVSS Scores
| Score | Version | Severity | Vector | Exploitability Score | Impact Score | Source |
|---|---|---|---|---|---|---|
| CVSS 3.1 | MEDIUM | [email protected] |
Solution
- Copy only total_spaces entries to userspace.
- Switch to kzalloc for memory allocation.
- Apply the btrfs kernel patch.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2026-46159.
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2026-46159 is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2026-46159
weaknesses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2026-46159 vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2026-46159 vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
Initial Analysis by [email protected]
Jun. 09, 2026
Action Type Old Value New Value Added CVSS V3.1 AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H Added CWE CWE-367 Added CPE Configuration OR *cpe:2.3:o:linux:linux_kernel:2.6.34:rc6:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:2.6.34:rc2:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:2.6.34:rc7:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:2.6.34:rc3:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:2.6.34:rc4:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:2.6.34:rc5:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:2.6.34:-:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.19 up to (excluding) 7.0.7 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 2.6.34.1 up to (excluding) 6.6.140 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.13 up to (excluding) 6.18.32 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.7 up to (excluding) 6.12.90 Added Reference Type kernel.org: https://git.kernel.org/stable/c/4fdc6ee0802121d9cd96b8d085e589f51e5a4ec3 Types: Patch Added Reference Type kernel.org: https://git.kernel.org/stable/c/5d12e0ab009ade48c1bff9324fd9bea2c773d088 Types: Patch Added Reference Type kernel.org: https://git.kernel.org/stable/c/973e57c726c1f8e77259d1c8e519519f1e9aea77 Types: Patch Added Reference Type kernel.org: https://git.kernel.org/stable/c/d09d67d5de577cedae3de9497dff217e0ac8b641 Types: Patch Added Reference Type kernel.org: https://git.kernel.org/stable/c/f5ee467b56764964027c361641f64953fc0f8f9a Types: Patch -
New CVE Received by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
May. 28, 2026
Action Type Old Value New Value 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. Added Reference https://git.kernel.org/stable/c/4fdc6ee0802121d9cd96b8d085e589f51e5a4ec3 Added Reference https://git.kernel.org/stable/c/5d12e0ab009ade48c1bff9324fd9bea2c773d088 Added Reference https://git.kernel.org/stable/c/973e57c726c1f8e77259d1c8e519519f1e9aea77 Added Reference https://git.kernel.org/stable/c/d09d67d5de577cedae3de9497dff217e0ac8b641 Added Reference https://git.kernel.org/stable/c/f5ee467b56764964027c361641f64953fc0f8f9a