Date
June 18, 2025, 6:43 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 21.180379] ================================================================== [ 21.180737] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x170/0x310 [ 21.180901] Write of size 33 at addr fff00000c0b94080 by task kunit_try_catch/196 [ 21.181047] [ 21.181762] CPU: 0 UID: 0 PID: 196 Comm: kunit_try_catch Tainted: G B W N 6.16.0-rc2-next-20250618 #1 PREEMPT [ 21.182067] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST [ 21.182786] Hardware name: linux,dummy-virt (DT) [ 21.182948] Call trace: [ 21.183081] show_stack+0x20/0x38 (C) [ 21.183236] dump_stack_lvl+0x8c/0xd0 [ 21.183778] print_report+0x118/0x608 [ 21.184262] kasan_report+0xdc/0x128 [ 21.184573] kasan_check_range+0x100/0x1a8 [ 21.184751] __asan_memset+0x34/0x78 [ 21.185273] kmalloc_uaf_memset+0x170/0x310 [ 21.185488] kunit_try_run_case+0x170/0x3f0 [ 21.185616] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 21.185952] kthread+0x328/0x630 [ 21.186407] ret_from_fork+0x10/0x20 [ 21.186546] [ 21.186593] Allocated by task 196: [ 21.186667] kasan_save_stack+0x3c/0x68 [ 21.186777] kasan_save_track+0x20/0x40 [ 21.186871] kasan_save_alloc_info+0x40/0x58 [ 21.187250] __kasan_kmalloc+0xd4/0xd8 [ 21.187959] __kmalloc_cache_noprof+0x16c/0x3c0 [ 21.188522] kmalloc_uaf_memset+0xb8/0x310 [ 21.188726] kunit_try_run_case+0x170/0x3f0 [ 21.188843] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 21.188970] kthread+0x328/0x630 [ 21.189537] ret_from_fork+0x10/0x20 [ 21.189704] [ 21.189762] Freed by task 196: [ 21.189898] kasan_save_stack+0x3c/0x68 [ 21.190000] kasan_save_track+0x20/0x40 [ 21.190158] kasan_save_free_info+0x4c/0x78 [ 21.190341] __kasan_slab_free+0x6c/0x98 [ 21.190442] kfree+0x214/0x3c8 [ 21.190512] kmalloc_uaf_memset+0x11c/0x310 [ 21.190590] kunit_try_run_case+0x170/0x3f0 [ 21.190672] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 21.191235] kthread+0x328/0x630 [ 21.191340] ret_from_fork+0x10/0x20 [ 21.191598] [ 21.191652] The buggy address belongs to the object at fff00000c0b94080 [ 21.191652] which belongs to the cache kmalloc-64 of size 64 [ 21.192215] The buggy address is located 0 bytes inside of [ 21.192215] freed 64-byte region [fff00000c0b94080, fff00000c0b940c0) [ 21.192625] [ 21.192712] The buggy address belongs to the physical page: [ 21.192952] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x100b94 [ 21.193204] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 21.193428] page_type: f5(slab) [ 21.193542] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000 [ 21.194085] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 21.194264] page dumped because: kasan: bad access detected [ 21.194359] [ 21.194477] Memory state around the buggy address: [ 21.194562] fff00000c0b93f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 21.194966] fff00000c0b94000: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 21.195109] >fff00000c0b94080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 21.195424] ^ [ 21.195502] fff00000c0b94100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 21.195711] fff00000c0b94180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 21.195819] ==================================================================
[ 11.412617] ================================================================== [ 11.413527] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1a3/0x360 [ 11.413901] Write of size 33 at addr ffff888102620180 by task kunit_try_catch/212 [ 11.414251] [ 11.414363] CPU: 0 UID: 0 PID: 212 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc2-next-20250618 #1 PREEMPT(voluntary) [ 11.414422] Tainted: [B]=BAD_PAGE, [N]=TEST [ 11.414487] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 11.414512] Call Trace: [ 11.414525] <TASK> [ 11.414554] dump_stack_lvl+0x73/0xb0 [ 11.414586] print_report+0xd1/0x650 [ 11.414606] ? __virt_addr_valid+0x1db/0x2d0 [ 11.414641] ? kmalloc_uaf_memset+0x1a3/0x360 [ 11.414660] ? kasan_complete_mode_report_info+0x64/0x200 [ 11.414684] ? kmalloc_uaf_memset+0x1a3/0x360 [ 11.414704] kasan_report+0x141/0x180 [ 11.414724] ? kmalloc_uaf_memset+0x1a3/0x360 [ 11.414748] kasan_check_range+0x10c/0x1c0 [ 11.414769] __asan_memset+0x27/0x50 [ 11.414800] kmalloc_uaf_memset+0x1a3/0x360 [ 11.414819] ? __pfx_kmalloc_uaf_memset+0x10/0x10 [ 11.414839] ? __schedule+0x10cc/0x2b60 [ 11.414871] ? __pfx_read_tsc+0x10/0x10 [ 11.414892] ? ktime_get_ts64+0x86/0x230 [ 11.414917] kunit_try_run_case+0x1a5/0x480 [ 11.414940] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.414961] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 11.414992] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 11.415013] ? __kthread_parkme+0x82/0x180 [ 11.415033] ? preempt_count_sub+0x50/0x80 [ 11.415066] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.415087] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.415108] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 11.415130] kthread+0x337/0x6f0 [ 11.415148] ? trace_preempt_on+0x20/0xc0 [ 11.415171] ? __pfx_kthread+0x10/0x10 [ 11.415190] ? _raw_spin_unlock_irq+0x47/0x80 [ 11.415217] ? calculate_sigpending+0x7b/0xa0 [ 11.415240] ? __pfx_kthread+0x10/0x10 [ 11.415260] ret_from_fork+0x116/0x1d0 [ 11.415277] ? __pfx_kthread+0x10/0x10 [ 11.415297] ret_from_fork_asm+0x1a/0x30 [ 11.415326] </TASK> [ 11.415337] [ 11.422828] Allocated by task 212: [ 11.422988] kasan_save_stack+0x45/0x70 [ 11.423202] kasan_save_track+0x18/0x40 [ 11.423411] kasan_save_alloc_info+0x3b/0x50 [ 11.423693] __kasan_kmalloc+0xb7/0xc0 [ 11.423878] __kmalloc_cache_noprof+0x189/0x420 [ 11.424095] kmalloc_uaf_memset+0xa9/0x360 [ 11.424290] kunit_try_run_case+0x1a5/0x480 [ 11.424582] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.424827] kthread+0x337/0x6f0 [ 11.424987] ret_from_fork+0x116/0x1d0 [ 11.425154] ret_from_fork_asm+0x1a/0x30 [ 11.425403] [ 11.425539] Freed by task 212: [ 11.425685] kasan_save_stack+0x45/0x70 [ 11.425819] kasan_save_track+0x18/0x40 [ 11.425997] kasan_save_free_info+0x3f/0x60 [ 11.426161] __kasan_slab_free+0x56/0x70 [ 11.426449] kfree+0x222/0x3f0 [ 11.426560] kmalloc_uaf_memset+0x12b/0x360 [ 11.426693] kunit_try_run_case+0x1a5/0x480 [ 11.426830] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.426993] kthread+0x337/0x6f0 [ 11.427102] ret_from_fork+0x116/0x1d0 [ 11.427286] ret_from_fork_asm+0x1a/0x30 [ 11.427728] [ 11.427851] The buggy address belongs to the object at ffff888102620180 [ 11.427851] which belongs to the cache kmalloc-64 of size 64 [ 11.428338] The buggy address is located 0 bytes inside of [ 11.428338] freed 64-byte region [ffff888102620180, ffff8881026201c0) [ 11.428678] [ 11.428743] The buggy address belongs to the physical page: [ 11.428910] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102620 [ 11.429142] flags: 0x200000000000000(node=0|zone=2) [ 11.429668] page_type: f5(slab) [ 11.429838] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000 [ 11.430192] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 11.430536] page dumped because: kasan: bad access detected [ 11.430782] [ 11.430996] Memory state around the buggy address: [ 11.431272] ffff888102620080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 11.431691] ffff888102620100: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 11.431955] >ffff888102620180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 11.432361] ^ [ 11.432578] ffff888102620200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 11.432797] ffff888102620280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 11.433003] ==================================================================