CVE-2024-27061
published high CVSS 3.1 · 7.8crypto: sun8i-ce - Fix use after free in unprepare
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linux4136212ab18eb3dce6efb6e18108765c36708f71 to < dc60b25540c82fc4baa95d1458ae96ead21859e0 · 4136212ab18eb3dce6efb6e18108765c36708f71 to < 51a7d338c212e0640b1aca52ba6590d5bea49879 · 4136212ab18eb3dce6efb6e18108765c36708f71 to < 183420038444547c149a0fc5f58e792c2752860c · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux6.6 (affected) · 0 to < 6.6 (unaffected · semver) · 6.6.24 through 6.6.* (unaffected · semver) · 6.7.12 through 6.7.* (unaffected · semver) · 6.8 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
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)
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.8 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Scenarios
- en: AV:L - The vulnerable path is entered by submitting skcipher requests to the Allwinner crypto engine from the local system — most directly via an unprivileged AF_ALG socket, or via I/O on a dm-crypt volume; no remote-facing kernel consumer (kTLS, MACsec, CCMP) selects this driver's cbc/ecb algorithms. AC:L - The free is deterministic — af_alg_async_cb() frees the request inside crypto_finalize_skcipher_request(), and sun8i_ce_cipher_unprepare() then dereferences it unconditionally on the very next line, so no race must be won for the UAF; the attacker also drives both the request submission rate and any heap spray on these multi-core SoCs. PR:L - No capability check exists in crypto/af_alg.c or crypto/algif_skcipher.c, so any unprivileged local user can bind cbc(aes)/ecb(aes) — which the driver registers at priority 400, outranking software implementations — and issue AIO requests that hit the hardware path. UI:N - The attacker triggers the bug entirely from their own process by issuing crypto requests; no victim action, mount, or file open is required. S:U - The use-after-free corrupts kernel slab memory within the same kernel security authority; no VM, IOMMU, or sandbox boundary is crossed. C:H - Slab use-after-free with reads through freed pointers — rctx->flow indexes ce->chanlist[] unbounded, and scatterwalk_map_and_copy() reads through a freed scatterlist — giving an attacker who reclaims the object an arbitrary kernel-memory read primitive. I:H - unprepare() writes through freed pointers: memcpy(areq->iv, chan->backup_iv, ivsize) stores 16 attacker-known bytes at a destination read from freed memory, and memzero_explicit(chan->bounce_iv, ivsize) writes through an out-of-bounds indexed pointer, yielding a controlled write usable for privilege escalation. A:H - The commit documents a reproducible NULL-pointer dereference oops and a KASAN slab-use-after-free in the crypto-engine kthread, which panics the kernel and can be triggered repeatedly by an unprivileged user.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | 4136212ab18eb3dce6efb6e18108765c36708f71 to < dc60b25540c82fc4baa95d1458ae96ead21859e0 (affected · git)4136212ab18eb3dce6efb6e18108765c36708f71 to < 51a7d338c212e0640b1aca52ba6590d5bea49879 (affected · git)4136212ab18eb3dce6efb6e18108765c36708f71 to < 183420038444547c149a0fc5f58e792c2752860c (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 6.6 (affected)0 to < 6.6 (unaffected · semver)6.6.24 through 6.6.* (unaffected · semver)6.7.12 through 6.7.* (unaffected · semver)6.8 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
3Provider assertions
3Linux · cna
crypto: sun8i-ce - Fix use after free in unprepare
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 746262e57979a8c71e5773a4752d46e1cdc1a23defb9ed794445dd8c84580399
- Ingested
- 23 Sep 2026, 08:20:34 UTC
- Source record
- Official CVE record