Date
May 23, 2025, 11:07 p.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 27.963406] ================================================================== [ 27.963644] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308 [ 27.963822] Read of size 1 at addr fff00000c5a2a700 by task kunit_try_catch/194 [ 27.963965] [ 27.964061] CPU: 0 UID: 0 PID: 194 Comm: kunit_try_catch Tainted: G B N 6.15.0-rc7 #1 PREEMPT [ 27.964713] Tainted: [B]=BAD_PAGE, [N]=TEST [ 27.964789] Hardware name: linux,dummy-virt (DT) [ 27.965578] Call trace: [ 27.965767] show_stack+0x20/0x38 (C) [ 27.966269] dump_stack_lvl+0x8c/0xd0 [ 27.966641] print_report+0x118/0x608 [ 27.966861] kasan_report+0xdc/0x128 [ 27.967026] __kasan_check_byte+0x54/0x70 [ 27.967365] kfree_sensitive+0x30/0xb0 [ 27.967550] kmalloc_double_kzfree+0x168/0x308 [ 27.967702] kunit_try_run_case+0x170/0x3f0 [ 27.967988] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 27.968190] kthread+0x328/0x630 [ 27.968325] ret_from_fork+0x10/0x20 [ 27.968543] [ 27.968616] Allocated by task 194: [ 27.968703] kasan_save_stack+0x3c/0x68 [ 27.968819] kasan_save_track+0x20/0x40 [ 27.968929] kasan_save_alloc_info+0x40/0x58 [ 27.969042] __kasan_kmalloc+0xd4/0xd8 [ 27.969162] __kmalloc_cache_noprof+0x15c/0x3c0 [ 27.969283] kmalloc_double_kzfree+0xb8/0x308 [ 27.969489] kunit_try_run_case+0x170/0x3f0 [ 27.969723] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 27.969936] kthread+0x328/0x630 [ 27.970260] ret_from_fork+0x10/0x20 [ 27.970375] [ 27.970433] Freed by task 194: [ 27.970525] kasan_save_stack+0x3c/0x68 [ 27.970749] kasan_save_track+0x20/0x40 [ 27.971062] kasan_save_free_info+0x4c/0x78 [ 27.971501] __kasan_slab_free+0x6c/0x98 [ 27.971735] kfree+0x214/0x3c8 [ 27.972005] kfree_sensitive+0x80/0xb0 [ 27.972114] kmalloc_double_kzfree+0x11c/0x308 [ 27.972243] kunit_try_run_case+0x170/0x3f0 [ 27.972360] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 27.972489] kthread+0x328/0x630 [ 27.972569] ret_from_fork+0x10/0x20 [ 27.972661] [ 27.972716] The buggy address belongs to the object at fff00000c5a2a700 [ 27.972716] which belongs to the cache kmalloc-16 of size 16 [ 27.972895] The buggy address is located 0 bytes inside of [ 27.972895] freed 16-byte region [fff00000c5a2a700, fff00000c5a2a710) [ 27.973081] [ 27.973141] The buggy address belongs to the physical page: [ 27.973236] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105a2a [ 27.973398] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 27.973565] page_type: f5(slab) [ 27.973689] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000 [ 27.974054] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 27.974300] page dumped because: kasan: bad access detected [ 27.974399] [ 27.974466] Memory state around the buggy address: [ 27.975068] fff00000c5a2a600: 00 01 fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 27.975271] fff00000c5a2a680: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 27.975423] >fff00000c5a2a700: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 27.975614] ^ [ 27.975737] fff00000c5a2a780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 27.975916] fff00000c5a2a800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 27.976019] ==================================================================
[ 12.938856] ================================================================== [ 12.939970] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350 [ 12.940512] Read of size 1 at addr ffff8881020cbe80 by task kunit_try_catch/211 [ 12.940874] [ 12.941140] CPU: 0 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G B N 6.15.0-rc7 #1 PREEMPT(voluntary) [ 12.941188] Tainted: [B]=BAD_PAGE, [N]=TEST [ 12.941200] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 12.941221] Call Trace: [ 12.941233] <TASK> [ 12.941249] dump_stack_lvl+0x73/0xb0 [ 12.941276] print_report+0xd1/0x650 [ 12.941308] ? __virt_addr_valid+0x1db/0x2d0 [ 12.941329] ? kmalloc_double_kzfree+0x19c/0x350 [ 12.941351] ? kasan_complete_mode_report_info+0x64/0x200 [ 12.941402] ? kmalloc_double_kzfree+0x19c/0x350 [ 12.941435] kasan_report+0x141/0x180 [ 12.941469] ? kmalloc_double_kzfree+0x19c/0x350 [ 12.941495] ? kmalloc_double_kzfree+0x19c/0x350 [ 12.941518] __kasan_check_byte+0x3d/0x50 [ 12.941540] kfree_sensitive+0x22/0x90 [ 12.941563] kmalloc_double_kzfree+0x19c/0x350 [ 12.941585] ? __pfx_kmalloc_double_kzfree+0x10/0x10 [ 12.941608] ? __schedule+0x10cc/0x2b30 [ 12.941630] ? __pfx_read_tsc+0x10/0x10 [ 12.941649] ? ktime_get_ts64+0x86/0x230 [ 12.941673] kunit_try_run_case+0x1a5/0x480 [ 12.941696] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.941717] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 12.941739] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 12.941761] ? __kthread_parkme+0x82/0x180 [ 12.941781] ? preempt_count_sub+0x50/0x80 [ 12.941806] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.941828] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.941849] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 12.941871] kthread+0x337/0x6f0 [ 12.941904] ? trace_preempt_on+0x20/0xc0 [ 12.941927] ? __pfx_kthread+0x10/0x10 [ 12.941944] ? _raw_spin_unlock_irq+0x47/0x80 [ 12.941964] ? calculate_sigpending+0x7b/0xa0 [ 12.941985] ? __pfx_kthread+0x10/0x10 [ 12.942003] ret_from_fork+0x41/0x80 [ 12.942022] ? __pfx_kthread+0x10/0x10 [ 12.942039] ret_from_fork_asm+0x1a/0x30 [ 12.942069] </TASK> [ 12.942081] [ 12.956443] Allocated by task 211: [ 12.956962] kasan_save_stack+0x45/0x70 [ 12.957251] kasan_save_track+0x18/0x40 [ 12.957703] kasan_save_alloc_info+0x3b/0x50 [ 12.957907] __kasan_kmalloc+0xb7/0xc0 [ 12.958325] __kmalloc_cache_noprof+0x189/0x420 [ 12.958824] kmalloc_double_kzfree+0xa9/0x350 [ 12.959224] kunit_try_run_case+0x1a5/0x480 [ 12.959631] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.959951] kthread+0x337/0x6f0 [ 12.960320] ret_from_fork+0x41/0x80 [ 12.960682] ret_from_fork_asm+0x1a/0x30 [ 12.960982] [ 12.961053] Freed by task 211: [ 12.961164] kasan_save_stack+0x45/0x70 [ 12.961309] kasan_save_track+0x18/0x40 [ 12.961791] kasan_save_free_info+0x3f/0x60 [ 12.961974] __kasan_slab_free+0x56/0x70 [ 12.962365] kfree+0x222/0x3f0 [ 12.962713] kfree_sensitive+0x67/0x90 [ 12.963146] kmalloc_double_kzfree+0x12b/0x350 [ 12.963479] kunit_try_run_case+0x1a5/0x480 [ 12.963904] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.964343] kthread+0x337/0x6f0 [ 12.964717] ret_from_fork+0x41/0x80 [ 12.964874] ret_from_fork_asm+0x1a/0x30 [ 12.965375] [ 12.965535] The buggy address belongs to the object at ffff8881020cbe80 [ 12.965535] which belongs to the cache kmalloc-16 of size 16 [ 12.966233] The buggy address is located 0 bytes inside of [ 12.966233] freed 16-byte region [ffff8881020cbe80, ffff8881020cbe90) [ 12.966889] [ 12.966965] The buggy address belongs to the physical page: [ 12.967543] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1020cb [ 12.968359] flags: 0x200000000000000(node=0|zone=2) [ 12.968923] page_type: f5(slab) [ 12.969308] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000 [ 12.969907] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 12.970134] page dumped because: kasan: bad access detected [ 12.970312] [ 12.970406] Memory state around the buggy address: [ 12.970576] ffff8881020cbd80: fa fb fc fc fa fb fc fc fa fb fc fc 00 05 fc fc [ 12.971179] ffff8881020cbe00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 12.972015] >ffff8881020cbe80: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.972550] ^ [ 12.972877] ffff8881020cbf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.973420] ffff8881020cbf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.973734] ==================================================================