Date
June 5, 2025, 7:08 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 25.478902] ================================================================== [ 25.479018] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308 [ 25.479128] Read of size 1 at addr fff00000c3fa5900 by task kunit_try_catch/192 [ 25.479244] [ 25.479312] CPU: 0 UID: 0 PID: 192 Comm: kunit_try_catch Tainted: G B N 6.15.0-next-20250605 #1 PREEMPT [ 25.480827] Tainted: [B]=BAD_PAGE, [N]=TEST [ 25.481038] Hardware name: linux,dummy-virt (DT) [ 25.481265] Call trace: [ 25.481466] show_stack+0x20/0x38 (C) [ 25.481626] dump_stack_lvl+0x8c/0xd0 [ 25.481784] print_report+0x118/0x608 [ 25.481955] kasan_report+0xdc/0x128 [ 25.482242] __kasan_check_byte+0x54/0x70 [ 25.482441] kfree_sensitive+0x30/0xb0 [ 25.482776] kmalloc_double_kzfree+0x168/0x308 [ 25.482933] kunit_try_run_case+0x170/0x3f0 [ 25.483076] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 25.483395] kthread+0x328/0x630 [ 25.483560] ret_from_fork+0x10/0x20 [ 25.483737] [ 25.483783] Allocated by task 192: [ 25.483904] kasan_save_stack+0x3c/0x68 [ 25.484020] kasan_save_track+0x20/0x40 [ 25.484240] kasan_save_alloc_info+0x40/0x58 [ 25.484416] __kasan_kmalloc+0xd4/0xd8 [ 25.484522] __kmalloc_cache_noprof+0x16c/0x3c0 [ 25.484628] kmalloc_double_kzfree+0xb8/0x308 [ 25.484787] kunit_try_run_case+0x170/0x3f0 [ 25.484944] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 25.485070] kthread+0x328/0x630 [ 25.485155] ret_from_fork+0x10/0x20 [ 25.485274] [ 25.485423] Freed by task 192: [ 25.485495] kasan_save_stack+0x3c/0x68 [ 25.485615] kasan_save_track+0x20/0x40 [ 25.485807] kasan_save_free_info+0x4c/0x78 [ 25.485982] __kasan_slab_free+0x6c/0x98 [ 25.486102] kfree+0x214/0x3c8 [ 25.486285] kfree_sensitive+0x80/0xb0 [ 25.486482] kmalloc_double_kzfree+0x11c/0x308 [ 25.486618] kunit_try_run_case+0x170/0x3f0 [ 25.486778] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 25.486986] kthread+0x328/0x630 [ 25.487116] ret_from_fork+0x10/0x20 [ 25.487212] [ 25.487260] The buggy address belongs to the object at fff00000c3fa5900 [ 25.487260] which belongs to the cache kmalloc-16 of size 16 [ 25.487416] The buggy address is located 0 bytes inside of [ 25.487416] freed 16-byte region [fff00000c3fa5900, fff00000c3fa5910) [ 25.487566] [ 25.487636] The buggy address belongs to the physical page: [ 25.487720] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103fa5 [ 25.487928] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 25.488059] page_type: f5(slab) [ 25.488279] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000 [ 25.488495] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 25.488710] page dumped because: kasan: bad access detected [ 25.488832] [ 25.488923] Memory state around the buggy address: [ 25.489017] fff00000c3fa5800: 00 02 fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 25.489216] fff00000c3fa5880: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 25.489577] >fff00000c3fa5900: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 25.489684] ^ [ 25.489759] fff00000c3fa5980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 25.490300] fff00000c3fa5a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 25.490446] ==================================================================
[ 11.741748] ================================================================== [ 11.742505] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350 [ 11.742820] Read of size 1 at addr ffff888102ae9120 by task kunit_try_catch/209 [ 11.743158] [ 11.743322] CPU: 0 UID: 0 PID: 209 Comm: kunit_try_catch Tainted: G B N 6.15.0-next-20250605 #1 PREEMPT(voluntary) [ 11.743368] Tainted: [B]=BAD_PAGE, [N]=TEST [ 11.743378] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 11.743398] Call Trace: [ 11.743409] <TASK> [ 11.743423] dump_stack_lvl+0x73/0xb0 [ 11.743449] print_report+0xd1/0x650 [ 11.743471] ? __virt_addr_valid+0x1db/0x2d0 [ 11.743494] ? kmalloc_double_kzfree+0x19c/0x350 [ 11.743516] ? kasan_complete_mode_report_info+0x64/0x200 [ 11.743538] ? kmalloc_double_kzfree+0x19c/0x350 [ 11.743561] kasan_report+0x141/0x180 [ 11.743583] ? kmalloc_double_kzfree+0x19c/0x350 [ 11.743608] ? kmalloc_double_kzfree+0x19c/0x350 [ 11.743642] __kasan_check_byte+0x3d/0x50 [ 11.743664] kfree_sensitive+0x22/0x90 [ 11.743686] kmalloc_double_kzfree+0x19c/0x350 [ 11.743708] ? __pfx_kmalloc_double_kzfree+0x10/0x10 [ 11.743732] ? __schedule+0x10cc/0x2b60 [ 11.743756] ? __pfx_read_tsc+0x10/0x10 [ 11.743776] ? ktime_get_ts64+0x86/0x230 [ 11.743799] kunit_try_run_case+0x1a5/0x480 [ 11.743820] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.743839] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 11.743863] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 11.743887] ? __kthread_parkme+0x82/0x180 [ 11.743921] ? preempt_count_sub+0x50/0x80 [ 11.743988] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.744012] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.744036] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 11.744060] kthread+0x337/0x6f0 [ 11.744079] ? trace_preempt_on+0x20/0xc0 [ 11.744100] ? __pfx_kthread+0x10/0x10 [ 11.744120] ? _raw_spin_unlock_irq+0x47/0x80 [ 11.744143] ? calculate_sigpending+0x7b/0xa0 [ 11.744166] ? __pfx_kthread+0x10/0x10 [ 11.744187] ret_from_fork+0x116/0x1d0 [ 11.744205] ? __pfx_kthread+0x10/0x10 [ 11.744225] ret_from_fork_asm+0x1a/0x30 [ 11.744255] </TASK> [ 11.744265] [ 11.752093] Allocated by task 209: [ 11.752286] kasan_save_stack+0x45/0x70 [ 11.752574] kasan_save_track+0x18/0x40 [ 11.752827] kasan_save_alloc_info+0x3b/0x50 [ 11.753175] __kasan_kmalloc+0xb7/0xc0 [ 11.753320] __kmalloc_cache_noprof+0x189/0x420 [ 11.753477] kmalloc_double_kzfree+0xa9/0x350 [ 11.753669] kunit_try_run_case+0x1a5/0x480 [ 11.753873] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.754154] kthread+0x337/0x6f0 [ 11.754427] ret_from_fork+0x116/0x1d0 [ 11.754565] ret_from_fork_asm+0x1a/0x30 [ 11.754703] [ 11.754773] Freed by task 209: [ 11.754883] kasan_save_stack+0x45/0x70 [ 11.755240] kasan_save_track+0x18/0x40 [ 11.755448] kasan_save_free_info+0x3f/0x60 [ 11.755661] __kasan_slab_free+0x56/0x70 [ 11.755860] kfree+0x222/0x3f0 [ 11.756102] kfree_sensitive+0x67/0x90 [ 11.756251] kmalloc_double_kzfree+0x12b/0x350 [ 11.756411] kunit_try_run_case+0x1a5/0x480 [ 11.756610] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.756908] kthread+0x337/0x6f0 [ 11.757113] ret_from_fork+0x116/0x1d0 [ 11.757256] ret_from_fork_asm+0x1a/0x30 [ 11.757450] [ 11.757544] The buggy address belongs to the object at ffff888102ae9120 [ 11.757544] which belongs to the cache kmalloc-16 of size 16 [ 11.757972] The buggy address is located 0 bytes inside of [ 11.757972] freed 16-byte region [ffff888102ae9120, ffff888102ae9130) [ 11.758363] [ 11.758467] The buggy address belongs to the physical page: [ 11.758716] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102ae9 [ 11.759082] flags: 0x200000000000000(node=0|zone=2) [ 11.759339] page_type: f5(slab) [ 11.759615] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000 [ 11.760183] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 11.760496] page dumped because: kasan: bad access detected [ 11.760736] [ 11.760837] Memory state around the buggy address: [ 11.761135] ffff888102ae9000: 00 02 fc fc 00 02 fc fc fa fb fc fc fa fb fc fc [ 11.761411] ffff888102ae9080: fa fb fc fc 00 05 fc fc fa fb fc fc fa fb fc fc [ 11.761733] >ffff888102ae9100: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc [ 11.761964] ^ [ 11.762165] ffff888102ae9180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 11.762554] ffff888102ae9200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 11.762857] ==================================================================