CVE-2022-49167
published high CVSS 3.1 · 7.8btrfs: do not double complete bio on errors during compressed reads
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linux86ccbb4d2a2af4109430df518c995a4f7d14dfd2 to < 4a4ceb2b990771c374d85d496a1a45255dde48e3 · 86ccbb4d2a2af4109430df518c995a4f7d14dfd2 to < 987b5df1d10355d377315a26e7fb6c72ded83c9f · 86ccbb4d2a2af4109430df518c995a4f7d14dfd2 to < f9f15de85d74e7eef021af059ca53a15f041cdd8 · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux5.16 (affected) · 0 to < 5.16 (unaffected · semver) · 5.16.19 through 5.16.* (unaffected · semver) · 5.17.2 through 5.17.* (unaffected · semver) · 5.18 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
Description
In the Linux kernel, the following vulnerability has been resolved: btrfs: do not double complete bio on errors during compressed reads I hit some weird panics while fixing up the error handling from btrfs_lookup_bio_sums(). Turns out the compression path will complete the bio we use if we set up any of the compression bios and then return an error, and then btrfs_submit_data_bio() will also call bio_endio() on the bio. Fix this by making btrfs_submit_compressed_read() responsible for calling bio_endio() on the bio if there are any errors. Currently it was only doing it if we created the compression bios, otherwise it was depending on btrfs_submit_data_bio() to do the right thing. This creates the above problem, so fix up btrfs_submit_compressed_read() to always call bio_endio() in case of an error, and then simply return from btrfs_submit_data_bio() if we had to call btrfs_submit_compressed_read().
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.8 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Scenarios
- en: AV:L - The bug is in btrfs compressed buffered-read submission (read → extent_io → submit_one_bio → btrfs_submit_data_bio → btrfs_submit_compressed_read), reachable only via local VFS reads of compressed extents on a mounted btrfs filesystem, not via network protocol handlers. AC:L - An attacker who can read compressed files can drive the finish_cb error path (e.g., by inducing ENOMEM in btrfs_lookup_bio_sums/alloc_compressed_bio after pages are allocated); no victim-controlled race or rare non-default config is required. PR:L - An unprivileged local user can create compressed files (mount compress= or chattr +c) and read them on an already-mounted btrfs volume; no real root or init-namespace admin capability is required. UI:N - Exploitation needs no separate victim action once btrfs is mounted; the attacker triggers the path by reading their own compressed files (and optionally stressing memory). S:U - Impact stays within the local kernel/OS security authority (standard kernel memory corruption / DoS); there is no VM escape, IOMMU bypass, or other cross-boundary effect. C:H - Double bio_endio after end_bio_extent_readpage's bio_put is a use-after-free of the bio (bioset object), which per UAF guidance enables reclaim and arbitrary read primitives. I:H - The same bio UAF/double-free, plus re-entry into page unlock/extent-release paths on already-completed state, is memory corruption that can be leveraged for write primitives and control-flow hijacking. A:H - The author observed kernel panics from the double completion; UAF/double bio_put and double page unlock reliably cause oops/panic or equivalent denial of service.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | 86ccbb4d2a2af4109430df518c995a4f7d14dfd2 to < 4a4ceb2b990771c374d85d496a1a45255dde48e3 (affected · git)86ccbb4d2a2af4109430df518c995a4f7d14dfd2 to < 987b5df1d10355d377315a26e7fb6c72ded83c9f (affected · git)86ccbb4d2a2af4109430df518c995a4f7d14dfd2 to < f9f15de85d74e7eef021af059ca53a15f041cdd8 (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 5.16 (affected)0 to < 5.16 (unaffected · semver)5.16.19 through 5.16.* (unaffected · semver)5.17.2 through 5.17.* (unaffected · semver)5.18 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
3Provider assertions
1Linux · cna
btrfs: do not double complete bio on errors during compressed reads
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 031f8ae1defef5a7ff762f4e6fb4e431822ef630dae1d578650daa666b1cdc84
- Ingested
- 23 Sep 2026, 08:04:03 UTC
- Source record
- Official CVE record