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().
| Product | Vendor Advisory | Solution File | Added | Published |
|---|---|---|---|---|
| Debian | — | Upgrade linux | May 15, 2025 | Nov 9, 2024 |
| Redhat_linux | — | No solution exists | Jul 9, 2025 | Nov 9, 2024 |
| Ubuntu | — | Upgrade linux-image-generic-64k-hwe-24.04Upgrade linux-image-awsUpgrade linux-image-raspiUpgrade linux-image-lowlatencyUpgrade linux-image-6.11.0-1011-oracle-64kUpgrade linux-image-nvidia-tegra-6.8Upgrade linux-image-6.11.0-1008-raspiUpgrade linux-image-azure-fdeUpgrade linux-image-nvidia-tegra-rtUpgrade linux-image-6.11.0-1009-azure-fdeUpgrade linux-image-azureUpgrade linux-image-realtime-hwe-24.04Upgrade linux-image-6.11.0-1009-awsUpgrade linux-image-6.11.0-1009-azureUpgrade linux-image-6.11.0-1015-oemUpgrade linux-image-lowlatency-64kUpgrade linux-image-6.11.0-1010-lowlatencyUpgrade linux-image-6.8.0-1035-nvidia-tegraUpgrade linux-image-oracle-64kUpgrade linux-image-oem-24.04bUpgrade linux-image-6.8.0-1035-nvidia-tegra-rtUpgrade linux-image-6.11.0-1011-oracleUpgrade linux-image-generic-64kUpgrade linux-image-oem-24.04aUpgrade linux-image-genericUpgrade linux-image-nvidia-tegra-rt-6.8Upgrade linux-image-realtimeUpgrade linux-image-oracleUpgrade linux-image-gcpUpgrade linux-image-nvidia-tegraUpgrade linux-image-6.11.0-1009-gcpUpgrade linux-image-6.11.0-18-genericUpgrade linux-image-oem-24.04Upgrade linux-image-virtual-hwe-24.04Upgrade linux-image-generic-hwe-24.04Upgrade linux-image-6.11.0-1005-realtimeUpgrade linux-image-6.11.0-1010-lowlatency-64kUpgrade linux-image-6.11.0-18-generic-64kUpgrade linux-image-virtual | Feb 20, 2025 | Nov 9, 2024 |
With curated Threat Intelligence, you can see which vulnerabilities truly put you at risk, prioritize what matters most, and act before attackers do.
Explore Intelligence Hub