CVE-2024-41012
Linux Filelock Use-After-Free.Buffer Overflow
Description
In the Linux kernel, the following vulnerability has been resolved: filelock: Remove locks reliably when fcntl/close race is detected When fcntl_setlk() races with close(), it removes the created lock with do_lock_file_wait(). However, LSMs can allow the first do_lock_file_wait() that created the lock while denying the second do_lock_file_wait() that tries to remove the lock. Separately, posix_lock_file() could also fail to remove a lock due to GFP_KERNEL allocation failure (when splitting a range in the middle). After the bug has been triggered, use-after-free reads will occur in lock_get_status() when userspace reads /proc/locks. This can likely be used to read arbitrary kernel memory, but can't corrupt kernel memory. Fix it by calling locks_remove_posix() instead, which is designed to reliably get rid of POSIX locks associated with the given file and files_struct and is also used by filp_flush().
INFO
Published Date :
July 23, 2024, 8:15 a.m.
Last Modified :
Nov. 21, 2024, 9:32 a.m.
Source :
416baaa9-dc9f-4396-8d5f-8c081fb06d67
Remotely Exploitable :
No
Impact Score :
5.2
Exploitability Score :
1.0
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-41012
.
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-41012
vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2024-41012
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/3cad1bc010416c6dd780643476bc59ed742436b9 Added Reference https://git.kernel.org/stable/c/52c87ab18c76c14d7209646ccb3283b3f5d87b22 Added Reference https://git.kernel.org/stable/c/5661b9c7ec189406c2dde00837aaa4672efb6240 Added Reference https://git.kernel.org/stable/c/5f5d0799eb0a01d550c21b7894e26b2d9db55763 Added Reference https://git.kernel.org/stable/c/b6d223942c34057fdfd8f149e763fa823731b224 Added Reference https://git.kernel.org/stable/c/d30ff33040834c3b9eee29740acd92f9c7ba2250 Added Reference https://git.kernel.org/stable/c/dc2ce1dfceaa0767211a9d963ddb029ab21c4235 Added Reference https://git.kernel.org/stable/c/ef8fc41cd6f95f9a4a3470f085aecf350569a0b3 -
Initial Analysis by [email protected]
Sep. 12, 2024
Action Type Old Value New Value Added CVSS V3.1 NIST AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:H Changed Reference Type https://git.kernel.org/stable/c/3cad1bc010416c6dd780643476bc59ed742436b9 No Types Assigned https://git.kernel.org/stable/c/3cad1bc010416c6dd780643476bc59ed742436b9 Patch Changed Reference Type https://git.kernel.org/stable/c/52c87ab18c76c14d7209646ccb3283b3f5d87b22 No Types Assigned https://git.kernel.org/stable/c/52c87ab18c76c14d7209646ccb3283b3f5d87b22 Patch Changed Reference Type https://git.kernel.org/stable/c/5661b9c7ec189406c2dde00837aaa4672efb6240 No Types Assigned https://git.kernel.org/stable/c/5661b9c7ec189406c2dde00837aaa4672efb6240 Patch Changed Reference Type https://git.kernel.org/stable/c/5f5d0799eb0a01d550c21b7894e26b2d9db55763 No Types Assigned https://git.kernel.org/stable/c/5f5d0799eb0a01d550c21b7894e26b2d9db55763 Patch Changed Reference Type https://git.kernel.org/stable/c/b6d223942c34057fdfd8f149e763fa823731b224 No Types Assigned https://git.kernel.org/stable/c/b6d223942c34057fdfd8f149e763fa823731b224 Patch Changed Reference Type https://git.kernel.org/stable/c/d30ff33040834c3b9eee29740acd92f9c7ba2250 No Types Assigned https://git.kernel.org/stable/c/d30ff33040834c3b9eee29740acd92f9c7ba2250 Patch Changed Reference Type https://git.kernel.org/stable/c/dc2ce1dfceaa0767211a9d963ddb029ab21c4235 No Types Assigned https://git.kernel.org/stable/c/dc2ce1dfceaa0767211a9d963ddb029ab21c4235 Patch Changed Reference Type https://git.kernel.org/stable/c/ef8fc41cd6f95f9a4a3470f085aecf350569a0b3 No Types Assigned https://git.kernel.org/stable/c/ef8fc41cd6f95f9a4a3470f085aecf350569a0b3 Patch Added CWE NIST CWE-416 Added CPE Configuration OR *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 2.6.13 up to (excluding) 4.19.319 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 4.20 up to (excluding) 5.4.281 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.5 up to (excluding) 5.10.223 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.11 up to (excluding) 5.15.164 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.16 up to (excluding) 6.1.101 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.2 up to (excluding) 6.6.42 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.7 up to (excluding) 6.9.9 *cpe:2.3:o:linux:linux_kernel:6.10:rc1:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:6.10:rc2:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:6.10:rc3:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:6.10:rc4:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:6.10:rc5:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:6.10:rc6:*:*:*:*:*:* -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Jul. 29, 2024
Action Type Old Value New Value Added Reference kernel.org https://git.kernel.org/stable/c/d30ff33040834c3b9eee29740acd92f9c7ba2250 [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/dc2ce1dfceaa0767211a9d963ddb029ab21c4235 [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/5661b9c7ec189406c2dde00837aaa4672efb6240 [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/52c87ab18c76c14d7209646ccb3283b3f5d87b22 [No types assigned] -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Jul. 25, 2024
Action Type Old Value New Value Added Reference kernel.org https://git.kernel.org/stable/c/ef8fc41cd6f95f9a4a3470f085aecf350569a0b3 [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/5f5d0799eb0a01d550c21b7894e26b2d9db55763 [No types assigned] -
CVE Received by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Jul. 23, 2024
Action Type Old Value New Value Added Description In the Linux kernel, the following vulnerability has been resolved: filelock: Remove locks reliably when fcntl/close race is detected When fcntl_setlk() races with close(), it removes the created lock with do_lock_file_wait(). However, LSMs can allow the first do_lock_file_wait() that created the lock while denying the second do_lock_file_wait() that tries to remove the lock. Separately, posix_lock_file() could also fail to remove a lock due to GFP_KERNEL allocation failure (when splitting a range in the middle). After the bug has been triggered, use-after-free reads will occur in lock_get_status() when userspace reads /proc/locks. This can likely be used to read arbitrary kernel memory, but can't corrupt kernel memory. Fix it by calling locks_remove_posix() instead, which is designed to reliably get rid of POSIX locks associated with the given file and files_struct and is also used by filp_flush(). Added Reference kernel.org https://git.kernel.org/stable/c/b6d223942c34057fdfd8f149e763fa823731b224 [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/3cad1bc010416c6dd780643476bc59ed742436b9 [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-41012
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-41012
weaknesses.