# CVE-2024-39482: bcache: fix variable length array abuse in btree_iter

- Severity: High 7.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.24%, higher than 15% of CVEs (2026-12-01)
- Published: 2024-07-05T06:55:10.599Z
- Modified: 2026-10-15T01:18:33.800Z
- Weaknesses: CWE-770
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

bcache: fix variable length array abuse in btree_iter

btree_iter is used in two ways: either allocated on the stack with a
fixed size MAX_BSETS, or from a mempool with a dynamic size based on the
specific cache set. Previously, the struct had a fixed-length array of
size MAX_BSETS which was indexed out-of-bounds for the dynamically-sized
iterators, which causes UBSAN to complain.

This patch uses the same approach as in bcachefs's sort_iter and splits
the iterator into a btree_iter with a flexible array member and a
btree_iter_stack which embeds a btree_iter as well as a fixed-length
data array.

(As written by CVE List.)

## Affected

- Linux Linux: from cafe563591446cf80bfbc2fe3bc72a2e36cf1060 before 2c3d7b03b658dc8bfa6112b194b67b92a87e081b; from cafe563591446cf80bfbc2fe3bc72a2e36cf1060 before 5a1922adc5798b7ec894cd3f197afb6f9591b023; from cafe563591446cf80bfbc2fe3bc72a2e36cf1060 before 934e1e4331859183a861f396d7dfaf33cb5afb02; from cafe563591446cf80bfbc2fe3bc72a2e36cf1060 before 6479b9f41583b013041943c4602e1ad61cec8148; from cafe563591446cf80bfbc2fe3bc72a2e36cf1060 before 0c31344e22dd8d6b1394c6e4c41d639015bdc671; from cafe563591446cf80bfbc2fe3bc72a2e36cf1060 before 3a861560ccb35f2a4f0a4b8207fa7c2a35fc7f31; 3.10 (not affected: before 3.10; from 5.10.221 up to 5.10.*; from 5.15.162 up to 5.15.*; from 6.1.94 up to 6.1.*; from 6.6.34 up to 6.6.*; from 6.9.5 up to 6.9.*; from 6.10 up to *)
- linux linux_kernel: from 5.10 before 5.10.221; from 5.15 before 5.15.162; from 6.1 before 6.1.94; from 6.6 before 6.6.34; from 6.9 before 6.9.5

## Every score

- Linux: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://git.kernel.org/stable/c/2c3d7b03b658dc8bfa6112b194b67b92a87e081b> (mailing-list, patch)
- <https://git.kernel.org/stable/c/5a1922adc5798b7ec894cd3f197afb6f9591b023> (mailing-list, patch)
- <https://git.kernel.org/stable/c/934e1e4331859183a861f396d7dfaf33cb5afb02> (mailing-list, patch)
- <https://git.kernel.org/stable/c/6479b9f41583b013041943c4602e1ad61cec8148> (mailing-list, patch)
- <https://git.kernel.org/stable/c/0c31344e22dd8d6b1394c6e4c41d639015bdc671> (mailing-list, patch)
- <https://git.kernel.org/stable/c/3a861560ccb35f2a4f0a4b8207fa7c2a35fc7f31> (mailing-list, patch)
- <https://cert-portal.siemens.com/productcert/html/ssa-265688.html>
- <https://cert-portal.siemens.com/productcert/html/ssa-613116.html>
- <https://cert-portal.siemens.com/productcert/html/ssa-355557.html>

## Sources

- CVE List: [CVE-2024-39482](https://www.cve.org/CVERecord?id=CVE-2024-39482), CVE Terms of Use, modified 2026-10-15
- NVD: [CVE-2024-39482](https://nvd.nist.gov/vuln/detail/CVE-2024-39482), Public domain, modified 2026-10-15

---

Page: https://cve.day/CVE-2024-39482 · Whole record: https://cve.day/CVE-2024-39482.json · Rebuilt by cve.day 2026-11-25T22:58:42.520Z
