We use these services and cookies to improve your user experience. You may opt out if you wish, however, this may limit some features on this site.

Please see our statement on Data Privacy.

Crisp.chat (Helpdesk and Chat)

Ok

THREATINT
PUBLISHED

CVE-2024-42231

btrfs: zoned: fix calc_available_free_space() for zoned mode



AssignerLinux
Reserved2024-07-30
Published2024-07-30
Updated2024-09-11

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.

Product status

Default status
0x4005f2ad00

cb6cbab79055 before 8548903b1999
affected

cb6cbab79055 before 64d2c847ba38
affected

Default status
0x4005f2ad90

6.7
affected

Any version before 6.7
unaffected

6.9.9
unaffected

6.10
unaffected

References

https://git.kernel.org/stable/c/8548903b1999bba02a2b894ad750ab8eb1f40307

https://git.kernel.org/stable/c/64d2c847ba380e07b9072d65a50aa6469d2aa43f

cve.org CVE-2024-42231

nvd.nist.gov CVE-2024-42231

Download JSON

Share this page
https://cve.threatint.com/CVE/CVE-2024-42231
Subscribe to our newsletter to learn more about our work.