CVE-2021-47508
published 2024-05-24CVE-2021-47508: In the Linux kernel, the following vulnerability has been resolved: btrfs: free exchange changeset on failures Fstests runs on my VMs have show several…
PriorityP419medium5.5CVSS 3.1
AVLACLPRLUINSUCNINAH
EPSS
0.21%
10.7th percentile
In the Linux kernel, the following vulnerability has been resolved:
btrfs: free exchange changeset on failures
Fstests runs on my VMs have show several kmemleak reports like the following.
unreferenced object 0xffff88811ae59080 (size 64):
comm "xfs_io", pid 12124, jiffies 4294987392 (age 6.368s)
hex dump (first 32 bytes):
00 c0 1c 00 00 00 00 00 ff cf 1c 00 00 00 00 00 ................
90 97 e5 1a 81 88 ff ff 90 97 e5 1a 81 88 ff ff ................
backtrace:
[] ulist_add_merge+0x60/0x150 [btrfs]
[] set_state_bits+0x86/0xc0 [btrfs]
[] set_extent_bit+0x270/0x690 [btrfs]
[] set_record_extent_bits+0x19/0x20 [btrfs]
[] qgroup_reserve_data+0x274/0x310 [btrfs]
[] btrfs_check_data_free_space+0x5c/0xa0 [btrfs]
[] btrfs_delalloc_reserve_space+0x1b/0xa0 [btrfs]
[] btrfs_dio_iomap_begin+0x415/0x970 [btrfs]
[] iomap_iter+0x161/0x1e0
[] __iomap_dio_rw+0x1df/0x700
[] iomap_dio_rw+0x5/0x20
[] btrfs_file_write_iter+0x290/0x530 [btrfs]
[] new_sync_write+0x106/0x180
[] vfs_write+0x24d/0x2f0
[] __x64_sys_pwrite64+0x69/0xa0
[] do_syscall_64+0x43/0x90
In case brtfs_qgroup_reserve_data() or btrfs_delalloc_reserve_metadata()
fail the allocated extent_changeset will not be freed.
So in btrfs_check_data_free_space() and btrfs_delalloc_reserve_space()
free the allocated extent_changeset to get rid of the allocated memory.
The issue currently only happens in the direct IO write path, but only
after 65b3c08606e5 ("btrfs: fix ENOSPC failure when attempting direct IO
write into NOCOW range"), and also at defrag_one_locked_target(). Every
other place is always calling extent_changeset_free() even if its call
to btrfs_delalloc_reserve_space() or btrfs_check_data_free_space() has
failed.
Affected
9 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| debian | linux | < linux 5.15.15-1 (bookworm) | linux 5.15.15-1 (bookworm) |
| linux | linux | — | — |
| linux | linux | >= 364ecf3651e0862152c8b340d7cb3021dc0122c7 < ca06c5cb1b6dbfe67655b33c02fc394d65824519 | ca06c5cb1b6dbfe67655b33c02fc394d65824519 |
| linux | linux | >= 364ecf3651e0862152c8b340d7cb3021dc0122c7 < da5e817d9d75422eaaa05490d0b9a5e328fc1a51 | da5e817d9d75422eaaa05490d0b9a5e328fc1a51 |
| linux | linux_kernel | < 5.15.8 | 5.15.8 |
| linux | linux_kernel | — | — |
| linux | linux_kernel | >= 0 < 5.15.15-1 | 5.15.15-1 |
| linux | linux_kernel | >= 0 < 5.15.15-1 | 5.15.15-1 |
| linux | linux_kernel | >= 0 < 5.15.15-1 | 5.15.15-1 |
CVSS provenance
nvdv3.15.5MEDIUMCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
osv5.5MEDIUM
vendor_debian5.5MEDIUM
vendor_redhat5.5MEDIUM
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
Red Hat
kernel: btrfs: free exchange changeset on failures
vendor_redhat·2024-05-24·CVSS 5.5
CVE-2021-47508 [MEDIUM] CWE-401 kernel: btrfs: free exchange changeset on failures
kernel: btrfs: free exchange changeset on failures
In the Linux kernel, the following vulnerability has been resolved:
btrfs: free exchange changeset on failures
Fstests runs on my VMs have show several kmemleak reports like the following.
unreferenced object 0xffff88811ae59080 (size 64):
comm "xfs_io", pid 12124, jiffies 4294987392 (age 6.368s)
hex dump (first 32 bytes):
00 c0 1c 00 00 00 00 00 ff cf 1c 00 00 00 00 00 ................
90 97 e5 1a 81 88 ff ff 90 97 e5 1a 81 88 ff ff ................
backtrace:
[] ulist_add_merge+0x60/0x150 [btrfs]
[] set_state_bits+0x86/0xc0 [btrfs]
[] set_extent_bit+0x270/0x690 [btrfs]
[] set_record_extent_bits+0x19/0x20 [btrfs]
[] qgroup_reserve_data+0x274/0x310 [btrfs]
[] btrfs_check_data_free_space+0x5c/0xa0 [btrfs]
[] btrfs_delalloc_reserve_space+0x1
Debian
CVE-2021-47508: linux - In the Linux kernel, the following vulnerability has been resolved: btrfs: free...
vendor_debian·2021·CVSS 5.5
CVE-2021-47508 [MEDIUM] CVE-2021-47508: linux - In the Linux kernel, the following vulnerability has been resolved: btrfs: free...
In the Linux kernel, the following vulnerability has been resolved: btrfs: free exchange changeset on failures Fstests runs on my VMs have show several kmemleak reports like the following. unreferenced object 0xffff88811ae59080 (size 64): comm "xfs_io", pid 12124, jiffies 4294987392 (age 6.368s) hex dump (first 32 bytes): 00 c0 1c 00 00 00 00 00 ff cf 1c 00 00 00 00 00 ................ 90 97 e5 1a 81 88 ff ff 90 97 e5 1a 81 88 ff ff ................ backtrace: [] ulist_add_merge+0x60/0x150 [btrfs] [] set_state_bits+0x86/0xc0 [btrfs] [] set_extent_bit+0x270/0x690 [btrfs] [] set_record_extent_bits+0x19/0x20 [btrfs] [] qgroup_reserve_data+0x274/0x310 [btrfs] [] btrfs_check_data_free_space+0x5c/0xa0 [btrfs] [] btrfs_delalloc_reserve_space+0x1b/0xa0 [btrfs] [] btrfs_dio_iomap_begin+0x415/0x970
OSV
CVE-2021-47508: In the Linux kernel, the following vulnerability has been resolved: btrfs: free exchange changeset on failures Fstests runs on my VMs have show severa
osv·2024-05-24·CVSS 5.5
CVE-2021-47508 [MEDIUM] CVE-2021-47508: In the Linux kernel, the following vulnerability has been resolved: btrfs: free exchange changeset on failures Fstests runs on my VMs have show severa
In the Linux kernel, the following vulnerability has been resolved: btrfs: free exchange changeset on failures Fstests runs on my VMs have show several kmemleak reports like the following. unreferenced object 0xffff88811ae59080 (size 64): comm "xfs_io", pid 12124, jiffies 4294987392 (age 6.368s) hex dump (first 32 bytes): 00 c0 1c 00 00 00 00 00 ff cf 1c 00 00 00 00 00 ................ 90 97 e5 1a 81 88 ff ff 90 97 e5 1a 81 88 ff ff ................ backtrace: [] ulist_add_merge+0x60/0x150 [btrfs] [] set_state_bits+0x86/0xc0 [btrfs] [] set_extent_bit+0x270/0x690 [btrfs] [] set_record_extent_bits+0x19/0x20 [btrfs] [] qgroup_reserve_data+0x274/0x310 [btrfs] [] btrfs_check_data_free_space+0x5c/0xa0 [btrfs] [] btrfs_delalloc_reserve_space+0x1b/0xa0 [btrfs] [] btrfs_dio_iomap_begin+0x415/0x970
No detection rules found.
No public exploits indexed.
2024-05-24
Published