In the Linux kernel, the following vulnerability has been resolved:
btrfs: fix btrfsioctlspaceinfo() slotcount TOCTOU which can lead to info-leak
btrfsioctlspaceinfo() 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 groupssem 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, copytouser() copies the full alloc_size bytes including trailing uninitialized kmalloc bytes to userspace.
Fix by copying only totalspaces entries (the actually-filled count from the second pass) instead of allocsize bytes, and switch to kzalloc so any future copy size mismatch cannot leak heap data.
{
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/46xxx/CVE-2026-46159.json",
"cna_assigner": "Linux"
}