Hay
Date
July 23, 2025, 2:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   15.155105] ==================================================================
[   15.155419] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   15.155579] Free of addr fff00000c6500001 by task kunit_try_catch/150
[   15.155634] 
[   15.155764] CPU: 1 UID: 0 PID: 150 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7 #1 PREEMPT 
[   15.155847] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.155885] Hardware name: linux,dummy-virt (DT)
[   15.155921] Call trace:
[   15.155982]  show_stack+0x20/0x38 (C)
[   15.156083]  dump_stack_lvl+0x8c/0xd0
[   15.156319]  print_report+0x118/0x5d0
[   15.156430]  kasan_report_invalid_free+0xc0/0xe8
[   15.156539]  __kasan_kfree_large+0x5c/0xa8
[   15.156585]  free_large_kmalloc+0x64/0x190
[   15.156630]  kfree+0x270/0x3c8
[   15.156677]  kmalloc_large_invalid_free+0x108/0x270
[   15.156871]  kunit_try_run_case+0x170/0x3f0
[   15.156917]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.157026]  kthread+0x328/0x630
[   15.157414]  ret_from_fork+0x10/0x20
[   15.157623] 
[   15.157645] The buggy address belongs to the physical page:
[   15.157675] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106500
[   15.158237] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   15.158608] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   15.158819] page_type: f8(unknown)
[   15.158954] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   15.159004] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   15.159110] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   15.159162] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   15.159233] head: 0bfffe0000000002 ffffc1ffc3194001 00000000ffffffff 00000000ffffffff
[   15.159282] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   15.159388] page dumped because: kasan: bad access detected
[   15.159717] 
[   15.159792] Memory state around the buggy address:
[   15.159862]  fff00000c64fff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.159907]  fff00000c64fff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.159998] >fff00000c6500000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   15.160222]                    ^
[   15.160256]  fff00000c6500080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   15.160299]  fff00000c6500100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   15.160350] ==================================================================

[   12.237038] ==================================================================
[   12.237578] BUG: KASAN: invalid-free in kfree+0x274/0x3f0
[   12.237880] Free of addr ffff88810294c001 by task kunit_try_catch/167
[   12.238153] 
[   12.238313] CPU: 0 UID: 0 PID: 167 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7 #1 PREEMPT(voluntary) 
[   12.238357] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.238369] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.238389] Call Trace:
[   12.238401]  <TASK>
[   12.238415]  dump_stack_lvl+0x73/0xb0
[   12.238444]  print_report+0xd1/0x610
[   12.238465]  ? __virt_addr_valid+0x1db/0x2d0
[   12.238487]  ? kasan_addr_to_slab+0x11/0xa0
[   12.238506]  ? kfree+0x274/0x3f0
[   12.238527]  kasan_report_invalid_free+0x10a/0x130
[   12.238551]  ? kfree+0x274/0x3f0
[   12.238573]  ? kfree+0x274/0x3f0
[   12.238593]  __kasan_kfree_large+0x86/0xd0
[   12.238613]  free_large_kmalloc+0x4b/0x110
[   12.238636]  kfree+0x274/0x3f0
[   12.238660]  kmalloc_large_invalid_free+0x120/0x2b0
[   12.238682]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   12.238705]  ? __schedule+0x10c6/0x2b60
[   12.238727]  ? __pfx_read_tsc+0x10/0x10
[   12.238746]  ? ktime_get_ts64+0x86/0x230
[   12.238770]  kunit_try_run_case+0x1a5/0x480
[   12.238794]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.238828]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.238851]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.238874]  ? __kthread_parkme+0x82/0x180
[   12.238894]  ? preempt_count_sub+0x50/0x80
[   12.238917]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.238940]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.238962]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.238985]  kthread+0x337/0x6f0
[   12.239004]  ? trace_preempt_on+0x20/0xc0
[   12.239025]  ? __pfx_kthread+0x10/0x10
[   12.239046]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.239066]  ? calculate_sigpending+0x7b/0xa0
[   12.239089]  ? __pfx_kthread+0x10/0x10
[   12.239110]  ret_from_fork+0x116/0x1d0
[   12.239128]  ? __pfx_kthread+0x10/0x10
[   12.239148]  ret_from_fork_asm+0x1a/0x30
[   12.239177]  </TASK>
[   12.239187] 
[   12.246889] The buggy address belongs to the physical page:
[   12.247348] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10294c
[   12.247622] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   12.247865] flags: 0x200000000000040(head|node=0|zone=2)
[   12.248400] page_type: f8(unknown)
[   12.248599] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   12.248972] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   12.249319] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   12.249560] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   12.249794] head: 0200000000000002 ffffea00040a5301 00000000ffffffff 00000000ffffffff
[   12.250375] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   12.250720] page dumped because: kasan: bad access detected
[   12.250969] 
[   12.251041] Memory state around the buggy address:
[   12.251426]  ffff88810294bf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.251753]  ffff88810294bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.252064] >ffff88810294c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.252520]                    ^
[   12.252645]  ffff88810294c080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.252906]  ffff88810294c100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.253240] ==================================================================