Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2024-50217 — kernel

🟠 CVSS 7.8 — High ✅ No Known Exploit NVD
7.8
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

btrfs: fix use-after-free of block device file in __btrfs_free_extra_devids()

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

btrfs: fix use-after-free of block device file in __btrfs_free_extra_devids()

Mounting btrfs from two images (which have the same one fsid and two

different dev_uuids) in certain executing order may trigger an UAF for

variable 'device->bdev_file' in __btrfs_free_extra_devids(). And

following are the details:

1. Attach image_1 to loop0, attach image_2 to loop1, and scan btrfs

devices by ioctl(BTRFS_IOC_SCAN_DEV):

/ btrfs_device_1 → loop0

fs_device

\ btrfs_device_2 → loop1

2. mount /dev/loop0 /mnt

btrfs_open_devices

btrfs_device_1->bdev_file = btrfs_get_bdev_and_sb(loop0)

btrfs_device_2->bdev_file = btrfs_get_bdev_and_sb(loop1)

btrfs_fill_super

open_ctree

fail: btrfs_close_devices // -ENOMEM

btrfs_close_bdev(btrfs_device_1)

fput(btrfs_device_1->bdev_file)

// btrfs_device_1->bdev_file is freed

btrfs_close_bdev(btrfs_device_2)

fput(btrfs_device_2->bdev_file)

3. mount /dev/loop1 /mnt

btrfs_open_devices

btrfs_get_bdev_and_sb(&bdev_file)

// EIO, btrfs_device_1->bdev_file is not assigned,

// which points to a freed memory area

btrfs_device_2->bdev_file = btrfs_get_bdev_and_sb(loop1)

btrfs_fill_super

open_ctree

btrfs_free_extra_devids

if (btrfs_device_1->bdev_file)

fput(btrfs_device_1->bdev_file) // UAF !

Fix it by setting 'device->bdev_file' as 'NULL' after closing the

btrfs_device in btrfs_close_one_device().

How this vulnerability can be exploited

This issue can be reached with local access to the system, attack complexity is low, an attacker needs no privileges on the target. A user must be tricked into taking some action. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality high, integrity high, availability high.

Affected software

CVE-2024-50217 is recorded against 2 packages.

  • kernel (from 4.8.0 up to 6.11.7)
  • linux-kernel

Timeline and source

Published on 9 November 2024 and last revised on 12 August 2026. No public exploit is currently recorded for this entry. A vendor advisory or fix has been published. Record sourced from NVD.

References

www.openwall.com (Web)
www.openwall.com (Web)
www.openwall.com (Web)
git.kernel.org (Web)
git.kernel.org (Web)
github.com (Advisory)
nvd.nist.gov (Advisory)
git.kernel.org (Package)

CVE-2024-50217 on other distributions

Each distribution ships its own build and its own fixed version. Pick the one you run:

Details

Severity High
CVSS Score 7.8
CVSS Vector CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
CWE N/A
Public Exploit ✅ No
Source NVD
Published 2024-11-09
Updated 2026-08-20
Modified 2026-08-12

Affected Packages

Software From version Fixed in
kernel 4.8.0 6.11.7
linux-kernel

Similar Threats

Site Security Check

Is kernel part of your stack?

CVE-2024-50217 is rated CVSS 7.8 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.

Scan My Site Free →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.