CVE-2025-21679 btrfs: add the missing error handling inside get_canonical_dev_path
A missing error check in the Linux kernel's btrfs filesystem can cause an invalid memory access, leading to a system crash.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2025-21679?
CVE-2025-21679 is a medium-severity vulnerability in Linux kernel, published on 31 Jan 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Official 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().
Which versions are affected by CVE-2025-21679?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2025-21679?
Apply the vendor's patch.
Is CVE-2025-21679 being exploited?
There is no known exploitation of CVE-2025-21679 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as BELL-CVE-2025-21679, DEBIAN-CVE-2025-21679, GHSA-vh4g-mh2m-pgg3, UBUNTU-CVE-2025-21679.