Hay
Date
July 16, 2025, 3:10 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.453216] ==================================================================
[   16.453397] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   16.453666] Free of addr fff00000c7890001 by task kunit_try_catch/150
[   16.453806] 
[   16.453841] CPU: 1 UID: 0 PID: 150 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   16.453943] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.453970] Hardware name: linux,dummy-virt (DT)
[   16.454047] Call trace:
[   16.454076]  show_stack+0x20/0x38 (C)
[   16.454318]  dump_stack_lvl+0x8c/0xd0
[   16.454447]  print_report+0x118/0x5d0
[   16.454498]  kasan_report_invalid_free+0xc0/0xe8
[   16.454565]  __kasan_kfree_large+0x5c/0xa8
[   16.454647]  free_large_kmalloc+0x64/0x190
[   16.454691]  kfree+0x270/0x3c8
[   16.454743]  kmalloc_large_invalid_free+0x108/0x270
[   16.454791]  kunit_try_run_case+0x170/0x3f0
[   16.454839]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.454980]  kthread+0x328/0x630
[   16.455035]  ret_from_fork+0x10/0x20
[   16.455082] 
[   16.455101] The buggy address belongs to the physical page:
[   16.455173] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107890
[   16.455238] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   16.455375] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   16.455545] page_type: f8(unknown)
[   16.455590] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   16.455640] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   16.455732] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   16.455780] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   16.455935] head: 0bfffe0000000002 ffffc1ffc31e2401 00000000ffffffff 00000000ffffffff
[   16.456077] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   16.456188] page dumped because: kasan: bad access detected
[   16.456311] 
[   16.456405] Memory state around the buggy address:
[   16.456467]  fff00000c788ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.456833]  fff00000c788ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.456900] >fff00000c7890000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.457009]                    ^
[   16.457103]  fff00000c7890080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.457146]  fff00000c7890100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.457486] ==================================================================

[   12.111270] ==================================================================
[   12.111843] BUG: KASAN: invalid-free in kfree+0x274/0x3f0
[   12.112084] Free of addr ffff888102a34001 by task kunit_try_catch/167
[   12.112522] 
[   12.112620] CPU: 0 UID: 0 PID: 167 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   12.112662] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.112673] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.112693] Call Trace:
[   12.112704]  <TASK>
[   12.112719]  dump_stack_lvl+0x73/0xb0
[   12.112749]  print_report+0xd1/0x610
[   12.112789]  ? __virt_addr_valid+0x1db/0x2d0
[   12.112812]  ? kasan_addr_to_slab+0x11/0xa0
[   12.112833]  ? kfree+0x274/0x3f0
[   12.112854]  kasan_report_invalid_free+0x10a/0x130
[   12.112879]  ? kfree+0x274/0x3f0
[   12.112902]  ? kfree+0x274/0x3f0
[   12.112923]  __kasan_kfree_large+0x86/0xd0
[   12.112945]  free_large_kmalloc+0x4b/0x110
[   12.112969]  kfree+0x274/0x3f0
[   12.112993]  kmalloc_large_invalid_free+0x120/0x2b0
[   12.113239]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   12.113272]  ? __schedule+0x10cc/0x2b60
[   12.113294]  ? __pfx_read_tsc+0x10/0x10
[   12.113315]  ? ktime_get_ts64+0x86/0x230
[   12.113339]  kunit_try_run_case+0x1a5/0x480
[   12.113364]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.113387]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.113411]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.113445]  ? __kthread_parkme+0x82/0x180
[   12.113466]  ? preempt_count_sub+0x50/0x80
[   12.113490]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.113514]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.113539]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.113564]  kthread+0x337/0x6f0
[   12.113583]  ? trace_preempt_on+0x20/0xc0
[   12.113607]  ? __pfx_kthread+0x10/0x10
[   12.113627]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.113649]  ? calculate_sigpending+0x7b/0xa0
[   12.113673]  ? __pfx_kthread+0x10/0x10
[   12.113695]  ret_from_fork+0x116/0x1d0
[   12.113713]  ? __pfx_kthread+0x10/0x10
[   12.113734]  ret_from_fork_asm+0x1a/0x30
[   12.113777]  </TASK>
[   12.113787] 
[   12.121317] The buggy address belongs to the physical page:
[   12.121568] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a34
[   12.121923] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   12.122302] flags: 0x200000000000040(head|node=0|zone=2)
[   12.122564] page_type: f8(unknown)
[   12.122698] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   12.122942] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   12.123261] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   12.123829] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   12.124291] head: 0200000000000002 ffffea00040a8d01 00000000ffffffff 00000000ffffffff
[   12.124608] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   12.125138] page dumped because: kasan: bad access detected
[   12.125363] 
[   12.125464] Memory state around the buggy address:
[   12.125655]  ffff888102a33f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.125952]  ffff888102a33f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.126305] >ffff888102a34000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.126628]                    ^
[   12.126746]  ffff888102a34080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.126974]  ffff888102a34100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.127288] ==================================================================