CVE-2024-39496
Btrfs Use-After-Free Vulnerability
Description
In the Linux kernel, the following vulnerability has been resolved: btrfs: zoned: fix use-after-free due to race with dev replace While loading a zone's info during creation of a block group, we can race with a device replace operation and then trigger a use-after-free on the device that was just replaced (source device of the replace operation). This happens because at btrfs_load_zone_info() we extract a device from the chunk map into a local variable and then use the device while not under the protection of the device replace rwsem. So if there's a device replace operation happening when we extract the device and that device is the source of the replace operation, we will trigger a use-after-free if before we finish using the device the replace operation finishes and frees the device. Fix this by enlarging the critical section under the protection of the device replace rwsem so that all uses of the device are done inside the critical section.
INFO
Published Date :
July 12, 2024, 1:15 p.m.
Last Modified :
Nov. 21, 2024, 9:27 a.m.
Source :
416baaa9-dc9f-4396-8d5f-8c081fb06d67
Remotely Exploitable :
No
Impact Score :
5.9
Exploitability Score :
1.8
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2024-39496
.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2024-39496
vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2024-39496
vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Modified by af854a3a-2127-422b-91ae-364da2661108
Nov. 21, 2024
Action Type Old Value New Value Added Reference https://git.kernel.org/stable/c/0090d6e1b210551e63cf43958dc7a1ec942cdde9 Added Reference https://git.kernel.org/stable/c/092571ef9a812566c8f2c9038d9c2a64c49788d6 Added Reference https://git.kernel.org/stable/c/17765964703b88d8befd899f8501150bb7e07e43 Added Reference https://git.kernel.org/stable/c/a0cc006f4214b87e70983c692e05bb36c59b5752 -
Initial Analysis by [email protected]
Jul. 24, 2024
Action Type Old Value New Value Added CVSS V3.1 NIST AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H Changed Reference Type https://git.kernel.org/stable/c/0090d6e1b210551e63cf43958dc7a1ec942cdde9 No Types Assigned https://git.kernel.org/stable/c/0090d6e1b210551e63cf43958dc7a1ec942cdde9 Patch Changed Reference Type https://git.kernel.org/stable/c/092571ef9a812566c8f2c9038d9c2a64c49788d6 No Types Assigned https://git.kernel.org/stable/c/092571ef9a812566c8f2c9038d9c2a64c49788d6 Patch Changed Reference Type https://git.kernel.org/stable/c/17765964703b88d8befd899f8501150bb7e07e43 No Types Assigned https://git.kernel.org/stable/c/17765964703b88d8befd899f8501150bb7e07e43 Patch Changed Reference Type https://git.kernel.org/stable/c/a0cc006f4214b87e70983c692e05bb36c59b5752 No Types Assigned https://git.kernel.org/stable/c/a0cc006f4214b87e70983c692e05bb36c59b5752 Patch Added CWE NIST CWE-416 Added CPE Configuration OR *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions up to (excluding) 6.1.95 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.2 up to (excluding) 6.6.35 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.7 up to (excluding) 6.9.6 -
CVE Received by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Jul. 12, 2024
Action Type Old Value New Value Added Description In the Linux kernel, the following vulnerability has been resolved: btrfs: zoned: fix use-after-free due to race with dev replace While loading a zone's info during creation of a block group, we can race with a device replace operation and then trigger a use-after-free on the device that was just replaced (source device of the replace operation). This happens because at btrfs_load_zone_info() we extract a device from the chunk map into a local variable and then use the device while not under the protection of the device replace rwsem. So if there's a device replace operation happening when we extract the device and that device is the source of the replace operation, we will trigger a use-after-free if before we finish using the device the replace operation finishes and frees the device. Fix this by enlarging the critical section under the protection of the device replace rwsem so that all uses of the device are done inside the critical section. Added Reference kernel.org https://git.kernel.org/stable/c/17765964703b88d8befd899f8501150bb7e07e43 [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/092571ef9a812566c8f2c9038d9c2a64c49788d6 [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/a0cc006f4214b87e70983c692e05bb36c59b5752 [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/0090d6e1b210551e63cf43958dc7a1ec942cdde9 [No types assigned]
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2024-39496
is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2024-39496
weaknesses.