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

CVSS Meta Temp Score
CVSS is a standardized scoring system to determine possibilities of attacks. The Temp Score considers temporal factors like disclosure, exploit and countermeasures. The unique Meta Score calculates the average score of different sources to provide a normalized scoring system.
Current Exploit Price (≈)
Our analysts are monitoring exploit markets and are in contact with vulnerability brokers. The range indicates the observed or calculated exploit price to be seen on exploit markets. A good indicator to understand the monetary effort required for and the popularity of an attack.
CTI Interest Score
Our Cyber Threat Intelligence team is monitoring different web sites, mailing lists, exploit markets and social media networks. The CTI Interest Score identifies the interest of attackers and the security community for this specific vulnerability in real-time. A high score indicates an elevated risk to be targeted for this vulnerability.
4.9$0-$5k0.00

Summaryinfo

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.

Detailsinfo

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.

Productinfo

Type

Vendor

Name

Version

License

Website

CPE 2.3info

CPE 2.2info

CVSSv4info

VulDB Vector: 🔍
VulDB Reliability: 🔍

CVSSv3info

VulDB Meta Base Score: 5.0
VulDB 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: 🔍

CVSSv2info

AVACAuCIA
💳💳💳💳💳💳
💳💳💳💳💳💳
💳💳💳💳💳💳
VectorComplexityAuthenticationConfidentialityIntegrityAvailability
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock

VulDB Base Score: 🔍
VulDB Temp Score: 🔍
VulDB Reliability: 🔍

Exploitinginfo

Class: Allocation of resources
CWE: 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-DayUnlockUnlockUnlockUnlock
TodayUnlockUnlockUnlockUnlock

Nessus ID: 239742
Nessus Name: TencentOS Server 2: kernel (TSSA-2024:1030)

Threat Intelligenceinfo

Interest: 🔍
Active Actors: 🔍
Active APT Groups: 🔍

Countermeasuresinfo

Recommended: Upgrade
Status: 🔍

0-Day Time: 🔍

Upgrade: Kernel 5.15.8
Patch: ca06c5cb1b6d/da5e817d9d75

Timelineinfo

05/22/2024 🔍
05/24/2024 +2 days 🔍
05/24/2024 +0 days 🔍
09/25/2025 +489 days 🔍

Sourcesinfo

Vendor: kernel.org

Advisory: git.kernel.org
Status: Confirmed

CVE: CVE-2021-47508 (🔍)
GCVE (CVE): GCVE-0-2021-47508
GCVE (VulDB): GCVE-100-266154

Entryinfo

Created: 05/24/2024 17:27
Updated: 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.

Discussion

No comments yet. Languages: en.

Please log in to comment.

Want to stay up to date on a daily basis?

Enable the mail alert feature now!