# CVE-2025-21679: btrfs: add the missing error handling inside get_canonical_dev_path

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/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.26%, higher than 11% of CVEs (2026-11-30)
- Published: 2025-01-31T11:25:40.171Z
- Modified: 2026-06-17T08:44:00.267Z
- Assigned by: Linux

## Description

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

btrfs: add the missing error handling inside get_canonical_dev_path

Inside function get_canonical_dev_path(), we call d_path() to get the
final device path.

But d_path() can return error, and in that case the next strscpy() call
will trigger an invalid memory access.

Add back the missing error handling for d_path().

(As written by CVE List.)

## Affected

- Linux Linux: from 5d261f60b5c82ba1e4b5555252e1c90c43d96015 before d0fb5741932b831eded49bfaaf33353e96200d6d; from 7e06de7c83a746e58d4701e013182af133395188 before fe4de594f7a2e9bc49407de60fbd20809fad4192; from 6.12.5 before 6.12.11
- linux linux_kernel: from 6.12.5 before 6.12.11; 6.13

## References

- <https://git.kernel.org/stable/c/d0fb5741932b831eded49bfaaf33353e96200d6d> (patch)
- <https://git.kernel.org/stable/c/fe4de594f7a2e9bc49407de60fbd20809fad4192> (patch)

## Sources

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

---

Page: https://cve.day/CVE-2025-21679 · Whole record: https://cve.day/CVE-2025-21679.json · Rebuilt by cve.day 2026-11-25T22:58:53.717Z
