Hay
Date
July 5, 2025, 11:09 a.m.

Environment
qemu-arm64
qemu-x86_64

[   18.641911] ==================================================================
[   18.643053] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   18.643421] Free of addr fff00000c784c001 by task kunit_try_catch/151
[   18.643542] 
[   18.643694] CPU: 0 UID: 0 PID: 151 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   18.644458] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.644536] Hardware name: linux,dummy-virt (DT)
[   18.644693] Call trace:
[   18.644743]  show_stack+0x20/0x38 (C)
[   18.644870]  dump_stack_lvl+0x8c/0xd0
[   18.645399]  print_report+0x118/0x608
[   18.645581]  kasan_report_invalid_free+0xc0/0xe8
[   18.646085]  __kasan_kfree_large+0x5c/0xa8
[   18.646229]  free_large_kmalloc+0x64/0x190
[   18.646396]  kfree+0x270/0x3c8
[   18.646504]  kmalloc_large_invalid_free+0x108/0x270
[   18.646603]  kunit_try_run_case+0x170/0x3f0
[   18.646688]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.646787]  kthread+0x328/0x630
[   18.646871]  ret_from_fork+0x10/0x20
[   18.646975] 
[   18.647599] The buggy address belongs to the physical page:
[   18.647711] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10784c
[   18.648075] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   18.648416] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   18.648630] page_type: f8(unknown)
[   18.648723] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   18.648835] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   18.649305] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   18.649503] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   18.649716] head: 0bfffe0000000002 ffffc1ffc31e1301 00000000ffffffff 00000000ffffffff
[   18.649843] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   18.649925] page dumped because: kasan: bad access detected
[   18.649995] 
[   18.650448] Memory state around the buggy address:
[   18.650702]  fff00000c784bf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.650815]  fff00000c784bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.650907] >fff00000c784c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.650994]                    ^
[   18.651058]  fff00000c784c080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.651602]  fff00000c784c100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.651827] ==================================================================

[   13.042970] ==================================================================
[   13.044067] BUG: KASAN: invalid-free in kfree+0x274/0x3f0
[   13.044568] Free of addr ffff8881026ec001 by task kunit_try_catch/167
[   13.045063] 
[   13.045313] CPU: 1 UID: 0 PID: 167 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   13.045383] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.045398] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.045424] Call Trace:
[   13.045441]  <TASK>
[   13.045462]  dump_stack_lvl+0x73/0xb0
[   13.045499]  print_report+0xd1/0x650
[   13.045525]  ? __virt_addr_valid+0x1db/0x2d0
[   13.045554]  ? kasan_addr_to_slab+0x11/0xa0
[   13.045577]  ? kfree+0x274/0x3f0
[   13.045603]  kasan_report_invalid_free+0x10a/0x130
[   13.045631]  ? kfree+0x274/0x3f0
[   13.045672]  ? kfree+0x274/0x3f0
[   13.045696]  __kasan_kfree_large+0x86/0xd0
[   13.045721]  free_large_kmalloc+0x4b/0x110
[   13.045748]  kfree+0x274/0x3f0
[   13.045845]  kmalloc_large_invalid_free+0x120/0x2b0
[   13.045875]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   13.045902]  ? __schedule+0x10cc/0x2b60
[   13.045928]  ? __pfx_read_tsc+0x10/0x10
[   13.045953]  ? ktime_get_ts64+0x86/0x230
[   13.045982]  kunit_try_run_case+0x1a5/0x480
[   13.046026]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.046052]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.046079]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.046105]  ? __kthread_parkme+0x82/0x180
[   13.046130]  ? preempt_count_sub+0x50/0x80
[   13.046158]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.046186]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.046211]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.046237]  kthread+0x337/0x6f0
[   13.046260]  ? trace_preempt_on+0x20/0xc0
[   13.046288]  ? __pfx_kthread+0x10/0x10
[   13.046312]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.046337]  ? calculate_sigpending+0x7b/0xa0
[   13.046365]  ? __pfx_kthread+0x10/0x10
[   13.046390]  ret_from_fork+0x116/0x1d0
[   13.046411]  ? __pfx_kthread+0x10/0x10
[   13.046440]  ret_from_fork_asm+0x1a/0x30
[   13.046477]  </TASK>
[   13.046490] 
[   13.062629] The buggy address belongs to the physical page:
[   13.063371] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1026ec
[   13.064335] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   13.065234] flags: 0x200000000000040(head|node=0|zone=2)
[   13.065792] page_type: f8(unknown)
[   13.066053] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   13.066759] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   13.067629] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   13.068300] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   13.069231] head: 0200000000000002 ffffea000409bb01 00000000ffffffff 00000000ffffffff
[   13.069731] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   13.070444] page dumped because: kasan: bad access detected
[   13.071095] 
[   13.071187] Memory state around the buggy address:
[   13.071379]  ffff8881026ebf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.071638]  ffff8881026ebf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.072010] >ffff8881026ec000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.072688]                    ^
[   13.073074]  ffff8881026ec080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.073340]  ffff8881026ec100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.073632] ==================================================================