CVE-2024-42231

MEDIUM

Linux Kernel 6.7-6.9.9 - Incorrect Calculation in Btrfs Zoned Mode Free Space Calculation

Title source: llm
STIX 2.1

Description

In the Linux kernel, the following vulnerability has been resolved: btrfs: zoned: fix calc_available_free_space() for zoned mode calc_available_free_space() returns the total size of metadata (or system) block groups, which can be allocated from unallocated disk space. The logic is wrong on zoned mode in two places. First, the calculation of data_chunk_size is wrong. We always allocate one zone as one chunk, and no partial allocation of a zone. So, we should use zone_size (= data_sinfo->chunk_size) as it is. Second, the result "avail" may not be zone aligned. Since we always allocate one zone as one chunk on zoned mode, returning non-zone size aligned bytes will result in less pressure on the async metadata reclaim process. This is serious for the nearly full state with a large zone size device. Allowing over-commit too much will result in less async reclaim work and end up in ENOSPC. We can align down to the zone size to avoid that.

Scores

CVSS v3 5.5
EPSS 0.0018
EPSS Percentile 8.0%
Attack Vector LOCAL
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

CISA SSVC

Vulnrichment
Exploitation none
Automatable no
Technical Impact partial

Details

CWE
CWE-682
Status published
Products (9)
linux/Kernel 6.7.0 - 6.9.9linux
Linux/Linux < 6.7
Linux/Linux 6.10
Linux/Linux 6.7
Linux/Linux 6.9.9 - 6.9.*
Linux/Linux cb6cbab79055ca207ad88bc54226b48ececdcef0 - 64d2c847ba380e07b9072d65a50aa6469d2aa43f
Linux/Linux cb6cbab79055ca207ad88bc54226b48ececdcef0 - 8548903b1999bba02a2b894ad750ab8eb1f40307
linux/linux_kernel 6.10 rc1 (6 CPE variants)
linux/linux_kernel 6.7 - 6.9.9
Published Jul 30, 2024
Tracked Since Feb 18, 2026