Hay
Date
July 5, 2025, 5:09 p.m.

Environment
qemu-arm64
qemu-x86_64

[   18.079356] ==================================================================
[   18.079486] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   18.079566] Free of addr fff00000c65c0001 by task kunit_try_catch/150
[   18.079610] 
[   18.079736] CPU: 1 UID: 0 PID: 150 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   18.079814] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.079900] Hardware name: linux,dummy-virt (DT)
[   18.079948] Call trace:
[   18.079986]  show_stack+0x20/0x38 (C)
[   18.080040]  dump_stack_lvl+0x8c/0xd0
[   18.080084]  print_report+0x118/0x608
[   18.080128]  kasan_report_invalid_free+0xc0/0xe8
[   18.080203]  __kasan_kfree_large+0x5c/0xa8
[   18.080249]  free_large_kmalloc+0x64/0x190
[   18.080293]  kfree+0x270/0x3c8
[   18.080333]  kmalloc_large_invalid_free+0x108/0x270
[   18.080380]  kunit_try_run_case+0x170/0x3f0
[   18.080424]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.080494]  kthread+0x328/0x630
[   18.080534]  ret_from_fork+0x10/0x20
[   18.080613] 
[   18.080692] The buggy address belongs to the physical page:
[   18.080803] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1065c0
[   18.080855] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   18.080911] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   18.081241] page_type: f8(unknown)
[   18.081296] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   18.081361] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   18.081468] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   18.081533] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   18.081598] head: 0bfffe0000000002 ffffc1ffc3197001 00000000ffffffff 00000000ffffffff
[   18.081676] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   18.081742] page dumped because: kasan: bad access detected
[   18.081834] 
[   18.081913] Memory state around the buggy address:
[   18.081961]  fff00000c65bff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.082218]  fff00000c65bff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.082259] >fff00000c65c0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.082295]                    ^
[   18.082321]  fff00000c65c0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.082360]  fff00000c65c0100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.082407] ==================================================================

[   11.126268] ==================================================================
[   11.127424] BUG: KASAN: invalid-free in kfree+0x274/0x3f0
[   11.127695] Free of addr ffff88810390c001 by task kunit_try_catch/168
[   11.128292] 
[   11.128408] CPU: 1 UID: 0 PID: 168 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   11.128478] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.128490] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.128521] Call Trace:
[   11.128533]  <TASK>
[   11.128549]  dump_stack_lvl+0x73/0xb0
[   11.128576]  print_report+0xd1/0x650
[   11.128606]  ? __virt_addr_valid+0x1db/0x2d0
[   11.128628]  ? kasan_addr_to_slab+0x11/0xa0
[   11.128647]  ? kfree+0x274/0x3f0
[   11.128693]  kasan_report_invalid_free+0x10a/0x130
[   11.128718]  ? kfree+0x274/0x3f0
[   11.128741]  ? kfree+0x274/0x3f0
[   11.128761]  __kasan_kfree_large+0x86/0xd0
[   11.128782]  free_large_kmalloc+0x4b/0x110
[   11.128804]  kfree+0x274/0x3f0
[   11.128830]  kmalloc_large_invalid_free+0x120/0x2b0
[   11.128852]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   11.128875]  ? __schedule+0x10cc/0x2b60
[   11.128896]  ? __pfx_read_tsc+0x10/0x10
[   11.128916]  ? ktime_get_ts64+0x86/0x230
[   11.128939]  kunit_try_run_case+0x1a5/0x480
[   11.128962]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.128983]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.129006]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.129028]  ? __kthread_parkme+0x82/0x180
[   11.129046]  ? preempt_count_sub+0x50/0x80
[   11.129069]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.129091]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.129113]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.129134]  kthread+0x337/0x6f0
[   11.129153]  ? trace_preempt_on+0x20/0xc0
[   11.129174]  ? __pfx_kthread+0x10/0x10
[   11.129212]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.129233]  ? calculate_sigpending+0x7b/0xa0
[   11.129255]  ? __pfx_kthread+0x10/0x10
[   11.129276]  ret_from_fork+0x116/0x1d0
[   11.129293]  ? __pfx_kthread+0x10/0x10
[   11.129312]  ret_from_fork_asm+0x1a/0x30
[   11.129342]  </TASK>
[   11.129353] 
[   11.142898] The buggy address belongs to the physical page:
[   11.143388] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10390c
[   11.143654] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   11.144433] flags: 0x200000000000040(head|node=0|zone=2)
[   11.144993] page_type: f8(unknown)
[   11.145370] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   11.145790] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   11.146517] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   11.147298] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   11.147802] head: 0200000000000002 ffffea00040e4301 00000000ffffffff 00000000ffffffff
[   11.148149] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   11.148833] page dumped because: kasan: bad access detected
[   11.149407] 
[   11.149518] Memory state around the buggy address:
[   11.149914]  ffff88810390bf00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   11.150134]  ffff88810390bf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   11.150887] >ffff88810390c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   11.151637]                    ^
[   11.151992]  ffff88810390c080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   11.152674]  ffff88810390c100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   11.152949] ==================================================================