CVE-2024-27061

Severity CVSS v4.0:
Pending analysis
Type:
CWE-416 Use After Free
Publication date:
01/05/2024
Last modified:
05/03/2025

Description

In the Linux kernel, the following vulnerability has been resolved:<br /> <br /> crypto: sun8i-ce - Fix use after free in unprepare<br /> <br /> sun8i_ce_cipher_unprepare should be called before<br /> crypto_finalize_skcipher_request, because client callbacks may<br /> immediately free memory, that isn&amp;#39;t needed anymore. But it will be<br /> used by unprepare after free. Before removing prepare/unprepare<br /> callbacks it was handled by crypto engine in crypto_finalize_request.<br /> <br /> Usually that results in a pointer dereference problem during a in<br /> crypto selftest.<br /> Unable to handle kernel NULL pointer dereference at<br /> virtual address 0000000000000030<br /> Mem abort info:<br /> ESR = 0x0000000096000004<br /> EC = 0x25: DABT (current EL), IL = 32 bits<br /> SET = 0, FnV = 0<br /> EA = 0, S1PTW = 0<br /> FSC = 0x04: level 0 translation fault<br /> Data abort info:<br /> ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000<br /> CM = 0, WnR = 0, TnD = 0, TagAccess = 0<br /> GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0<br /> user pgtable: 4k pages, 48-bit VAs, pgdp=000000004716d000<br /> [0000000000000030] pgd=0000000000000000, p4d=0000000000000000<br /> Internal error: Oops: 0000000096000004 [#1] SMP<br /> <br /> This problem is detected by KASAN as well.<br /> ==================================================================<br /> BUG: KASAN: slab-use-after-free in sun8i_ce_cipher_do_one+0x6e8/0xf80 [sun8i_ce]<br /> Read of size 8 at addr ffff00000dcdc040 by task 1c15000.crypto-/373<br /> <br /> Hardware name: Pine64 PinePhone (1.2) (DT)<br /> Call trace:<br /> dump_backtrace+0x9c/0x128<br /> show_stack+0x20/0x38<br /> dump_stack_lvl+0x48/0x60<br /> print_report+0xf8/0x5d8<br /> kasan_report+0x90/0xd0<br /> __asan_load8+0x9c/0xc0<br /> sun8i_ce_cipher_do_one+0x6e8/0xf80 [sun8i_ce]<br /> crypto_pump_work+0x354/0x620 [crypto_engine]<br /> kthread_worker_fn+0x244/0x498<br /> kthread+0x168/0x178<br /> ret_from_fork+0x10/0x20<br /> <br /> Allocated by task 379:<br /> kasan_save_stack+0x3c/0x68<br /> kasan_set_track+0x2c/0x40<br /> kasan_save_alloc_info+0x24/0x38<br /> __kasan_kmalloc+0xd4/0xd8<br /> __kmalloc+0x74/0x1d0<br /> alg_test_skcipher+0x90/0x1f0<br /> alg_test+0x24c/0x830<br /> cryptomgr_test+0x38/0x60<br /> kthread+0x168/0x178<br /> ret_from_fork+0x10/0x20<br /> <br /> Freed by task 379:<br /> kasan_save_stack+0x3c/0x68<br /> kasan_set_track+0x2c/0x40<br /> kasan_save_free_info+0x38/0x60<br /> __kasan_slab_free+0x100/0x170<br /> slab_free_freelist_hook+0xd4/0x1e8<br /> __kmem_cache_free+0x15c/0x290<br /> kfree+0x74/0x100<br /> kfree_sensitive+0x80/0xb0<br /> alg_test_skcipher+0x12c/0x1f0<br /> alg_test+0x24c/0x830<br /> cryptomgr_test+0x38/0x60<br /> kthread+0x168/0x178<br /> ret_from_fork+0x10/0x20<br /> <br /> The buggy address belongs to the object at ffff00000dcdc000<br /> which belongs to the cache kmalloc-256 of size 256<br /> The buggy address is located 64 bytes inside of<br /> freed 256-byte region [ffff00000dcdc000, ffff00000dcdc100)

Vulnerable products and versions

CPE From Up to
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.6 (including) 6.6.24 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.7 (including) 6.7.12 (excluding)
cpe:2.3:o:linux:linux_kernel:6.8:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.8:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.8:rc3:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.8:rc4:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.8:rc5:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.8:rc6:*:*:*:*:*:*