# CVE-2023-52854: padata: Fix refcnt handling in padata\_free\_shell()

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.32% (percentile 17, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2024-05-21T15:31:49.235Z
- **Modified:** 2026-06-17T06:43:44.443Z

## Who should check

- Anyone running Linux \>= 07928d9bfc81640bab36f5190e8725894d93b659, \< 41aad9d6953984d134fc50f631f24ef476875d4d; \>= 07928d9bfc81640bab36f5190e8725894d93b659, \< 0dd34a7ad395dbcf6ae60e48e9786050e25b9bc5; \>= 07928d9bfc81640bab36f5190e8725894d93b659, \< c7c26d0ef5d20f00dbb2ae3befcabbe0efa77275; \>= 07928d9bfc81640bab36f5190e8725894d93b659, \< 1e901bcb8af19416b65f5063a4af7996e5a51d7f; \>= 07928d9bfc81640bab36f5190e8725894d93b659, \< 1734a79e951914f1db2c65e635012a35db1c674b; \>= 07928d9bfc81640bab36f5190e8725894d93b659, \< 7ddc21e317b360c3444de3023bcc83b85fabae2f; 13721e447acc2b82c19cf72e9e6c4291c77693ed; 7a2ccb65f90168edc2348495bb56093c466ffa39; 928cf3d733c4efc221e1a78b14cb2ee066627260; c9da8ee1491719001a444f4af688b75e72b58418; …
- Anyone running Linux 5.6

## 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 and fixed versions

- Linux: \>= 07928d9bfc81640bab36f5190e8725894d93b659, \< 41aad9d6953984d134fc50f631f24ef476875d4d; \>= 07928d9bfc81640bab36f5190e8725894d93b659, \< 0dd34a7ad395dbcf6ae60e48e9786050e25b9bc5; \>= 07928d9bfc81640bab36f5190e8725894d93b659, \< c7c26d0ef5d20f00dbb2ae3befcabbe0efa77275; \>= 07928d9bfc81640bab36f5190e8725894d93b659, \< 1e901bcb8af19416b65f5063a4af7996e5a51d7f; \>= 07928d9bfc81640bab36f5190e8725894d93b659, \< 1734a79e951914f1db2c65e635012a35db1c674b; \>= 07928d9bfc81640bab36f5190e8725894d93b659, \< 7ddc21e317b360c3444de3023bcc83b85fabae2f; 13721e447acc2b82c19cf72e9e6c4291c77693ed; 7a2ccb65f90168edc2348495bb56093c466ffa39; 928cf3d733c4efc221e1a78b14cb2ee066627260; c9da8ee1491719001a444f4af688b75e72b58418; … (cvelist)
- Linux: 5.6 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2023-52854. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-52854.md
Affected: Linux >= 07928d9bfc81640bab36f5190e8725894d93b659, < 41aad9d6953984d134fc50f631f24ef476875d4d; >= 07928d9bfc81640bab36f5190e8725894d93b659, < 0dd34a7ad395dbcf6ae60e48e9786050e25b9bc5; >= 07928d9bfc81640bab36f5190e8725894d93b659, < c7c26d0ef5d20f00dbb2ae3befcabbe0efa77275; >= 07928d9bfc81640bab36f51…
Fixed in: Linux 41aad9d6953984d134fc50f631f24ef476875d4d, Linux 0dd34a7ad395dbcf6ae60e48e9786050e25b9bc5, Linux 1e901bcb8af19416b65f5063a4af7996e5a51d7f, Linux 1734a79e951914f1db2c65e635012a35db1c674b, Linux 7ddc21e317b360c3444de3023bcc83b85fabae2f

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2023-52854 being exploited?

There is no confirmed exploitation: CVE-2023-52854 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.32% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2023-52854?

High: CVSS 7.8 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2023-52854?

Linux \>= 07928d9bfc81640bab36f5190e8725894d93b659, \< 41aad9d6953984d134fc50f631f24ef476875d4d; \>= 07928d9bfc81640bab36f5190e8725894d93b659, \< 0dd34a7ad395dbcf6ae60e48e9786050e25b9bc5; \>= 07928d9bfc81640bab36f5190e8725894d93b659, \< c7c26d0ef5d20f00dbb2ae3befcabbe0efa77275; \>= 07928d9bfc81640bab36f5190e8725894d93b659, \< 1e901bcb8af19416b65f5063a4af7996e5a51d7f; \>= 07928d9bfc81640bab36f5190e8725894d93b659, \< 1734a79e951914f1db2c65e635012a35db1c674b; \>= 07928d9bfc81640bab36f5190e8725894d93b659, \< 7ddc21e317b360c3444de3023bcc83b85fabae2f; 13721e447acc2b82c19cf72e9e6c4291c77693ed; 7a2ccb65f90168edc2348495bb56093c466ffa39; 928cf3d733c4efc221e1a78b14cb2ee066627260; c9da8ee1491719001a444f4af688b75e72b58418; …; Linux 5.6.

### Is there a fix for CVE-2023-52854?

Yes. Fixed in Linux 41aad9d6953984d134fc50f631f24ef476875d4d, Linux 0dd34a7ad395dbcf6ae60e48e9786050e25b9bc5, Linux 1e901bcb8af19416b65f5063a4af7996e5a51d7f, Linux 1734a79e951914f1db2c65e635012a35db1c674b, Linux 7ddc21e317b360c3444de3023bcc83b85fabae2f. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2023-52854?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/41aad9d6953984d134fc50f631f24ef476875d4d>
- patch: <https://git.kernel.org/stable/c/0dd34a7ad395dbcf6ae60e48e9786050e25b9bc5>
- patch: <https://git.kernel.org/stable/c/c7c26d0ef5d20f00dbb2ae3befcabbe0efa77275>
- patch: <https://git.kernel.org/stable/c/1e901bcb8af19416b65f5063a4af7996e5a51d7f>
- patch: <https://git.kernel.org/stable/c/1734a79e951914f1db2c65e635012a35db1c674b>
- patch: <https://git.kernel.org/stable/c/7ddc21e317b360c3444de3023bcc83b85fabae2f>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2023-52854>

HTML: <https://flawdb.com/CVE-2023-52854> · JSON: <https://flawdb.com/api/v1/entries/CVE-2023-52854>
