# CVE-2024-26791: btrfs: dev-replace: properly validate device names

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

- **Severity:** HIGH 7.1
- **CVSS:** 7.1 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: None; 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-28)
- **CWE:** CWE-125
- **Published:** 2024-04-04T08:20:22.374Z
- **Modified:** 2026-06-17T07:18:21.467Z

## Who should check

- Anyone running Linux \>= e93c89c1aaaaaec3487c4c18dd02360371790722, \< 11d7a2e429c02d51e2dc90713823ea8b8d3d3a84; \>= e93c89c1aaaaaec3487c4c18dd02360371790722, \< c6652e20d7d783d060fe5f987eac7b5cabe31311; \>= e93c89c1aaaaaec3487c4c18dd02360371790722, \< 2886fe308a83968dde252302884a1e63351cf16d; \>= e93c89c1aaaaaec3487c4c18dd02360371790722, \< ab2d68655d0f04650bef09fee948ff80597c5fb9; \>= e93c89c1aaaaaec3487c4c18dd02360371790722, \< f590040ce2b712177306b03c2a63b16f7d48d3c8; \>= e93c89c1aaaaaec3487c4c18dd02360371790722, \< b1690ced4d2d8b28868811fb81cd33eee5aefee1; \>= e93c89c1aaaaaec3487c4c18dd02360371790722, \< 343eecb4ff49a7b1cc1dfe86958a805cf2341cfb; \>= e93c89c1aaaaaec3487c4c18dd02360371790722, \< 9845664b9ee47ce7ee7ea93caf47d39a9d4552c4
- Anyone running Linux 3.8

## Description

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

btrfs: dev-replace: properly validate device names

There's a syzbot report that device name buffers passed to device
replace are not properly checked for string termination which could lead
to a read out of bounds in getname\_kernel().

Add a helper that validates both source and target device name buffers.
For devid as the source initialize the buffer to empty string in case
something tries to read it later.

This was originally analyzed and fixed in a different way by Edward Adam
Davis (see links).

## Affected and fixed versions

- Linux: \>= e93c89c1aaaaaec3487c4c18dd02360371790722, \< 11d7a2e429c02d51e2dc90713823ea8b8d3d3a84; \>= e93c89c1aaaaaec3487c4c18dd02360371790722, \< c6652e20d7d783d060fe5f987eac7b5cabe31311; \>= e93c89c1aaaaaec3487c4c18dd02360371790722, \< 2886fe308a83968dde252302884a1e63351cf16d; \>= e93c89c1aaaaaec3487c4c18dd02360371790722, \< ab2d68655d0f04650bef09fee948ff80597c5fb9; \>= e93c89c1aaaaaec3487c4c18dd02360371790722, \< f590040ce2b712177306b03c2a63b16f7d48d3c8; \>= e93c89c1aaaaaec3487c4c18dd02360371790722, \< b1690ced4d2d8b28868811fb81cd33eee5aefee1; \>= e93c89c1aaaaaec3487c4c18dd02360371790722, \< 343eecb4ff49a7b1cc1dfe86958a805cf2341cfb; \>= e93c89c1aaaaaec3487c4c18dd02360371790722, \< 9845664b9ee47ce7ee7ea93caf47d39a9d4552c4 (cvelist)
- Linux: 3.8 (cvelist)

## Mitigation

- Upgrade Linux to 9845664b9ee47ce7ee7ea93caf47d39a9d4552c4 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-26791. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-26791.md
Affected: Linux >= e93c89c1aaaaaec3487c4c18dd02360371790722, < 11d7a2e429c02d51e2dc90713823ea8b8d3d3a84; >= e93c89c1aaaaaec3487c4c18dd02360371790722, < c6652e20d7d783d060fe5f987eac7b5cabe31311; >= e93c89c1aaaaaec3487c4c18dd02360371790722, < 2886fe308a83968dde252302884a1e63351cf16d; >= e93c89c1aaaaaec3487c4c1…
Fixed in: Linux 11d7a2e429c02d51e2dc90713823ea8b8d3d3a84, Linux 2886fe308a83968dde252302884a1e63351cf16d, Linux 343eecb4ff49a7b1cc1dfe86958a805cf2341cfb, Linux 9845664b9ee47ce7ee7ea93caf47d39a9d4552c4

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-26791 being exploited?

There is no confirmed exploitation: CVE-2024-26791 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-28).

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

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

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

Linux \>= e93c89c1aaaaaec3487c4c18dd02360371790722, \< 11d7a2e429c02d51e2dc90713823ea8b8d3d3a84; \>= e93c89c1aaaaaec3487c4c18dd02360371790722, \< c6652e20d7d783d060fe5f987eac7b5cabe31311; \>= e93c89c1aaaaaec3487c4c18dd02360371790722, \< 2886fe308a83968dde252302884a1e63351cf16d; \>= e93c89c1aaaaaec3487c4c18dd02360371790722, \< ab2d68655d0f04650bef09fee948ff80597c5fb9; \>= e93c89c1aaaaaec3487c4c18dd02360371790722, \< f590040ce2b712177306b03c2a63b16f7d48d3c8; \>= e93c89c1aaaaaec3487c4c18dd02360371790722, \< b1690ced4d2d8b28868811fb81cd33eee5aefee1; \>= e93c89c1aaaaaec3487c4c18dd02360371790722, \< 343eecb4ff49a7b1cc1dfe86958a805cf2341cfb; \>= e93c89c1aaaaaec3487c4c18dd02360371790722, \< 9845664b9ee47ce7ee7ea93caf47d39a9d4552c4; Linux 3.8.

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

Yes. Fixed in Linux 11d7a2e429c02d51e2dc90713823ea8b8d3d3a84, Linux 2886fe308a83968dde252302884a1e63351cf16d, Linux 343eecb4ff49a7b1cc1dfe86958a805cf2341cfb, Linux 9845664b9ee47ce7ee7ea93caf47d39a9d4552c4. Upgrade Linux to 9845664b9ee47ce7ee7ea93caf47d39a9d4552c4 or later.

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

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/11d7a2e429c02d51e2dc90713823ea8b8d3d3a84>
- patch: <https://git.kernel.org/stable/c/c6652e20d7d783d060fe5f987eac7b5cabe31311>
- patch: <https://git.kernel.org/stable/c/2886fe308a83968dde252302884a1e63351cf16d>
- patch: <https://git.kernel.org/stable/c/ab2d68655d0f04650bef09fee948ff80597c5fb9>
- patch: <https://git.kernel.org/stable/c/f590040ce2b712177306b03c2a63b16f7d48d3c8>
- patch: <https://git.kernel.org/stable/c/b1690ced4d2d8b28868811fb81cd33eee5aefee1>
- patch: <https://git.kernel.org/stable/c/343eecb4ff49a7b1cc1dfe86958a805cf2341cfb>
- patch: <https://git.kernel.org/stable/c/9845664b9ee47ce7ee7ea93caf47d39a9d4552c4>
- patch: <https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html>
- patch: <https://lists.debian.org/debian-lts-announce/2024/06/msg00020.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-26791>

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