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.
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H
| Attack Vector | LOCAL |
|---|---|
| Attack Complexity | HIGH |
| Privileges Required | LOW |
| User Interaction | NONE |
| Scope | UNCHANGED |
| Confidentiality Impact | NONE |
| Integrity Impact | NONE |
| Availability Impact | HIGH |
| Source | Type | Description |
|---|---|---|
| [email protected] | Primary |
en
CWE-367
|
| Vendor | Product | Version | Update | Type |
|---|---|---|---|---|
| linux | linux_kernel | * | <built-in method update of dict object at 0x7fd369405040> | Operating System |
| linux | linux_kernel | * | <built-in method update of dict object at 0x7fd369404080> | Operating System |
| linux | linux_kernel | * | <built-in method update of dict object at 0x7fd369d6da00> | Operating System |
| linux | linux_kernel | * | <built-in method update of dict object at 0x7fd369d6d0c0> | Operating System |
| linux | linux_kernel | 2.6.34 | <built-in method update of dict object at 0x7fd369404280> | Operating System |
| linux | linux_kernel | 2.6.34 | <built-in method update of dict object at 0x7fd369405780> | Operating System |
| linux | linux_kernel | 2.6.34 | <built-in method update of dict object at 0x7fd369e82300> | Operating System |
| linux | linux_kernel | 2.6.34 | <built-in method update of dict object at 0x7fd369e833c0> | Operating System |
| linux | linux_kernel | 2.6.34 | <built-in method update of dict object at 0x7fd36ad4e300> | Operating System |
| linux | linux_kernel | 2.6.34 | <built-in method update of dict object at 0x7fd3694052c0> | Operating System |
| linux | linux_kernel | 2.6.34 | <built-in method update of dict object at 0x7fd36ad4d140> | Operating System |
| Vulnerable | CPE |
|---|---|
| Yes | cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* |
| Yes | cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* |
| Yes | cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* |
| Yes | cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* |
| Yes | cpe:2.3:o:linux:linux_kernel:2.6.34:-:*:*:*:*:*:* |
| Yes | cpe:2.3:o:linux:linux_kernel:2.6.34:rc2:*:*:*:*:*:* |
| Yes | cpe:2.3:o:linux:linux_kernel:2.6.34:rc3:*:*:*:*:*:* |
| Yes | cpe:2.3:o:linux:linux_kernel:2.6.34:rc4:*:*:*:*:*:* |
| Yes | cpe:2.3:o:linux:linux_kernel:2.6.34:rc5:*:*:*:*:*:* |
| Yes | cpe:2.3:o:linux:linux_kernel:2.6.34:rc6:*:*:*:*:*:* |
| Yes | cpe:2.3:o:linux:linux_kernel:2.6.34:rc7:*:*:*:*:*:* |