CVE-2026-46159
btrfs: fix btrfs_ioctl_space_info() slot_count TOCTOU which can lead to info-leak
Reported by linux · Published May 28, 2026
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| kernel | Amazon Linux | 1:6.1.176-220.358.amzn2023 |
| kernel6.18-tools | Amazon Linux | 1:6.18.33-63.124.amzn2023 |
| kernel-livepatch-6.1.176-220.358 | Amazon Linux | 1:1.0-0.amzn2023 |
| kernel6.12-devel | Amazon Linux | 1:6.12.90-120.164.amzn2023 |
| kernel-livepatch-6.12.90-120.164 | Amazon Linux | 1:1.0-0.amzn2023 |
| kernel-modules-extra | Amazon Linux | 1:6.1.176-220.358.amzn2023 |
| kernel6.18 | Amazon Linux | 1:6.18.33-63.124.amzn2023 |
| perf6.18 | Amazon Linux | 1:6.18.33-63.124.amzn2023 |
| bpftool6.18 | Amazon Linux | 1:6.18.33-63.124.amzn2023 |
| python3-perf6.18 | Amazon Linux | 1:6.18.33-63.124.amzn2023 |
| kernel6.18-modules-extra | Amazon Linux | 1:6.18.33-63.124.amzn2023 |
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 7fde62bffb576d384ea49a3aed3403d5609ee5bc, 7fde62bffb576d384ea49a3aed3403d5609ee5bc, 7fde62bffb576d384ea49a3aed3403d5609ee5bc |
| Linux | Linux | 2.6.34, 0, 5.10.259 |
| amazon:2023 | kernel | 0 |
| amazon:2023 | kernel6.18-tools | 0 |
| amazon:2023 | kernel-livepatch-6.1.176-220.358 | 0 |
| amazon:2023 | kernel6.12-devel | 0 |
| amazon:2023 | kernel-livepatch-6.12.90-120.164 | 0 |
| amazon:2023 | kernel-modules-extra | 0 |
| amazon:2023 | kernel6.18 | 0 |
| amazon:2023 | perf6.18 | 0 |
| amazon:2023 | bpftool6.18 | 0 |
| amazon:2023 | python3-perf6.18 | 0 |
| amazon:2023 | kernel6.18-modules-extra | 0 |
| linux | linux_kernel | 2.6.34, 2.6.34, 2.6.34 |
| amazon:2023 | kernel-devel | 0 |
| Siemens | SIMATIC S7-1500 TM MFP - GNU/Linux subsystem | 0 |
| Linux | Linux | 7.1, 7fde62bffb576d384ea49a3aed3403d5609ee5bc, 7fde62bffb576d384ea49a3aed3403d5609ee5bc |
| amazon:2023 | kernel6.12-modules-extra-common | 0 |
| amazon:2023 | kernel6.12-modules-extra | 0 |
| amazon:2023 | kernel6.18-modules-extra-common | 0 |
…and 18 more
Timeline
- May 27, 2026 CVE Published
- May 28, 2026 EPSS Score (10 in total, the first dated here)
- Jun 1, 2026 Security Advisory (131 in total, the first dated here)
- Jun 4, 2026 Coalition ESS Score
- Aug 11, 2026 Distribution Patch (128 in total, the first dated here)
- Nov 6, 2026 CVE Updated
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2026-46159
vulnetix vdb fixes CVE-2026-46159
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2026-46159/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart