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

- Priority: **Routine**
- Reason: Not severe (CVSS 7.8, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2024-05-21 · Modified: 2026-05-23
- Aliases: UBUNTU-CVE-2023-52854, DEBIAN-CVE-2023-52854
- Record: https://cvemate.com/vulnerability/CVE-2023-52854 · JSON: https://cvemate.com/vulnerability/CVE-2023-52854/json

## Description

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

## Signals

- CVSS: 7.8 high (v3.1, NVD) CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- EPSS: 0.242%, percentile 16.482%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 120)

- debian linux (Debian): \< 6.1.64-1 \| \< 6.6.8-1
- ubuntu linux (Ubuntu): All versions (No fix recorded) \| \< 5.4.0-223.243 \| \< 5.15.0-100.110
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): All versions (No fix recorded) \| \< 5.4.0-1152.162 \| \< 5.15.0-1056.61
- ubuntu linux-aws-5.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.15 (Ubuntu): \< 5.15.0-1056.61~20.04.1
- ubuntu linux-aws-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.3 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.4 (Ubuntu): \< 5.4.0-1152.162~18.04.1
- ubuntu linux-aws-5.8 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.2 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.5 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-fips (Ubuntu): All versions (No fix recorded) \| \< 5.4.0-1152.162+fips1 \| \< 5.15.0-1056.61+fips1
- ubuntu linux-aws-hwe (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure (Ubuntu): All versions (No fix recorded) \| \< 5.4.0-1156.163 \| \< 5.15.0-1058.66
- ubuntu linux-azure-4.15 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.13 (Ubuntu): All versions (No fix recorded)

## References

- <https://git.kernel.org/stable/c/41aad9d6953984d134fc50f631f24ef476875d4d>
- <https://git.kernel.org/stable/c/0dd34a7ad395dbcf6ae60e48e9786050e25b9bc5>
- <https://git.kernel.org/stable/c/c7c26d0ef5d20f00dbb2ae3befcabbe0efa77275>
- <https://git.kernel.org/stable/c/1e901bcb8af19416b65f5063a4af7996e5a51d7f>
- <https://git.kernel.org/stable/c/1734a79e951914f1db2c65e635012a35db1c674b>
- <https://git.kernel.org/stable/c/7ddc21e317b360c3444de3023bcc83b85fabae2f>
- <https://ubuntu.com/security/CVE-2023-52854>
- <https://www.cve.org/CVERecord?id=CVE-2023-52854>
- <https://git.kernel.org/linus/7ddc21e317b360c3444de3023bcc83b85fabae2f>
- <https://ubuntu.com/security/notices/USN-7874-1>
- <https://ubuntu.com/security/notices/USN-7874-2>
- <https://ubuntu.com/security/notices/USN-7874-3>
- <https://ubuntu.com/security/notices/USN-7939-1>
- <https://ubuntu.com/security/notices/USN-7939-2>
- <https://security-tracker.debian.org/tracker/CVE-2023-52854>

---

Data as of 2026-12-05T04:24:08.169Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
