Bug 2347664 (CVE-2022-49167) - CVE-2022-49167 kernel: btrfs: do not double complete bio on errors during compressed reads
Summary: CVE-2022-49167 kernel: btrfs: do not double complete bio on errors during com...
Keywords:
Status: NEW
Alias: CVE-2022-49167
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-02-26 03:02 UTC by OSIDB Bzimport
Modified: 2025-02-27 09:35 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2025-02-26 03:02:25 UTC
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().

Comment 1 Mauro Matteo Cascella 2025-02-26 11:10:30 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2025022612-CVE-2022-49167-d747@gregkh/T


Note You need to log in before you can comment on or make changes to this bug.