{"id":"CVE-2026-46159","summary":"btrfs: fix btrfs_ioctl_space_info() slot_count TOCTOU which can lead to info-leak","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: fix btrfs_ioctl_space_info() slot_count TOCTOU which can lead to info-leak\n\nbtrfs_ioctl_space_info() has a TOCTOU race between two passes over the\nblock group RAID type lists. The first pass counts entries to determine\nthe allocation size, then the second pass fills the buffer. The\ngroups_sem rwlock is released between passes, allowing concurrent block\ngroup removal to reduce the entry count.\n\nWhen the second pass fills fewer entries than the first pass counted,\ncopy_to_user() copies the full alloc_size bytes including trailing\nuninitialized kmalloc bytes to userspace.\n\nFix by copying only total_spaces entries (the actually-filled count from\nthe second pass) instead of alloc_size bytes, and switch to kzalloc so\nany future copy size mismatch cannot leak heap data.","modified":"2026-07-09T18:30:39.167284630Z","published":"2026-05-28T09:36:14.676Z","related":["SUSE-SU-2026:22099-1","SUSE-SU-2026:22108-1","SUSE-SU-2026:22112-1","SUSE-SU-2026:22117-1","SUSE-SU-2026:22127-1","SUSE-SU-2026:22137-1","SUSE-SU-2026:22433-1","SUSE-SU-2026:22458-1","SUSE-SU-2026:2450-1","SUSE-SU-2026:2482-1","SUSE-SU-2026:2591-1","SUSE-SU-2026:2630-1","SUSE-SU-2026:2631-1","SUSE-SU-2026:2632-1","SUSE-SU-2026:2638-1","SUSE-SU-2026:2658-1","openSUSE-SU-2026:10954-1","openSUSE-SU-2026:20965-1"],"database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/46xxx/CVE-2026-46159.json","cna_assigner":"Linux"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/4fdc6ee0802121d9cd96b8d085e589f51e5a4ec3"},{"type":"WEB","url":"https://git.kernel.org/stable/c/5d12e0ab009ade48c1bff9324fd9bea2c773d088"},{"type":"WEB","url":"https://git.kernel.org/stable/c/973e57c726c1f8e77259d1c8e519519f1e9aea77"},{"type":"WEB","url":"https://git.kernel.org/stable/c/d09d67d5de577cedae3de9497dff217e0ac8b641"},{"type":"WEB","url":"https://git.kernel.org/stable/c/d69a4a6813fdba7c4cc3695a7e843842b240790d"},{"type":"WEB","url":"https://git.kernel.org/stable/c/d8224b1be6627c6c3b204bfb264508d27c65ac44"},{"type":"WEB","url":"https://git.kernel.org/stable/c/f407aad350bdea4db300c47433573b7a41630d33"},{"type":"WEB","url":"https://git.kernel.org/stable/c/f5ee467b56764964027c361641f64953fc0f8f9a"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/46xxx/CVE-2026-46159.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-46159"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"7fde62bffb576d384ea49a3aed3403d5609ee5bc"},{"fixed":"f407aad350bdea4db300c47433573b7a41630d33"},{"fixed":"d8224b1be6627c6c3b204bfb264508d27c65ac44"},{"fixed":"d69a4a6813fdba7c4cc3695a7e843842b240790d"},{"fixed":"f5ee467b56764964027c361641f64953fc0f8f9a"},{"fixed":"4fdc6ee0802121d9cd96b8d085e589f51e5a4ec3"},{"fixed":"5d12e0ab009ade48c1bff9324fd9bea2c773d088"},{"fixed":"d09d67d5de577cedae3de9497dff217e0ac8b641"},{"fixed":"973e57c726c1f8e77259d1c8e519519f1e9aea77"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-46159.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.6.34"},{"fixed":"5.10.259"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.11.0"},{"fixed":"5.15.210"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.16.0"},{"fixed":"6.1.176"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.2.0"},{"fixed":"6.6.140"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.7.0"},{"fixed":"6.12.90"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.32"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.0.7"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-46159.json"}}],"schema_version":"1.7.5"}