# CVE-2024-27061: crypto: sun8i-ce - Fix use after free in unprepare

> 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, CNA) `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-28)
- **CWE:** CWE-416, CWE-476
- **Published:** 2024-05-01T13:00:17.611Z
- **Modified:** 2026-08-05T11:29:18.527Z

## Who should check

- Anyone running Linux \>= 4136212ab18eb3dce6efb6e18108765c36708f71, \< dc60b25540c82fc4baa95d1458ae96ead21859e0; \>= 4136212ab18eb3dce6efb6e18108765c36708f71, \< 51a7d338c212e0640b1aca52ba6590d5bea49879; \>= 4136212ab18eb3dce6efb6e18108765c36708f71, \< 183420038444547c149a0fc5f58e792c2752860c
- Anyone running Linux 6.6

## Description

In the Linux kernel, the following vulnerability has been resolved:

crypto: sun8i-ce - Fix use after free in unprepare

sun8i\_ce\_cipher\_unprepare should be called before
crypto\_finalize\_skcipher\_request, because client callbacks may
immediately free memory, that isn't needed anymore. But it will be
used by unprepare after free. Before removing prepare/unprepare
callbacks it was handled by crypto engine in crypto\_finalize\_request.

Usually that results in a pointer dereference problem during a in
crypto selftest.
 Unable to handle kernel NULL pointer dereference at
                                      virtual address 0000000000000030
 Mem abort info:
   ESR = 0x0000000096000004
   EC = 0x25: DABT (current EL), IL = 32 bits
   SET = 0, FnV = 0
   EA = 0, S1PTW = 0
   FSC = 0x04: level 0 translation fault
 Data abort info:
   ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
 user pgtable: 4k pages, 48-bit VAs, pgdp=000000004716d000
 \[0000000000000030\] pgd=0000000000000000, p4d=0000000000000000
 Internal error: Oops: 0000000096000004 \[\#1\] SMP

This problem is detected by KASAN as well.
 ==================================================================
 BUG: KASAN: slab-use-after-free in sun8i\_ce\_cipher\_do\_one+0x6e8/0xf80 \[sun8i\_ce\]
 Read of size 8 at addr ffff00000dcdc040 by task 1c15000.crypto-/373

 Hardware name: Pine64 PinePhone (1.2) (DT)
 Call trace:
  dump\_backtrace+0x9c/0x128
  show\_stack+0x20/0x38
  dump\_stack\_lvl+0x48/0x60
  print\_report+0xf8/0x5d8
  kasan\_report+0x90/0xd0
  \_\_asan\_load8+0x9c/0xc0
  sun8i\_ce\_cipher\_do\_one+0x6e8/0xf80 \[sun8i\_ce\]
  crypto\_pump\_work+0x354/0x620 \[crypto\_engine\]
  kthread\_worker\_fn+0x244/0x498
  kthread+0x168/0x178
  ret\_from\_fork+0x10/0x20

 Allocated by task 379:
  kasan\_save\_stack+0x3c/0x68
  kasan\_set\_track+0x2c/0x40
  kasan\_save\_alloc\_info+0x24/0x38
  \_\_kasan\_kmalloc+0xd4/0xd8
  \_\_kmalloc+0x74/0x1d0
  alg\_test\_skcipher+0x90/0x1f0
  alg\_test+0x24c/0x830
  cryptomgr\_test+0x38/0x60
  kthread+0x168/0x178
  ret\_from\_fork+0x10/0x20

 Freed by task 379:
  kasan\_save\_stack+0x3c/0x68
  kasan\_set\_track+0x2c/0x40
  kasan\_save\_free\_info+0x38/0x60
  \_\_kasan\_slab\_free+0x100/0x170
  slab\_free\_freelist\_hook+0xd4/0x1e8
  \_\_kmem\_cache\_free+0x15c/0x290
  kfree+0x74/0x100
  kfree\_sensitive+0x80/0xb0
  alg\_test\_skcipher+0x12c/0x1f0
  alg\_test+0x24c/0x830
  cryptomgr\_test+0x38/0x60
  kthread+0x168/0x178
  ret\_from\_fork+0x10/0x20

 The buggy address belongs to the object at ffff00000dcdc000
  which belongs to the cache kmalloc-256 of size 256
 The buggy address is located 64 bytes inside of
  freed 256-byte region \[ffff00000dcdc000, ffff00000dcdc100)

## Affected and fixed versions

- Linux: \>= 4136212ab18eb3dce6efb6e18108765c36708f71, \< dc60b25540c82fc4baa95d1458ae96ead21859e0; \>= 4136212ab18eb3dce6efb6e18108765c36708f71, \< 51a7d338c212e0640b1aca52ba6590d5bea49879; \>= 4136212ab18eb3dce6efb6e18108765c36708f71, \< 183420038444547c149a0fc5f58e792c2752860c (cvelist)
- Linux: 6.6 (cvelist)

## Mitigation

- Upgrade Linux to 183420038444547c149a0fc5f58e792c2752860c or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2024-27061.md
Affected: Linux >= 4136212ab18eb3dce6efb6e18108765c36708f71, < dc60b25540c82fc4baa95d1458ae96ead21859e0; >= 4136212ab18eb3dce6efb6e18108765c36708f71, < 51a7d338c212e0640b1aca52ba6590d5bea49879; >= 4136212ab18eb3dce6efb6e18108765c36708f71, < 183420038444547c149a0fc5f58e792c2752860c; Linux 6.6
Fixed in: Linux 51a7d338c212e0640b1aca52ba6590d5bea49879, Linux 183420038444547c149a0fc5f58e792c2752860c

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-2024-27061 being exploited?

There is no confirmed exploitation: CVE-2024-27061 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-28).

### How serious is CVE-2024-27061?

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

### Which versions are affected by CVE-2024-27061?

Linux \>= 4136212ab18eb3dce6efb6e18108765c36708f71, \< dc60b25540c82fc4baa95d1458ae96ead21859e0; \>= 4136212ab18eb3dce6efb6e18108765c36708f71, \< 51a7d338c212e0640b1aca52ba6590d5bea49879; \>= 4136212ab18eb3dce6efb6e18108765c36708f71, \< 183420038444547c149a0fc5f58e792c2752860c; Linux 6.6.

### Is there a fix for CVE-2024-27061?

Yes. Fixed in Linux 51a7d338c212e0640b1aca52ba6590d5bea49879, Linux 183420038444547c149a0fc5f58e792c2752860c. Upgrade Linux to 183420038444547c149a0fc5f58e792c2752860c or later.

### How do I check if I'm affected by CVE-2024-27061?

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/dc60b25540c82fc4baa95d1458ae96ead21859e0>
- patch: <https://git.kernel.org/stable/c/51a7d338c212e0640b1aca52ba6590d5bea49879>
- patch: <https://git.kernel.org/stable/c/183420038444547c149a0fc5f58e792c2752860c>

## 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-2024-27061>

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