{"id":"CVE-2024-42231","aliases":["CVE-2024-42231"],"related":[],"kind":"vulnerability","state":"published","title":"btrfs: zoned: fix calc_available_free_space() for zoned mode","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: zoned: fix calc_available_free_space() for zoned mode\n\ncalc_available_free_space() returns the total size of metadata (or\nsystem) block groups, which can be allocated from unallocated disk\nspace. The logic is wrong on zoned mode in two places.\n\nFirst, the calculation of data_chunk_size is wrong. We always allocate\none zone as one chunk, and no partial allocation of a zone. So, we\nshould use zone_size (= data_sinfo->chunk_size) as it is.\n\nSecond, the result \"avail\" may not be zone aligned. Since we always\nallocate one zone as one chunk on zoned mode, returning non-zone size\naligned bytes will result in less pressure on the async metadata reclaim\nprocess.\n\nThis is serious for the nearly full state with a large zone size device.\nAllowing over-commit too much will result in less async reclaim work and\nend up in ENOSPC. We can align down to the zone size to avoid that.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: zoned: fix calc_available_free_space() for zoned mode\n\ncalc_available_free_space() returns the total size of metadata (or\nsystem) block groups, which can be allocated from unallocated disk\nspace. The logic is wrong on zoned mode in two places.\n\nFirst, the calculation of data_chunk_size is wrong. We always allocate\none zone as one chunk, and no partial allocation of a zone. So, we\nshould use zone_size (= data_sinfo->chunk_size) as it is.\n\nSecond, the result \"avail\" may not be zone aligned. Since we always\nallocate one zone as one chunk on zoned mode, returning non-zone size\naligned bytes will result in less pressure on the async metadata reclaim\nprocess.\n\nThis is serious for the nearly full state with a large zone size device.\nAllowing over-commit too much will result in less async reclaim work and\nend up in ENOSPC. We can align down to the zone size to avoid that.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: btrfs:zoned: fix calc_available_free_space() para el modo zonal calc_available_free_space() devuelve el tamaño total de los grupos de bloques de metadatos (o sistema), que se pueden asignar desde espacio en disco no asignado. La lógica es incorrecta en el modo por zonas en dos lugares. Primero, el cálculo de data_chunk_size es incorrecto. Siempre asignamos una zona como un fragmento y no asignamos una zona parcial. Entonces, deberíamos usar Zone_size (= data_sinfo-&gt;chunk_size) tal como está. En segundo lugar, es posible que el resultado \"avail\" no esté alineado con la zona. Dado que siempre asignamos una zona como un fragmento en el modo de zona, devolver bytes alineados sin tamaño de zona generará menos presión sobre el proceso de recuperación de metadatos asíncronos. Esto es grave para el estado casi lleno con un dispositivo de gran tamaño de zona. Permitir un compromiso excesivo dará como resultado menos trabajo de recuperación asíncrona y terminará en ENOSPC. Podemos alinearnos con el tamaño de la zona para evitar eso.","source":"nvd"}],"published":"2024-07-30T07:47:11.409Z","modified":"2026-06-17T07:49:04.050Z","severity":{"scorer":"NVD","scheme":"CVSS: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,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS: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,"rating":"MEDIUM"}],"cwes":["CWE-682"],"affected":[{"ranges":[{"type":"git","introduced":"cb6cbab79055ca207ad88bc54226b48ececdcef0","fixed":"8548903b1999bba02a2b894ad750ab8eb1f40307","status":"affected"},{"type":"git","introduced":"cb6cbab79055ca207ad88bc54226b48ececdcef0","fixed":"64d2c847ba380e07b9072d65a50aa6469d2aa43f","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.7","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.7","status":"unaffected"},{"type":"semver","introduced":"6.9.9","lastAffected":"6.9.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.10","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"6.7","fixed":"6.9.9"},{"status":"affected","version":"6.10"},{"status":"affected","version":"6.10"},{"status":"affected","version":"6.10"},{"status":"affected","version":"6.10"},{"status":"affected","version":"6.10"},{"status":"affected","version":"6.10"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/8548903b1999bba02a2b894ad750ab8eb1f40307","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/64d2c847ba380e07b9072d65a50aa6469d2aa43f","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-09-10T16:14:20.817Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-42231","url":"https://www.cve.org/CVERecord?id=CVE-2024-42231","licence":"CVE Terms of Use","modified":"2026-05-11T20:28:20.596Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-42231","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-42231","licence":"Public domain","modified":"2026-06-17T07:49:04.050Z"}],"updatedAt":"2026-11-25T22:58:43.427Z","epss":{"score":0.00183,"percentile":0.08215,"date":"2026-12-01T12:00:22.000Z"}}