{"cve":"CVE-2021-47508","nvd":{"published":"2024-05-24T15:15:11.573","modified":"2026-06-17T04:17:39.253","status":"Analyzed","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: free exchange changeset on failures\n\nFstests runs on my VMs have show several kmemleak reports like the following.\n\n  unreferenced object 0xffff88811ae59080 (size 64):\n    comm \"xfs_io\", pid 12124, jiffies 4294987392 (age 6.368s)\n    hex dump (first 32 bytes):\n      00 c0 1c 00 00 00 00 00 ff cf 1c 00 00 00 00 00  ................\n      90 97 e5 1a 81 88 ff ff 90 97 e5 1a 81 88 ff ff  ................\n    backtrace:\n      [<00000000ac0176d2>] ulist_add_merge+0x60/0x150 [btrfs]\n      [<0000000076e9f312>] set_state_bits+0x86/0xc0 [btrfs]\n      [<0000000014fe73d6>] set_extent_bit+0x270/0x690 [btrfs]\n      [<000000004f675208>] set_record_extent_bits+0x19/0x20 [btrfs]\n      [<00000000b96137b1>] qgroup_reserve_data+0x274/0x310 [btrfs]\n      [<0000000057e9dcbb>] btrfs_check_data_free_space+0x5c/0xa0 [btrfs]\n      [<0000000019c4511d>] btrfs_delalloc_reserve_space+0x1b/0xa0 [btrfs]\n      [<000000006d37e007>] btrfs_dio_iomap_begin+0x415/0x970 [btrfs]\n      [<00000000fb8a74b8>] iomap_iter+0x161/0x1e0\n      [<0000000071dff6ff>] __iomap_dio_rw+0x1df/0x700\n      [<000000002567ba53>] iomap_dio_rw+0x5/0x20\n      [<0000000072e555f8>] btrfs_file_write_iter+0x290/0x530 [btrfs]\n      [<000000005eb3d845>] new_sync_write+0x106/0x180\n      [<000000003fb505bf>] vfs_write+0x24d/0x2f0\n      [<000000009bb57d37>] __x64_sys_pwrite64+0x69/0xa0\n      [<000000003eba3fdf>] do_syscall_64+0x43/0x90\n\nIn case brtfs_qgroup_reserve_data() or btrfs_delalloc_reserve_metadata()\nfail the allocated extent_changeset will not be freed.\n\nSo in btrfs_check_data_free_space() and btrfs_delalloc_reserve_space()\nfree the allocated extent_changeset to get rid of the allocated memory.\n\nThe issue currently only happens in the direct IO write path, but only\nafter 65b3c08606e5 (\"btrfs: fix ENOSPC failure when attempting direct IO\nwrite into NOCOW range\"), and also at defrag_one_locked_target(). Every\nother place is always calling extent_changeset_free() even if its call\nto btrfs_delalloc_reserve_space() or btrfs_check_data_free_space() has\nfailed.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5},"cwes":["CWE-401"],"references":["https://git.kernel.org/stable/c/ca06c5cb1b6dbfe67655b33c02fc394d65824519","https://git.kernel.org/stable/c/da5e817d9d75422eaaa05490d0b9a5e328fc1a51","https://git.kernel.org/stable/c/ca06c5cb1b6dbfe67655b33c02fc394d65824519","https://git.kernel.org/stable/c/da5e817d9d75422eaaa05490d0b9a5e328fc1a51"],"products":["linux:linux_kernel"],"source":"nvd","synced_at":"2026-10-19T21:50:30.954589733+00:00"},"epss":{"cve":"CVE-2021-47508","score":0.00205,"percentile":0.10545,"date":"2026-10-31"},"kev":null,"osv":[],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}