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

- Severity: High 7.1 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/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.25%, higher than 17% of CVEs (2026-12-01)
- Published: 2024-04-04T08:20:22.374Z
- Modified: 2026-06-17T07:18:21.467Z
- Weaknesses: CWE-125
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

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

(As written by CVE List.)

## Affected

- Linux Linux: from e93c89c1aaaaaec3487c4c18dd02360371790722 before 11d7a2e429c02d51e2dc90713823ea8b8d3d3a84; from e93c89c1aaaaaec3487c4c18dd02360371790722 before c6652e20d7d783d060fe5f987eac7b5cabe31311; from e93c89c1aaaaaec3487c4c18dd02360371790722 before 2886fe308a83968dde252302884a1e63351cf16d; from e93c89c1aaaaaec3487c4c18dd02360371790722 before ab2d68655d0f04650bef09fee948ff80597c5fb9; from e93c89c1aaaaaec3487c4c18dd02360371790722 before f590040ce2b712177306b03c2a63b16f7d48d3c8; from e93c89c1aaaaaec3487c4c18dd02360371790722 before b1690ced4d2d8b28868811fb81cd33eee5aefee1; from e93c89c1aaaaaec3487c4c18dd02360371790722 before 343eecb4ff49a7b1cc1dfe86958a805cf2341cfb; from e93c89c1aaaaaec3487c4c18dd02360371790722 before 9845664b9ee47ce7ee7ea93caf47d39a9d4552c4; 3.8 (not affected: before 3.8; from 4.19.309 up to 4.19.*; from 5.4.271 up to 5.4.*; from 5.10.212 up to 5.10.*; from 5.15.151 up to 5.15.*; from 6.1.81 up to 6.1.*; from 6.6.21 up to 6.6.*; from 6.7.9 up to 6.7.*; from 6.8 up to *)
- linux linux_kernel: before 4.19.309; from 4.20 before 5.4.271; from 5.5 before 5.10.212; from 5.11 before 5.15.151; from 5.16 before 6.1.81; from 6.2 before 6.6.21; from 6.7 before 6.7.9; 6.8

## References

- <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> (patch)

## Sources

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

---

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