Hay
Date
July 9, 2025, 2:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.761535] ==================================================================
[   16.761636] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   16.761700] Free of addr fff00000c77dc001 by task kunit_try_catch/150
[   16.761746] 
[   16.761779] CPU: 0 UID: 0 PID: 150 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   16.761862] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.761887] Hardware name: linux,dummy-virt (DT)
[   16.761918] Call trace:
[   16.761942]  show_stack+0x20/0x38 (C)
[   16.761996]  dump_stack_lvl+0x8c/0xd0
[   16.762044]  print_report+0x118/0x608
[   16.762104]  kasan_report_invalid_free+0xc0/0xe8
[   16.762154]  __kasan_kfree_large+0x5c/0xa8
[   16.762201]  free_large_kmalloc+0x64/0x190
[   16.762246]  kfree+0x270/0x3c8
[   16.762288]  kmalloc_large_invalid_free+0x108/0x270
[   16.763013]  kunit_try_run_case+0x170/0x3f0
[   16.763228]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.763355]  kthread+0x328/0x630
[   16.763454]  ret_from_fork+0x10/0x20
[   16.763506] 
[   16.763526] The buggy address belongs to the physical page:
[   16.763558] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1077dc
[   16.763637] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   16.763793] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   16.763899] page_type: f8(unknown)
[   16.763999] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   16.764136] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   16.764225] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   16.764333] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   16.764441] head: 0bfffe0000000002 ffffc1ffc31df701 00000000ffffffff 00000000ffffffff
[   16.764528] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   16.764642] page dumped because: kasan: bad access detected
[   16.764755] 
[   16.764826] Memory state around the buggy address:
[   16.764893]  fff00000c77dbf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.764936]  fff00000c77dbf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.765297] >fff00000c77dc000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.765342]                    ^
[   16.765644]  fff00000c77dc080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.765768]  fff00000c77dc100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.765918] ==================================================================

[   12.276528] ==================================================================
[   12.277058] BUG: KASAN: invalid-free in kfree+0x274/0x3f0
[   12.277321] Free of addr ffff888102ab0001 by task kunit_try_catch/167
[   12.277615] 
[   12.277736] CPU: 1 UID: 0 PID: 167 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   12.277782] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.277793] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.278115] Call Trace:
[   12.278132]  <TASK>
[   12.278149]  dump_stack_lvl+0x73/0xb0
[   12.278183]  print_report+0xd1/0x650
[   12.278207]  ? __virt_addr_valid+0x1db/0x2d0
[   12.278301]  ? kasan_addr_to_slab+0x11/0xa0
[   12.278388]  ? kfree+0x274/0x3f0
[   12.278410]  kasan_report_invalid_free+0x10a/0x130
[   12.278435]  ? kfree+0x274/0x3f0
[   12.278457]  ? kfree+0x274/0x3f0
[   12.278477]  __kasan_kfree_large+0x86/0xd0
[   12.278498]  free_large_kmalloc+0x4b/0x110
[   12.278521]  kfree+0x274/0x3f0
[   12.278545]  kmalloc_large_invalid_free+0x120/0x2b0
[   12.278570]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   12.278604]  ? __schedule+0x10cc/0x2b60
[   12.278626]  ? __pfx_read_tsc+0x10/0x10
[   12.278648]  ? ktime_get_ts64+0x86/0x230
[   12.278674]  kunit_try_run_case+0x1a5/0x480
[   12.278700]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.278723]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.278747]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.278771]  ? __kthread_parkme+0x82/0x180
[   12.278793]  ? preempt_count_sub+0x50/0x80
[   12.278839]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.278863]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.278888]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.278913]  kthread+0x337/0x6f0
[   12.278932]  ? trace_preempt_on+0x20/0xc0
[   12.278957]  ? __pfx_kthread+0x10/0x10
[   12.278977]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.278998]  ? calculate_sigpending+0x7b/0xa0
[   12.279022]  ? __pfx_kthread+0x10/0x10
[   12.279043]  ret_from_fork+0x116/0x1d0
[   12.279061]  ? __pfx_kthread+0x10/0x10
[   12.279081]  ret_from_fork_asm+0x1a/0x30
[   12.279113]  </TASK>
[   12.279123] 
[   12.290206] The buggy address belongs to the physical page:
[   12.290618] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102ab0
[   12.291166] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   12.291556] flags: 0x200000000000040(head|node=0|zone=2)
[   12.291924] page_type: f8(unknown)
[   12.292063] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   12.292623] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   12.293020] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   12.293540] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   12.294018] head: 0200000000000002 ffffea00040aac01 00000000ffffffff 00000000ffffffff
[   12.294304] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   12.294783] page dumped because: kasan: bad access detected
[   12.295185] 
[   12.295275] Memory state around the buggy address:
[   12.295669]  ffff888102aaff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.296171]  ffff888102aaff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.296538] >ffff888102ab0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.297018]                    ^
[   12.297178]  ffff888102ab0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.297627]  ffff888102ab0100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.297978] ==================================================================