Hay
Date
July 8, 2025, 11:09 p.m.

Environment
qemu-arm64
qemu-x86_64

[   19.126120] ==================================================================
[   19.126301] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   19.126420] Free of addr fff00000c64bc001 by task kunit_try_catch/150
[   19.126807] 
[   19.126853] CPU: 1 UID: 0 PID: 150 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   19.127091] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.127121] Hardware name: linux,dummy-virt (DT)
[   19.127150] Call trace:
[   19.127335]  show_stack+0x20/0x38 (C)
[   19.127508]  dump_stack_lvl+0x8c/0xd0
[   19.127561]  print_report+0x118/0x608
[   19.127743]  kasan_report_invalid_free+0xc0/0xe8
[   19.127802]  __kasan_kfree_large+0x5c/0xa8
[   19.127868]  free_large_kmalloc+0x64/0x190
[   19.128022]  kfree+0x270/0x3c8
[   19.128194]  kmalloc_large_invalid_free+0x108/0x270
[   19.128288]  kunit_try_run_case+0x170/0x3f0
[   19.128479]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.128541]  kthread+0x328/0x630
[   19.128733]  ret_from_fork+0x10/0x20
[   19.129024] 
[   19.129070] The buggy address belongs to the physical page:
[   19.129442] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1064bc
[   19.129520] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   19.129567] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   19.129742] page_type: f8(unknown)
[   19.129896] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   19.130033] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   19.130103] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   19.130181] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   19.130232] head: 0bfffe0000000002 ffffc1ffc3192f01 00000000ffffffff 00000000ffffffff
[   19.130289] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   19.130336] page dumped because: kasan: bad access detected
[   19.130367] 
[   19.130385] Memory state around the buggy address:
[   19.130424]  fff00000c64bbf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.130466]  fff00000c64bbf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.130511] >fff00000c64bc000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.130549]                    ^
[   19.130576]  fff00000c64bc080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.130618]  fff00000c64bc100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.130679] ==================================================================

[   12.022474] ==================================================================
[   12.023010] BUG: KASAN: invalid-free in kfree+0x274/0x3f0
[   12.023223] Free of addr ffff888102974001 by task kunit_try_catch/168
[   12.023423] 
[   12.023510] CPU: 0 UID: 0 PID: 168 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   12.023554] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.023565] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.023584] Call Trace:
[   12.023610]  <TASK>
[   12.023625]  dump_stack_lvl+0x73/0xb0
[   12.023653]  print_report+0xd1/0x650
[   12.023674]  ? __virt_addr_valid+0x1db/0x2d0
[   12.023697]  ? kasan_addr_to_slab+0x11/0xa0
[   12.023716]  ? kfree+0x274/0x3f0
[   12.023736]  kasan_report_invalid_free+0x10a/0x130
[   12.023759]  ? kfree+0x274/0x3f0
[   12.023781]  ? kfree+0x274/0x3f0
[   12.023799]  __kasan_kfree_large+0x86/0xd0
[   12.023819]  free_large_kmalloc+0x4b/0x110
[   12.023842]  kfree+0x274/0x3f0
[   12.023866]  kmalloc_large_invalid_free+0x120/0x2b0
[   12.023889]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   12.023912]  ? __schedule+0x10cc/0x2b60
[   12.023932]  ? __pfx_read_tsc+0x10/0x10
[   12.023952]  ? ktime_get_ts64+0x86/0x230
[   12.023976]  kunit_try_run_case+0x1a5/0x480
[   12.023999]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.024020]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.024042]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.024064]  ? __kthread_parkme+0x82/0x180
[   12.024084]  ? preempt_count_sub+0x50/0x80
[   12.024109]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.024132]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.024154]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.024177]  kthread+0x337/0x6f0
[   12.024194]  ? trace_preempt_on+0x20/0xc0
[   12.024217]  ? __pfx_kthread+0x10/0x10
[   12.024236]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.024259]  ? calculate_sigpending+0x7b/0xa0
[   12.024282]  ? __pfx_kthread+0x10/0x10
[   12.024302]  ret_from_fork+0x116/0x1d0
[   12.024319]  ? __pfx_kthread+0x10/0x10
[   12.024338]  ret_from_fork_asm+0x1a/0x30
[   12.024369]  </TASK>
[   12.024378] 
[   12.040003] The buggy address belongs to the physical page:
[   12.040233] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102974
[   12.041097] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   12.041838] flags: 0x200000000000040(head|node=0|zone=2)
[   12.042045] page_type: f8(unknown)
[   12.042173] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   12.042404] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   12.042885] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   12.043606] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   12.044338] head: 0200000000000002 ffffea00040a5d01 00000000ffffffff 00000000ffffffff
[   12.045100] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   12.045861] page dumped because: kasan: bad access detected
[   12.046327] 
[   12.046487] Memory state around the buggy address:
[   12.046961]  ffff888102973f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.047675]  ffff888102973f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.048109] >ffff888102974000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.048854]                    ^
[   12.049200]  ffff888102974080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.049795]  ffff888102974100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.050428] ==================================================================