CVE-2024-50217
kernel: btrfs: fix use-after-free of block device file in __btrfs_free_extra_devids()
Severity
ModerateRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · November 9, 2024
Updated · September 14, 2026
Description
A flaw was found in the Linux kernel's btrfs filesystem. A local attacker could exploit a use-after-free (UAF) vulnerability by mounting two btrfs images with identical filesystem IDs but different device universally unique identifiers (UUIDs) in a specific sequence. This could lead to memory corruption, potentially allowing for privilege escalation or causing a system crash (denial of service).
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
To mitigate this issue, if the Btrfs filesystem is not in use, the btrfs kernel module can be blacklisted to prevent it from being loaded. This can be achieved by creating a modprobe configuration file.
Create /etc/modprobe.d/blacklist-btrfs.conf with the following content:
blacklist btrfs
After creating the file, regenerate the initramfs and reboot the system for the changes to take effect.
dracut -f -v
reboot
Warning: Blacklisting the btrfs module will prevent the system from mounting or using any Btrfs filesystems. Ensure that no critical system components or data rely on Btrfs before applying this mitigation.
CVSS / CWE
CVSS 3.1 · 7.8CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CWE-416 · Use After Free