Hay
Date
July 17, 2025, 11:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   15.125480] ==================================================================
[   15.125579] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   15.125669] Free of addr fff00000c65c4001 by task kunit_try_catch/151
[   15.125716] 
[   15.125761] CPU: 0 UID: 0 PID: 151 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   15.125857] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.125891] Hardware name: linux,dummy-virt (DT)
[   15.125921] Call trace:
[   15.125942]  show_stack+0x20/0x38 (C)
[   15.126009]  dump_stack_lvl+0x8c/0xd0
[   15.126056]  print_report+0x118/0x5d0
[   15.126100]  kasan_report_invalid_free+0xc0/0xe8
[   15.126153]  __kasan_kfree_large+0x5c/0xa8
[   15.126198]  free_large_kmalloc+0x64/0x190
[   15.126242]  kfree+0x270/0x3c8
[   15.126281]  kmalloc_large_invalid_free+0x108/0x270
[   15.126327]  kunit_try_run_case+0x170/0x3f0
[   15.126382]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.126432]  kthread+0x328/0x630
[   15.126471]  ret_from_fork+0x10/0x20
[   15.126525] 
[   15.126545] The buggy address belongs to the physical page:
[   15.126577] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1065c4
[   15.126629] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   15.126685] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   15.126737] page_type: f8(unknown)
[   15.126776] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   15.126833] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   15.126891] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   15.126954] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   15.127426] head: 0bfffe0000000002 ffffc1ffc3197101 00000000ffffffff 00000000ffffffff
[   15.127486] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   15.127534] page dumped because: kasan: bad access detected
[   15.128011] 
[   15.128164] Memory state around the buggy address:
[   15.128301]  fff00000c65c3f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.128416]  fff00000c65c3f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.128480] >fff00000c65c4000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   15.128653]                    ^
[   15.128689]  fff00000c65c4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   15.128731]  fff00000c65c4100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   15.128912] ==================================================================

[   12.573862] ==================================================================
[   12.574305] BUG: KASAN: invalid-free in kfree+0x274/0x3f0
[   12.574519] Free of addr ffff888102a40001 by task kunit_try_catch/167
[   12.574735] 
[   12.574821] CPU: 1 UID: 0 PID: 167 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   12.574863] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.574873] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.574892] Call Trace:
[   12.574903]  <TASK>
[   12.574918]  dump_stack_lvl+0x73/0xb0
[   12.574945]  print_report+0xd1/0x610
[   12.574967]  ? __virt_addr_valid+0x1db/0x2d0
[   12.574989]  ? kasan_addr_to_slab+0x11/0xa0
[   12.575007]  ? kfree+0x274/0x3f0
[   12.575027]  kasan_report_invalid_free+0x10a/0x130
[   12.575050]  ? kfree+0x274/0x3f0
[   12.575072]  ? kfree+0x274/0x3f0
[   12.575091]  __kasan_kfree_large+0x86/0xd0
[   12.575112]  free_large_kmalloc+0x4b/0x110
[   12.575135]  kfree+0x274/0x3f0
[   12.575158]  kmalloc_large_invalid_free+0x120/0x2b0
[   12.575180]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   12.575202]  ? __schedule+0x10cc/0x2b60
[   12.575223]  ? __pfx_read_tsc+0x10/0x10
[   12.575243]  ? ktime_get_ts64+0x86/0x230
[   12.575266]  kunit_try_run_case+0x1a5/0x480
[   12.575289]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.575310]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.575331]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.575353]  ? __kthread_parkme+0x82/0x180
[   12.575373]  ? preempt_count_sub+0x50/0x80
[   12.575395]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.575417]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.575440]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.575462]  kthread+0x337/0x6f0
[   12.575480]  ? trace_preempt_on+0x20/0xc0
[   12.575503]  ? __pfx_kthread+0x10/0x10
[   12.575522]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.575542]  ? calculate_sigpending+0x7b/0xa0
[   12.575603]  ? __pfx_kthread+0x10/0x10
[   12.575625]  ret_from_fork+0x116/0x1d0
[   12.575643]  ? __pfx_kthread+0x10/0x10
[   12.575664]  ret_from_fork_asm+0x1a/0x30
[   12.575694]  </TASK>
[   12.575704] 
[   12.583729] The buggy address belongs to the physical page:
[   12.583982] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a40
[   12.584447] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   12.584767] flags: 0x200000000000040(head|node=0|zone=2)
[   12.584984] page_type: f8(unknown)
[   12.585174] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   12.585648] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   12.585999] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   12.586409] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   12.586669] head: 0200000000000002 ffffea00040a9001 00000000ffffffff 00000000ffffffff
[   12.586898] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   12.587262] page dumped because: kasan: bad access detected
[   12.587508] 
[   12.587609] Memory state around the buggy address:
[   12.587834]  ffff888102a3ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.588156]  ffff888102a3ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.588610] >ffff888102a40000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.588832]                    ^
[   12.588950]  ffff888102a40080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.589365]  ffff888102a40100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.589743] ==================================================================