# CVE-2024-39482: bcache: fix variable length array abuse in btree\_iter

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.34% (percentile 19, 2026-11-26)
- **CWE:** CWE-770
- **Published:** 2024-07-05T06:55:10.599Z
- **Modified:** 2026-10-15T01:18:33.800Z

## Who should check

- Anyone running Linux \>= cafe563591446cf80bfbc2fe3bc72a2e36cf1060, \< 2c3d7b03b658dc8bfa6112b194b67b92a87e081b; \>= cafe563591446cf80bfbc2fe3bc72a2e36cf1060, \< 5a1922adc5798b7ec894cd3f197afb6f9591b023; \>= cafe563591446cf80bfbc2fe3bc72a2e36cf1060, \< 934e1e4331859183a861f396d7dfaf33cb5afb02; \>= cafe563591446cf80bfbc2fe3bc72a2e36cf1060, \< 6479b9f41583b013041943c4602e1ad61cec8148; \>= cafe563591446cf80bfbc2fe3bc72a2e36cf1060, \< 0c31344e22dd8d6b1394c6e4c41d639015bdc671; \>= cafe563591446cf80bfbc2fe3bc72a2e36cf1060, \< 3a861560ccb35f2a4f0a4b8207fa7c2a35fc7f31
- Anyone running Linux 3.10

## 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.

## Affected and fixed versions

- Linux: \>= cafe563591446cf80bfbc2fe3bc72a2e36cf1060, \< 2c3d7b03b658dc8bfa6112b194b67b92a87e081b; \>= cafe563591446cf80bfbc2fe3bc72a2e36cf1060, \< 5a1922adc5798b7ec894cd3f197afb6f9591b023; \>= cafe563591446cf80bfbc2fe3bc72a2e36cf1060, \< 934e1e4331859183a861f396d7dfaf33cb5afb02; \>= cafe563591446cf80bfbc2fe3bc72a2e36cf1060, \< 6479b9f41583b013041943c4602e1ad61cec8148; \>= cafe563591446cf80bfbc2fe3bc72a2e36cf1060, \< 0c31344e22dd8d6b1394c6e4c41d639015bdc671; \>= cafe563591446cf80bfbc2fe3bc72a2e36cf1060, \< 3a861560ccb35f2a4f0a4b8207fa7c2a35fc7f31 (cvelist)
- Linux: 3.10 (cvelist)

## Mitigation

- Upgrade Linux to 3a861560ccb35f2a4f0a4b8207fa7c2a35fc7f31 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-39482. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-39482.md
Affected: Linux >= cafe563591446cf80bfbc2fe3bc72a2e36cf1060, < 2c3d7b03b658dc8bfa6112b194b67b92a87e081b; >= cafe563591446cf80bfbc2fe3bc72a2e36cf1060, < 5a1922adc5798b7ec894cd3f197afb6f9591b023; >= cafe563591446cf80bfbc2fe3bc72a2e36cf1060, < 934e1e4331859183a861f396d7dfaf33cb5afb02; >= cafe563591446cf80bfbc2f…
Fixed in: Linux 2c3d7b03b658dc8bfa6112b194b67b92a87e081b, Linux 5a1922adc5798b7ec894cd3f197afb6f9591b023, Linux 934e1e4331859183a861f396d7dfaf33cb5afb02, Linux 6479b9f41583b013041943c4602e1ad61cec8148, Linux 0c31344e22dd8d6b1394c6e4c41d639015bdc671, Linux 3a861560ccb35f2a4f0a4b8207fa7c2a35fc7f31

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-39482 being exploited?

There is no confirmed exploitation: CVE-2024-39482 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.34% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-39482?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-39482?

Linux \>= cafe563591446cf80bfbc2fe3bc72a2e36cf1060, \< 2c3d7b03b658dc8bfa6112b194b67b92a87e081b; \>= cafe563591446cf80bfbc2fe3bc72a2e36cf1060, \< 5a1922adc5798b7ec894cd3f197afb6f9591b023; \>= cafe563591446cf80bfbc2fe3bc72a2e36cf1060, \< 934e1e4331859183a861f396d7dfaf33cb5afb02; \>= cafe563591446cf80bfbc2fe3bc72a2e36cf1060, \< 6479b9f41583b013041943c4602e1ad61cec8148; \>= cafe563591446cf80bfbc2fe3bc72a2e36cf1060, \< 0c31344e22dd8d6b1394c6e4c41d639015bdc671; \>= cafe563591446cf80bfbc2fe3bc72a2e36cf1060, \< 3a861560ccb35f2a4f0a4b8207fa7c2a35fc7f31; Linux 3.10.

### Is there a fix for CVE-2024-39482?

Yes. Fixed in Linux 2c3d7b03b658dc8bfa6112b194b67b92a87e081b, Linux 5a1922adc5798b7ec894cd3f197afb6f9591b023, Linux 934e1e4331859183a861f396d7dfaf33cb5afb02, Linux 6479b9f41583b013041943c4602e1ad61cec8148, Linux 0c31344e22dd8d6b1394c6e4c41d639015bdc671, Linux 3a861560ccb35f2a4f0a4b8207fa7c2a35fc7f31. Upgrade Linux to 3a861560ccb35f2a4f0a4b8207fa7c2a35fc7f31 or later.

### How do I check if I'm affected by CVE-2024-39482?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

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

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-39482>

HTML: <https://flawdb.com/CVE-2024-39482> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-39482>
