Date
July 9, 2025, 12:11 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 19.839842] ================================================================== [ 19.839919] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468 [ 19.841501] Read of size 1 at addr fff00000c63a2628 by task kunit_try_catch/189 [ 19.841701] [ 19.841845] CPU: 1 UID: 0 PID: 189 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc5 #1 PREEMPT [ 19.841947] Tainted: [B]=BAD_PAGE, [N]=TEST [ 19.842012] Hardware name: linux,dummy-virt (DT) [ 19.842107] Call trace: [ 19.842178] show_stack+0x20/0x38 (C) [ 19.842251] dump_stack_lvl+0x8c/0xd0 [ 19.842508] print_report+0x118/0x608 [ 19.842669] kasan_report+0xdc/0x128 [ 19.842760] __asan_report_load1_noabort+0x20/0x30 [ 19.842935] kmalloc_uaf2+0x3f4/0x468 [ 19.843026] kunit_try_run_case+0x170/0x3f0 [ 19.843187] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 19.843244] kthread+0x328/0x630 [ 19.843587] ret_from_fork+0x10/0x20 [ 19.843684] [ 19.843796] Allocated by task 189: [ 19.843853] kasan_save_stack+0x3c/0x68 [ 19.843922] kasan_save_track+0x20/0x40 [ 19.844015] kasan_save_alloc_info+0x40/0x58 [ 19.844103] __kasan_kmalloc+0xd4/0xd8 [ 19.844161] __kmalloc_cache_noprof+0x16c/0x3c0 [ 19.844231] kmalloc_uaf2+0xc4/0x468 [ 19.844554] kunit_try_run_case+0x170/0x3f0 [ 19.845144] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 19.845236] kthread+0x328/0x630 [ 19.845319] ret_from_fork+0x10/0x20 [ 19.845445] [ 19.845498] Freed by task 189: [ 19.845577] kasan_save_stack+0x3c/0x68 [ 19.845618] kasan_save_track+0x20/0x40 [ 19.845793] kasan_save_free_info+0x4c/0x78 [ 19.845923] __kasan_slab_free+0x6c/0x98 [ 19.845989] kfree+0x214/0x3c8 [ 19.846114] kmalloc_uaf2+0x134/0x468 [ 19.846164] kunit_try_run_case+0x170/0x3f0 [ 19.846243] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 19.846523] kthread+0x328/0x630 [ 19.846559] ret_from_fork+0x10/0x20 [ 19.846619] [ 19.846665] The buggy address belongs to the object at fff00000c63a2600 [ 19.846665] which belongs to the cache kmalloc-64 of size 64 [ 19.846738] The buggy address is located 40 bytes inside of [ 19.846738] freed 64-byte region [fff00000c63a2600, fff00000c63a2640) [ 19.847034] [ 19.847129] The buggy address belongs to the physical page: [ 19.847186] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1063a2 [ 19.847294] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 19.847372] page_type: f5(slab) [ 19.847443] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000 [ 19.847560] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 19.847641] page dumped because: kasan: bad access detected [ 19.847741] [ 19.847794] Memory state around the buggy address: [ 19.847826] fff00000c63a2500: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 19.848127] fff00000c63a2580: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 19.848185] >fff00000c63a2600: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 19.848224] ^ [ 19.848510] fff00000c63a2680: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 19.848646] fff00000c63a2700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 19.848750] ==================================================================
[ 12.950875] ================================================================== [ 12.951686] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520 [ 12.952211] Read of size 1 at addr ffff8881026b0028 by task kunit_try_catch/205 [ 12.952810] [ 12.953089] CPU: 0 UID: 0 PID: 205 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc5 #1 PREEMPT(voluntary) [ 12.953140] Tainted: [B]=BAD_PAGE, [N]=TEST [ 12.953152] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 12.953174] Call Trace: [ 12.953186] <TASK> [ 12.953205] dump_stack_lvl+0x73/0xb0 [ 12.953239] print_report+0xd1/0x650 [ 12.953380] ? __virt_addr_valid+0x1db/0x2d0 [ 12.953412] ? kmalloc_uaf2+0x4a8/0x520 [ 12.953432] ? kasan_complete_mode_report_info+0x64/0x200 [ 12.953455] ? kmalloc_uaf2+0x4a8/0x520 [ 12.953475] kasan_report+0x141/0x180 [ 12.953496] ? kmalloc_uaf2+0x4a8/0x520 [ 12.953556] __asan_report_load1_noabort+0x18/0x20 [ 12.953583] kmalloc_uaf2+0x4a8/0x520 [ 12.953604] ? __pfx_kmalloc_uaf2+0x10/0x10 [ 12.953623] ? finish_task_switch.isra.0+0x153/0x700 [ 12.953647] ? __switch_to+0x47/0xf50 [ 12.953674] ? __schedule+0x10cc/0x2b60 [ 12.953696] ? __pfx_read_tsc+0x10/0x10 [ 12.953717] ? ktime_get_ts64+0x86/0x230 [ 12.953741] kunit_try_run_case+0x1a5/0x480 [ 12.953765] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.953788] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 12.953812] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 12.953835] ? __kthread_parkme+0x82/0x180 [ 12.953856] ? preempt_count_sub+0x50/0x80 [ 12.953878] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.953902] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.953936] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 12.953963] kthread+0x337/0x6f0 [ 12.953981] ? trace_preempt_on+0x20/0xc0 [ 12.954004] ? __pfx_kthread+0x10/0x10 [ 12.954025] ? _raw_spin_unlock_irq+0x47/0x80 [ 12.954046] ? calculate_sigpending+0x7b/0xa0 [ 12.954070] ? __pfx_kthread+0x10/0x10 [ 12.954090] ret_from_fork+0x116/0x1d0 [ 12.954108] ? __pfx_kthread+0x10/0x10 [ 12.954128] ret_from_fork_asm+0x1a/0x30 [ 12.954159] </TASK> [ 12.954169] [ 12.964401] Allocated by task 205: [ 12.964564] kasan_save_stack+0x45/0x70 [ 12.964742] kasan_save_track+0x18/0x40 [ 12.964903] kasan_save_alloc_info+0x3b/0x50 [ 12.965081] __kasan_kmalloc+0xb7/0xc0 [ 12.965267] __kmalloc_cache_noprof+0x189/0x420 [ 12.965531] kmalloc_uaf2+0xc6/0x520 [ 12.965712] kunit_try_run_case+0x1a5/0x480 [ 12.965945] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.966388] kthread+0x337/0x6f0 [ 12.966583] ret_from_fork+0x116/0x1d0 [ 12.966856] ret_from_fork_asm+0x1a/0x30 [ 12.967061] [ 12.967129] Freed by task 205: [ 12.967233] kasan_save_stack+0x45/0x70 [ 12.967361] kasan_save_track+0x18/0x40 [ 12.967488] kasan_save_free_info+0x3f/0x60 [ 12.967835] __kasan_slab_free+0x56/0x70 [ 12.968175] kfree+0x222/0x3f0 [ 12.968468] kmalloc_uaf2+0x14c/0x520 [ 12.968873] kunit_try_run_case+0x1a5/0x480 [ 12.969273] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.970006] kthread+0x337/0x6f0 [ 12.970185] ret_from_fork+0x116/0x1d0 [ 12.970825] ret_from_fork_asm+0x1a/0x30 [ 12.971188] [ 12.971457] The buggy address belongs to the object at ffff8881026b0000 [ 12.971457] which belongs to the cache kmalloc-64 of size 64 [ 12.972191] The buggy address is located 40 bytes inside of [ 12.972191] freed 64-byte region [ffff8881026b0000, ffff8881026b0040) [ 12.973028] [ 12.973132] The buggy address belongs to the physical page: [ 12.973523] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1026b0 [ 12.973988] flags: 0x200000000000000(node=0|zone=2) [ 12.974442] page_type: f5(slab) [ 12.974641] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000 [ 12.975203] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 12.975629] page dumped because: kasan: bad access detected [ 12.975904] [ 12.976303] Memory state around the buggy address: [ 12.976529] ffff8881026aff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.976815] ffff8881026aff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.977470] >ffff8881026b0000: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 12.977767] ^ [ 12.977983] ffff8881026b0080: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 12.978646] ffff8881026b0100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.979115] ==================================================================