CVE-2023-52854

padata: Fix refcnt handling in padata_free_shell()

HIGH
7.8
CVSS Score
Published: May 21, 2024 at 03:31 PM UTC
Updated: June 17, 2026 at 06:43 AM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7.8
Exploit prediction
EPSS 0.2%
SSVC
No known exploit

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`.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v ≥ 3.16.84v ≥ 4.14.172v ≥ 4.19.103v ≥ 4.4.215v ≥ 4.9.215v ≥ 5.4.19v ≥ 5.5.33.16.84 ≤ v < 3.174.14.172 ≤ v < 4.154.19.103 ≤ v < 4.204.4.215 ≤ v < 4.54.9.215 ≤ v < 4.105.11 ≤ v < 5.15.1395.16 ≤ v < 6.1.635.4.19 ≤ v < 5.55.5.3 ≤ v < 5.10.2015.5.3 ≤ v < 5.65.6 ≤ v < 5.10.2015.6 ≤ v < 5.15.1395.6 ≤ v < 6.1.635.6 ≤ v < 6.5.125.6 ≤ v < 6.6.25.6 ≤ v < 6.76.2 ≤ v < 6.5.126.6 ≤ v < 6.6.213721e447acc2b82c19cf72e9e6c4291c77693ed26daf8e6515c2dcd25d235468420b9f46e0acdac3.16.844.14.1724.19.1034.4.2154.9.2155.4.195.5.35.65fefc9b3e3584a1ce98da27c38e1b8dda1939d747928d9bfc81640bab36f5190e8725894d93b6597a2ccb65f90168edc2348495bb56093c466ffa39928cf3d733c4efc221e1a78b14cb2ee066627260c9da8ee1491719001a444f4af688b75e72b58418dc34710a7aba5207e7cb99d11588c04535b3c53d
Vendor states this is fixed in 0dd34a7ad395dbcf6ae60e48e9786050e25b9bc5 (fixed)
Vendor states this is fixed in 1734a79e951914f1db2c65e635012a35db1c674b (fixed)
Vendor states this is fixed in 1e901bcb8af19416b65f5063a4af7996e5a51d7f (fixed)
Vendor states this is fixed in 41aad9d6953984d134fc50f631f24ef476875d4d (fixed)
Vendor states this is fixed in 7ddc21e317b360c3444de3023bcc83b85fabae2f (fixed)
Vendor states this is fixed in c7c26d0ef5d20f00dbb2ae3befcabbe0efa77275 (fixed)
Affected range stops below 3.17, so it looks safe — our inference, not a vendor statement
Affected range stops below 4.10, so it looks safe — our inference, not a vendor statement
Affected range stops below 4.15, so it looks safe — our inference, not a vendor statement
Affected range stops below 4.20, so it looks safe — our inference, not a vendor statement
Affected range stops below 4.5, so it looks safe — our inference, not a vendor statement
Vendor states this is fixed in 5.10.201 (unaffected)
Vendor states this is fixed in 5.15.139 (unaffected)
Affected range stops below 5.5, so it looks safe — our inference, not a vendor statement
Vendor states this is fixed in 5.6 (unaffected)
Vendor states this is fixed in 6.1.63 (unaffected)
Vendor states this is fixed in 6.5.12 (unaffected)
Vendor states this is fixed in 6.6.2 (unaffected)
Vendor states this is fixed in 6.7 (unaffected)

References (6)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/0dd34a7ad395dbcf6ae60e48e9786050e25b9bc5
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/1734a79e951914f1db2c65e635012a35db1c674b
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/1e901bcb8af19416b65f5063a4af7996e5a51d7f
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/41aad9d6953984d134fc50f631f24ef476875d4d
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/7ddc21e317b360c3444de3023bcc83b85fabae2f
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/c7c26d0ef5d20f00dbb2ae3befcabbe0efa77275

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH
Vector?

Quick Info

StatusANALYZED
CWE
CWE-416

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card