# CVE-2024-41067: btrfs: scrub: handle RST lookup error correctly

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.27% (percentile 12, 2026-11-28)
- **Published:** 2024-07-29T14:57:28.543Z
- **Modified:** 2026-06-17T07:47:12.520Z

## Who should check

- Anyone running Linux \>= 9acaa64187f9b4cbb75622883c96ea1a893d5431, \< 17d1fd302a53d7e456a7412da74be74a0cf63a72; \>= 9acaa64187f9b4cbb75622883c96ea1a893d5431, \< 2c49908634a2b97b1c3abe0589be2739ac5e7fd5
- Anyone running Linux 6.7

## Description

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.

## Affected and fixed versions

- Linux: \>= 9acaa64187f9b4cbb75622883c96ea1a893d5431, \< 17d1fd302a53d7e456a7412da74be74a0cf63a72; \>= 9acaa64187f9b4cbb75622883c96ea1a893d5431, \< 2c49908634a2b97b1c3abe0589be2739ac5e7fd5 (cvelist)
- Linux: 6.7 (cvelist)

## Mitigation

- Upgrade Linux to 2c49908634a2b97b1c3abe0589be2739ac5e7fd5 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-41067. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-41067.md
Affected: Linux >= 9acaa64187f9b4cbb75622883c96ea1a893d5431, < 17d1fd302a53d7e456a7412da74be74a0cf63a72; >= 9acaa64187f9b4cbb75622883c96ea1a893d5431, < 2c49908634a2b97b1c3abe0589be2739ac5e7fd5; Linux 6.7
Fixed in: Linux 17d1fd302a53d7e456a7412da74be74a0cf63a72, Linux 2c49908634a2b97b1c3abe0589be2739ac5e7fd5

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-41067 being exploited?

There is no confirmed exploitation: CVE-2024-41067 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.27% chance of exploitation in the next 30 days (as of 2026-11-28).

### How serious is CVE-2024-41067?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-41067?

Linux \>= 9acaa64187f9b4cbb75622883c96ea1a893d5431, \< 17d1fd302a53d7e456a7412da74be74a0cf63a72; \>= 9acaa64187f9b4cbb75622883c96ea1a893d5431, \< 2c49908634a2b97b1c3abe0589be2739ac5e7fd5; Linux 6.7.

### Is there a fix for CVE-2024-41067?

Yes. Fixed in Linux 17d1fd302a53d7e456a7412da74be74a0cf63a72, Linux 2c49908634a2b97b1c3abe0589be2739ac5e7fd5. Upgrade Linux to 2c49908634a2b97b1c3abe0589be2739ac5e7fd5 or later.

### How do I check if I'm affected by CVE-2024-41067?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/17d1fd302a53d7e456a7412da74be74a0cf63a72>
- patch: <https://git.kernel.org/stable/c/2c49908634a2b97b1c3abe0589be2739ac5e7fd5>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-41067>

HTML: <https://flawdb.com/CVE-2024-41067> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-41067>
