vulnerability

Ubuntu: (Multiple Advisories) (CVE-2023-52854): Linux kernel vulnerabilities

Severity
7
CVSS
(AV:L/AC:L/Au:S/C:C/I:C/A:C)
Published
May 21, 2024
Added
Nov 19, 2024
Modified
Dec 18, 2025

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

Solutions

ubuntu-upgrade-linux-image-5-4-0-1056-iotubuntu-upgrade-linux-image-5-4-0-1070-xilinx-zynqmpubuntu-upgrade-linux-image-5-4-0-1098-ibmubuntu-upgrade-linux-image-5-4-0-1126-fipsubuntu-upgrade-linux-image-5-4-0-1135-raspiubuntu-upgrade-linux-image-5-4-0-1139-kvmubuntu-upgrade-linux-image-5-4-0-1150-oracleubuntu-upgrade-linux-image-5-4-0-1152-awsubuntu-upgrade-linux-image-5-4-0-1152-aws-fipsubuntu-upgrade-linux-image-5-4-0-1155-gcpubuntu-upgrade-linux-image-5-4-0-1155-gcp-fipsubuntu-upgrade-linux-image-5-4-0-1156-azureubuntu-upgrade-linux-image-5-4-0-1157-azure-fipsubuntu-upgrade-linux-image-5-4-0-223-genericubuntu-upgrade-linux-image-5-4-0-223-generic-lpaeubuntu-upgrade-linux-image-5-4-0-223-lowlatencyubuntu-upgrade-linux-image-awsubuntu-upgrade-linux-image-aws-5-4ubuntu-upgrade-linux-image-aws-fipsubuntu-upgrade-linux-image-aws-fips-5-4ubuntu-upgrade-linux-image-aws-lts-20-04ubuntu-upgrade-linux-image-azureubuntu-upgrade-linux-image-azure-5-4ubuntu-upgrade-linux-image-azure-fipsubuntu-upgrade-linux-image-azure-fips-5-4ubuntu-upgrade-linux-image-azure-lts-20-04ubuntu-upgrade-linux-image-fipsubuntu-upgrade-linux-image-fips-5-4ubuntu-upgrade-linux-image-gcpubuntu-upgrade-linux-image-gcp-5-4ubuntu-upgrade-linux-image-gcp-fipsubuntu-upgrade-linux-image-gcp-fips-5-4ubuntu-upgrade-linux-image-gcp-lts-20-04ubuntu-upgrade-linux-image-genericubuntu-upgrade-linux-image-generic-5-4ubuntu-upgrade-linux-image-generic-hwe-18-04ubuntu-upgrade-linux-image-generic-lpaeubuntu-upgrade-linux-image-generic-lpae-5-4ubuntu-upgrade-linux-image-ibmubuntu-upgrade-linux-image-ibm-5-4ubuntu-upgrade-linux-image-ibm-lts-20-04ubuntu-upgrade-linux-image-kvmubuntu-upgrade-linux-image-kvm-5-4ubuntu-upgrade-linux-image-lowlatencyubuntu-upgrade-linux-image-lowlatency-5-4ubuntu-upgrade-linux-image-lowlatency-hwe-18-04ubuntu-upgrade-linux-image-oemubuntu-upgrade-linux-image-oem-osp1ubuntu-upgrade-linux-image-oracleubuntu-upgrade-linux-image-oracle-5-4ubuntu-upgrade-linux-image-oracle-lts-20-04ubuntu-upgrade-linux-image-raspiubuntu-upgrade-linux-image-raspi-5-4ubuntu-upgrade-linux-image-raspi-hwe-18-04ubuntu-upgrade-linux-image-raspi2ubuntu-upgrade-linux-image-snapdragon-5-4ubuntu-upgrade-linux-image-snapdragon-hwe-18-04ubuntu-upgrade-linux-image-virtualubuntu-upgrade-linux-image-virtual-5-4ubuntu-upgrade-linux-image-virtual-hwe-18-04ubuntu-upgrade-linux-image-xilinx-zynqmpubuntu-upgrade-linux-image-xilinx-zynqmp-5-4

References

    Title
    NEW

    Explore Exposure Command

    Confidently identify and prioritize exposures from endpoint to cloud with full attack surface visibility and threat-aware risk context.