Linux Kernel up to 5.15.7 Direct IO Write brtfs_qgroup_reserve_data allocation of resources

| CVSS Meta Temp Score | Current Exploit Price (≈) | CTI Interest Score |
|---|---|---|
| 4.9 | $0-$5k | 0.00 |
Summary
A vulnerability classified as problematic was found in Linux Kernel up to 5.15.7. This impacts the function brtfs_qgroup_reserve_data of the component Direct IO Write Handler. The manipulation results in allocation of resources.
This vulnerability is cataloged as CVE-2021-47508. There is no exploit available.
Upgrading the affected component is advised.
Details
A vulnerability was found in Linux Kernel up to 5.15.7. It has been classified as problematic. Affected is the function brtfs_qgroup_reserve_data of the component Direct IO Write Handler. The manipulation with an unknown input leads to a allocation of resources vulnerability. CWE is classifying the issue as CWE-770. The product allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor. The impact remains unknown. CVE summarizes:
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.
The advisory is available at git.kernel.org. This vulnerability is traded as CVE-2021-47508 since 05/22/2024. The exploitability is told to be difficult. Technical details are known, but there is no available exploit.
The vulnerability scanner Nessus provides a plugin with the ID 239742 (TencentOS Server 2: kernel (TSSA-2024:1030)), which helps to determine the existence of the flaw in a target environment.
Upgrading to version 5.15.8 eliminates this vulnerability. Applying the patch ca06c5cb1b6d/da5e817d9d75 is able to eliminate this problem. The bugfix is ready for download at git.kernel.org. The best possible mitigation is suggested to be upgrading to the latest version.
The vulnerability is also documented in the vulnerability database at Tenable (239742). If you want to get best quality of vulnerability data, you may have to visit VulDB.
Product
Type
Vendor
Name
Version
License
Website
- Vendor: https://www.kernel.org/
CPE 2.3
CPE 2.2
CVSSv4
VulDB Vector: 🔍VulDB Reliability: 🔍
CVSSv3
VulDB Meta Base Score: 5.0VulDB Meta Temp Score: 4.9
VulDB Base Score: 4.6
VulDB Temp Score: 4.4
VulDB Vector: 🔍
VulDB Reliability: 🔍
NVD Base Score: 5.5
NVD Vector: 🔍
CVSSv2
| AV | AC | Au | C | I | A |
|---|---|---|---|---|---|
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| Vector | Complexity | Authentication | Confidentiality | Integrity | Availability |
|---|---|---|---|---|---|
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
VulDB Base Score: 🔍
VulDB Temp Score: 🔍
VulDB Reliability: 🔍
Exploiting
Class: Allocation of resourcesCWE: CWE-770 / CWE-400 / CWE-404
CAPEC: 🔍
ATT&CK: 🔍
Physical: Partially
Local: Yes
Remote: Partially
Availability: 🔍
Status: Not defined
EPSS Score: 🔍
EPSS Percentile: 🔍
Price Prediction: 🔍
Current Price Estimation: 🔍
| 0-Day | Unlock | Unlock | Unlock | Unlock |
|---|---|---|---|---|
| Today | Unlock | Unlock | Unlock | Unlock |
Nessus ID: 239742
Nessus Name: TencentOS Server 2: kernel (TSSA-2024:1030)
Threat Intelligence
Interest: 🔍Active Actors: 🔍
Active APT Groups: 🔍
Countermeasures
Recommended: UpgradeStatus: 🔍
0-Day Time: 🔍
Upgrade: Kernel 5.15.8
Patch: ca06c5cb1b6d/da5e817d9d75
Timeline
05/22/2024 🔍05/24/2024 🔍
05/24/2024 🔍
09/25/2025 🔍
Sources
Vendor: kernel.orgAdvisory: git.kernel.org
Status: Confirmed
CVE: CVE-2021-47508 (🔍)
GCVE (CVE): GCVE-0-2021-47508
GCVE (VulDB): GCVE-100-266154
Entry
Created: 05/24/2024 17:27Updated: 09/25/2025 03:25
Changes: 05/24/2024 17:27 (57), 06/21/2025 02:47 (3), 09/25/2025 03:25 (12)
Complete: 🔍
Cache ID: 216::103
If you want to get best quality of vulnerability data, you may have to visit VulDB.
No comments yet. Languages: en.
Please log in to comment.