blob: a18c0c41158a529856875adda28e88f4767e6c14 [file] [log] [blame]
From bippy-5f407fcff5a0 Mon Sep 17 00:00:00 2001
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: <linux-cve-announce@vger.kernel.org>
Reply-to: <cve@kernel.org>, <linux-kernel@vger.kernel.org>
Subject: CVE-2024-42314: btrfs: fix extent map use-after-free when adding pages to compressed bio
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
btrfs: fix extent map use-after-free when adding pages to compressed bio
At add_ra_bio_pages() we are accessing the extent map to calculate
'add_size' after we dropped our reference on the extent map, resulting
in a use-after-free. Fix this by computing 'add_size' before dropping our
extent map reference.
The Linux kernel CVE team has assigned CVE-2024-42314 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.16 with commit 6a4049102055250256623ab1875fabd89004bff8 and fixed in 6.1.108 with commit c1cc3326e27b0bd7a2806b40bc48e49afaf951e7
Issue introduced in 5.16 with commit 6a4049102055250256623ab1875fabd89004bff8 and fixed in 6.6.44 with commit c205565e0f2f439f278a4a94ee97b67ef7b56ae8
Issue introduced in 5.16 with commit 6a4049102055250256623ab1875fabd89004bff8 and fixed in 6.10.3 with commit b7859ff398b6b656e1689daa860eb34837b4bb89
Issue introduced in 5.16 with commit 6a4049102055250256623ab1875fabd89004bff8 and fixed in 6.11 with commit 8e7860543a94784d744c7ce34b78a2e11beefa5c
Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to
older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2024-42314
will be updated if fixes are backported, please check that for the most
up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
fs/btrfs/compression.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes. Individual
changes are never tested alone, but rather are part of a larger kernel
release. Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all. If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
https://git.kernel.org/stable/c/c1cc3326e27b0bd7a2806b40bc48e49afaf951e7
https://git.kernel.org/stable/c/c205565e0f2f439f278a4a94ee97b67ef7b56ae8
https://git.kernel.org/stable/c/b7859ff398b6b656e1689daa860eb34837b4bb89
https://git.kernel.org/stable/c/8e7860543a94784d744c7ce34b78a2e11beefa5c