CVE-2023-52854
Linux Kernel Padata Use-After-Free
Description
In the Linux kernel, the following vulnerability has been resolved: padata: Fix refcnt handling in padata_free_shell() In a high-load arm64 environment, the pcrypt_aead01 test in LTP can lead to system UAF (Use-After-Free) issues. Due to the lengthy analysis of the pcrypt_aead01 function call, I'll describe the problem scenario using a simplified model: Suppose there's a user of padata named `user_function` that adheres to the padata requirement of calling `padata_free_shell` after `serial()` has been invoked, as demonstrated in the following code: ```c struct request { struct padata_priv padata; struct completion *done; }; void parallel(struct padata_priv *padata) { do_something(); } void serial(struct padata_priv *padata) { struct request *request = container_of(padata, struct request, padata); complete(request->done); } void user_function() { DECLARE_COMPLETION(done) padata->parallel = parallel; padata->serial = serial; padata_do_parallel(); wait_for_completion(&done); padata_free_shell(); } ``` In the corresponding padata.c file, there's the following code: ```c static void padata_serial_worker(struct work_struct *serial_work) { ... cnt = 0; while (!list_empty(&local_list)) { ... padata->serial(padata); cnt++; } local_bh_enable(); if (refcount_sub_and_test(cnt, &pd->refcnt)) padata_free_pd(pd); } ``` Because of the high system load and the accumulation of unexecuted softirq at this moment, `local_bh_enable()` in padata takes longer to execute than usual. Subsequently, when accessing `pd->refcnt`, `pd` has already been released by `padata_free_shell()`, resulting in a UAF issue with `pd->refcnt`. The fix is straightforward: add `refcount_dec_and_test` before calling `padata_free_pd` in `padata_free_shell`.
INFO
Published Date :
May 21, 2024, 4:15 p.m.
Last Modified :
Feb. 3, 2025, 4:13 p.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-2023-52854
.
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-2023-52854
vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2023-52854
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.
-
Initial Analysis by [email protected]
Feb. 03, 2025
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 Added CWE NIST CWE-416 Added CPE Configuration OR *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 3.16.84 up to (excluding) 3.17 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 4.4.215 up to (excluding) 4.5 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 4.9.215 up to (excluding) 4.10 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 4.14.172 up to (excluding) 4.15 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 4.19.103 up to (excluding) 4.20 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.4.19 up to (excluding) 5.5 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.5.3 up to (excluding) 5.10.201 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.11 up to (excluding) 5.15.139 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.16 up to (excluding) 6.1.63 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.2 up to (excluding) 6.5.12 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.6 up to (excluding) 6.6.2 Changed Reference Type https://git.kernel.org/stable/c/0dd34a7ad395dbcf6ae60e48e9786050e25b9bc5 No Types Assigned https://git.kernel.org/stable/c/0dd34a7ad395dbcf6ae60e48e9786050e25b9bc5 Patch Changed Reference Type https://git.kernel.org/stable/c/0dd34a7ad395dbcf6ae60e48e9786050e25b9bc5 No Types Assigned https://git.kernel.org/stable/c/0dd34a7ad395dbcf6ae60e48e9786050e25b9bc5 Patch Changed Reference Type https://git.kernel.org/stable/c/1734a79e951914f1db2c65e635012a35db1c674b No Types Assigned https://git.kernel.org/stable/c/1734a79e951914f1db2c65e635012a35db1c674b Patch Changed Reference Type https://git.kernel.org/stable/c/1734a79e951914f1db2c65e635012a35db1c674b No Types Assigned https://git.kernel.org/stable/c/1734a79e951914f1db2c65e635012a35db1c674b Patch Changed Reference Type https://git.kernel.org/stable/c/1e901bcb8af19416b65f5063a4af7996e5a51d7f No Types Assigned https://git.kernel.org/stable/c/1e901bcb8af19416b65f5063a4af7996e5a51d7f Patch Changed Reference Type https://git.kernel.org/stable/c/1e901bcb8af19416b65f5063a4af7996e5a51d7f No Types Assigned https://git.kernel.org/stable/c/1e901bcb8af19416b65f5063a4af7996e5a51d7f Patch Changed Reference Type https://git.kernel.org/stable/c/41aad9d6953984d134fc50f631f24ef476875d4d No Types Assigned https://git.kernel.org/stable/c/41aad9d6953984d134fc50f631f24ef476875d4d Patch Changed Reference Type https://git.kernel.org/stable/c/41aad9d6953984d134fc50f631f24ef476875d4d No Types Assigned https://git.kernel.org/stable/c/41aad9d6953984d134fc50f631f24ef476875d4d Patch Changed Reference Type https://git.kernel.org/stable/c/7ddc21e317b360c3444de3023bcc83b85fabae2f No Types Assigned https://git.kernel.org/stable/c/7ddc21e317b360c3444de3023bcc83b85fabae2f Patch Changed Reference Type https://git.kernel.org/stable/c/7ddc21e317b360c3444de3023bcc83b85fabae2f No Types Assigned https://git.kernel.org/stable/c/7ddc21e317b360c3444de3023bcc83b85fabae2f Patch Changed Reference Type https://git.kernel.org/stable/c/c7c26d0ef5d20f00dbb2ae3befcabbe0efa77275 No Types Assigned https://git.kernel.org/stable/c/c7c26d0ef5d20f00dbb2ae3befcabbe0efa77275 Patch Changed Reference Type https://git.kernel.org/stable/c/c7c26d0ef5d20f00dbb2ae3befcabbe0efa77275 No Types Assigned https://git.kernel.org/stable/c/c7c26d0ef5d20f00dbb2ae3befcabbe0efa77275 Patch -
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/0dd34a7ad395dbcf6ae60e48e9786050e25b9bc5 Added Reference https://git.kernel.org/stable/c/1734a79e951914f1db2c65e635012a35db1c674b Added Reference https://git.kernel.org/stable/c/1e901bcb8af19416b65f5063a4af7996e5a51d7f Added Reference https://git.kernel.org/stable/c/41aad9d6953984d134fc50f631f24ef476875d4d Added Reference https://git.kernel.org/stable/c/7ddc21e317b360c3444de3023bcc83b85fabae2f Added Reference https://git.kernel.org/stable/c/c7c26d0ef5d20f00dbb2ae3befcabbe0efa77275 -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
May. 29, 2024
Action Type Old Value New Value -
CVE Received by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
May. 21, 2024
Action Type Old Value New Value Added Description In the Linux kernel, the following vulnerability has been resolved: padata: Fix refcnt handling in padata_free_shell() In a high-load arm64 environment, the pcrypt_aead01 test in LTP can lead to system UAF (Use-After-Free) issues. Due to the lengthy analysis of the pcrypt_aead01 function call, I'll describe the problem scenario using a simplified model: Suppose there's a user of padata named `user_function` that adheres to the padata requirement of calling `padata_free_shell` after `serial()` has been invoked, as demonstrated in the following code: ```c struct request { struct padata_priv padata; struct completion *done; }; void parallel(struct padata_priv *padata) { do_something(); } void serial(struct padata_priv *padata) { struct request *request = container_of(padata, struct request, padata); complete(request->done); } void user_function() { DECLARE_COMPLETION(done) padata->parallel = parallel; padata->serial = serial; padata_do_parallel(); wait_for_completion(&done); padata_free_shell(); } ``` In the corresponding padata.c file, there's the following code: ```c static void padata_serial_worker(struct work_struct *serial_work) { ... cnt = 0; while (!list_empty(&local_list)) { ... padata->serial(padata); cnt++; } local_bh_enable(); if (refcount_sub_and_test(cnt, &pd->refcnt)) padata_free_pd(pd); } ``` Because of the high system load and the accumulation of unexecuted softirq at this moment, `local_bh_enable()` in padata takes longer to execute than usual. Subsequently, when accessing `pd->refcnt`, `pd` has already been released by `padata_free_shell()`, resulting in a UAF issue with `pd->refcnt`. The fix is straightforward: add `refcount_dec_and_test` before calling `padata_free_pd` in `padata_free_shell`. Added Reference kernel.org https://git.kernel.org/stable/c/41aad9d6953984d134fc50f631f24ef476875d4d [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/0dd34a7ad395dbcf6ae60e48e9786050e25b9bc5 [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/c7c26d0ef5d20f00dbb2ae3befcabbe0efa77275 [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/1e901bcb8af19416b65f5063a4af7996e5a51d7f [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/1734a79e951914f1db2c65e635012a35db1c674b [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/7ddc21e317b360c3444de3023bcc83b85fabae2f [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-2023-52854
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-2023-52854
weaknesses.