In the Linux kernel, the following vulnerability has been resolved:
btrfs: scrub: handle RST lookup error correctly
[BUG] When running btrfs/060 with forced RST feature, it would crash the following ASSERT() inside scrub_read_endio():
ASSERT(sector_nr < stripe->nr_sectors);
Before that, we would have tree dump from btrfs_get_raid_extent_offset(), as we failed to find the RST entry for the range.
[CAUSE] Inside scrub_submit_extent_sector_read() every time we allocated a new bbio we immediately called btrfs_map_block() to make sure there was some RST range covering the scrub target.
But if btrfs_map_block() fails, we immediately call endio for the bbio, while the bbio is newly allocated, it's completely empty.
Then inside scrub_read_endio(), we go through the bvecs to find the sector number (as bi_sector is no longer reliable if the bio is submitted to lower layers).
And since the bio is empty, such bvecs iteration would not find any sector matching the sector, and return sector_nr == stripe->nr_sectors, triggering the ASSERT().
[FIX] Instead of calling btrfs_map_block() after allocating a new bbio, call btrfs_map_block() first.
Since our only objective of calling btrfs_map_block() is only to update stripe_len, there is really no need to do that after btrfs_alloc_bio().
This new timing would avoid the problem of handling empty bbio completely, and in fact fixes a possible race window for the old code, where if the submission thread is the only owner of the pending_io, the scrub would never finish (since we didn't decrease the pending_io counter).
Although the root cause of RST lookup failure still needs to be addressed.
CVSS Details
- CVSS 3.1 Base Score: 5.5
- CVSS 3.1 Vector: (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H)
Covered by Rapid7
| Product | Vendor Advisory | Solution File | Added | Published |
|---|---|---|---|---|
| Debian | — | Upgrade linuxNo solution exists | May 15, 2025 | Jul 29, 2024 |
| Redhat_linux | — | No solution exists | Jul 9, 2025 | Jul 29, 2024 |
| Ubuntu | — | Upgrade linux-image-lowlatency-hwe-22.04Upgrade linux-image-6.8.0-1013-gkeUpgrade linux-image-ibm-classicUpgrade linux-image-oem-22.04cUpgrade linux-image-virtual-hwe-22.04Upgrade linux-image-6.8.0-1017-nvidiaUpgrade linux-image-6.8.0-1015-oracleUpgrade linux-image-lowlatency-hwe-24.04Upgrade linux-image-gkeop-6.8Upgrade linux-image-gkeUpgrade linux-image-lowlatency-64k-hwe-22.04Upgrade linux-image-virtual-hwe-24.04Upgrade linux-image-nvidia-64k-hwe-22.04Upgrade linux-image-oem-22.04Upgrade linux-image-lowlatencyUpgrade linux-image-6.8.0-1016-gcpUpgrade linux-image-genericUpgrade linux-image-raspiUpgrade linux-image-ibmUpgrade linux-image-6.8.0-1002-gkeopUpgrade linux-image-nvidia-6.8Upgrade linux-image-lowlatency-64kUpgrade linux-image-generic-lpaeUpgrade linux-image-nvidiaUpgrade linux-image-oem-22.04aUpgrade linux-image-gkeopUpgrade linux-image-6.8.0-48-lowlatencyUpgrade linux-image-generic-64kUpgrade linux-image-oem-24.04Upgrade linux-image-azureUpgrade linux-image-6.8.0-48-generic-64kUpgrade linux-image-6.8.0-48-lowlatency-64kUpgrade linux-image-nvidia-64k-6.8Upgrade linux-image-6.8.0-1017-nvidia-lowlatency-64kUpgrade linux-image-generic-64k-hwe-22.04Upgrade linux-image-nvidia-lowlatencyUpgrade linux-image-oem-22.04dUpgrade linux-image-oracleUpgrade linux-image-6.8.0-1017-azure-fdeUpgrade linux-image-generic-hwe-22.04Upgrade linux-image-virtualUpgrade linux-image-generic-64k-hwe-24.04Upgrade linux-image-azure-fdeUpgrade linux-image-6.8.0-1017-gcpUpgrade linux-image-oracle-64kUpgrade linux-image-nvidia-64kUpgrade linux-image-nvidia-hwe-22.04Upgrade linux-image-6.8.0-1017-nvidia-64kUpgrade linux-image-6.8.0-1016-azure-fdeUpgrade linux-image-6.8.0-1016-oemUpgrade linux-image-6.8.0-1018-awsUpgrade linux-image-oem-22.04bUpgrade linux-image-6.8.0-1014-ibmUpgrade linux-image-6.8.0-1016-azureUpgrade linux-image-generic-hwe-24.04Upgrade linux-image-gcpUpgrade linux-image-6.8.0-1014-raspiUpgrade linux-image-6.8.0-1015-oracle-64kUpgrade linux-image-ibm-lts-24.04Upgrade linux-image-6.8.0-48-genericUpgrade linux-image-awsUpgrade linux-image-nvidia-lowlatency-64kUpgrade linux-image-6.8.0-1017-nvidia-lowlatencyUpgrade linux-image-oem-24.04aUpgrade linux-image-kvmUpgrade linux-image-6.8.0-1017-azureUpgrade linux-image-lowlatency-64k-hwe-24.04 | Nov 4, 2024 | Jul 29, 2024 |
Prioritise with Active Threat Intelligence
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