Hay
Date
July 18, 2025, 1:09 p.m.

Environment
qemu-arm64
qemu-x86_64

[   31.315069] ==================================================================
[   31.315259] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   31.315357] Free of addr fff00000c3fe8001 by task kunit_try_catch/181
[   31.315692] 
[   31.315737] CPU: 0 UID: 0 PID: 181 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250718 #1 PREEMPT 
[   31.315847] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.315891] Hardware name: linux,dummy-virt (DT)
[   31.315956] Call trace:
[   31.316000]  show_stack+0x20/0x38 (C)
[   31.316052]  dump_stack_lvl+0x8c/0xd0
[   31.316218]  print_report+0x118/0x5e8
[   31.316428]  kasan_report_invalid_free+0xc0/0xe8
[   31.316517]  __kasan_kfree_large+0x5c/0xa8
[   31.316677]  free_large_kmalloc+0x68/0x150
[   31.316775]  kfree+0x270/0x3c8
[   31.316912]  kmalloc_large_invalid_free+0x108/0x270
[   31.317060]  kunit_try_run_case+0x170/0x3f0
[   31.317174]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.317275]  kthread+0x328/0x630
[   31.317318]  ret_from_fork+0x10/0x20
[   31.317529] 
[   31.317557] The buggy address belongs to the physical page:
[   31.317588] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103fe8
[   31.317653] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   31.317724] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   31.318000] page_type: f8(unknown)
[   31.318146] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   31.318280] raw: 0000000000000000 0000000000000000 00000000f8000000 0000000000000000
[   31.318393] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   31.318480] head: 0000000000000000 0000000000000000 00000000f8000000 0000000000000000
[   31.318580] head: 0bfffe0000000002 ffffc1ffc30ffa01 00000000ffffffff 00000000ffffffff
[   31.318633] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   31.318682] page dumped because: kasan: bad access detected
[   31.318721] 
[   31.318746] Memory state around the buggy address:
[   31.318783]  fff00000c3fe7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.318830]  fff00000c3fe7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.318871] >fff00000c3fe8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   31.318916]                    ^
[   31.318953]  fff00000c3fe8080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   31.319003]  fff00000c3fe8100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   31.319266] ==================================================================


[   24.288633] ==================================================================
[   24.290124] BUG: KASAN: invalid-free in kfree+0x274/0x3f0
[   24.290364] Free of addr ffff888106210001 by task kunit_try_catch/198
[   24.290558] 
[   24.290651] CPU: 0 UID: 0 PID: 198 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250718 #1 PREEMPT(voluntary) 
[   24.290702] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.290715] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   24.290739] Call Trace:
[   24.290753]  <TASK>
[   24.290771]  dump_stack_lvl+0x73/0xb0
[   24.291131]  print_report+0xd1/0x640
[   24.291157]  ? __virt_addr_valid+0x1db/0x2d0
[   24.291430]  ? kasan_addr_to_slab+0x11/0xa0
[   24.291457]  ? kfree+0x274/0x3f0
[   24.291479]  kasan_report_invalid_free+0x10a/0x130
[   24.291504]  ? kfree+0x274/0x3f0
[   24.291527]  ? kfree+0x274/0x3f0
[   24.291547]  __kasan_kfree_large+0x86/0xd0
[   24.291567]  free_large_kmalloc+0x52/0x110
[   24.291589]  kfree+0x274/0x3f0
[   24.291614]  kmalloc_large_invalid_free+0x120/0x2b0
[   24.291636]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   24.291658]  ? __schedule+0x10da/0x2b60
[   24.291684]  ? __pfx_read_tsc+0x10/0x10
[   24.291707]  ? ktime_get_ts64+0x86/0x230
[   24.291733]  kunit_try_run_case+0x1a5/0x480
[   24.291759]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.291780]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   24.291897]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   24.291929]  ? __kthread_parkme+0x82/0x180
[   24.291950]  ? preempt_count_sub+0x50/0x80
[   24.291973]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.291996]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.292019]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   24.292041]  kthread+0x337/0x6f0
[   24.292061]  ? trace_preempt_on+0x20/0xc0
[   24.292087]  ? __pfx_kthread+0x10/0x10
[   24.292108]  ? _raw_spin_unlock_irq+0x47/0x80
[   24.292138]  ? calculate_sigpending+0x7b/0xa0
[   24.292161]  ? __pfx_kthread+0x10/0x10
[   24.292197]  ret_from_fork+0x116/0x1d0
[   24.292216]  ? __pfx_kthread+0x10/0x10
[   24.292236]  ret_from_fork_asm+0x1a/0x30
[   24.292267]  </TASK>
[   24.292279] 
[   24.307539] The buggy address belongs to the physical page:
[   24.308024] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106210
[   24.308386] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   24.309174] flags: 0x200000000000040(head|node=0|zone=2)
[   24.309728] page_type: f8(unknown)
[   24.310117] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   24.310875] raw: 0000000000000000 0000000000000000 00000000f8000000 0000000000000000
[   24.311639] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   24.311940] head: 0000000000000000 0000000000000000 00000000f8000000 0000000000000000
[   24.312489] head: 0200000000000002 ffffea0004188401 00000000ffffffff 00000000ffffffff
[   24.313064] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   24.313847] page dumped because: kasan: bad access detected
[   24.314057] 
[   24.314119] Memory state around the buggy address:
[   24.314275]  ffff88810620ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.314480]  ffff88810620ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.314688] >ffff888106210000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   24.315058]                    ^
[   24.315365]  ffff888106210080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   24.315567]  ffff888106210100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   24.315830] ==================================================================