Hay
Date
July 3, 2025, 6:13 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.563786] ==================================================================
[   16.564209] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   16.564572] Free of addr fff00000c7804001 by task kunit_try_catch/150
[   16.564675] 
[   16.564735] CPU: 0 UID: 0 PID: 150 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   16.564961] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.565261] Hardware name: linux,dummy-virt (DT)
[   16.565303] Call trace:
[   16.565325]  show_stack+0x20/0x38 (C)
[   16.565607]  dump_stack_lvl+0x8c/0xd0
[   16.565669]  print_report+0x118/0x608
[   16.565797]  kasan_report_invalid_free+0xc0/0xe8
[   16.565851]  __kasan_kfree_large+0x5c/0xa8
[   16.565919]  free_large_kmalloc+0x64/0x190
[   16.566156]  kfree+0x270/0x3c8
[   16.566352]  kmalloc_large_invalid_free+0x108/0x270
[   16.566570]  kunit_try_run_case+0x170/0x3f0
[   16.566705]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.566777]  kthread+0x328/0x630
[   16.566981]  ret_from_fork+0x10/0x20
[   16.567208] 
[   16.567244] The buggy address belongs to the physical page:
[   16.567275] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107804
[   16.567329] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   16.567401] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   16.567453] page_type: f8(unknown)
[   16.567490] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   16.567537] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   16.567584] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   16.567651] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   16.567698] head: 0bfffe0000000002 ffffc1ffc31e0101 00000000ffffffff 00000000ffffffff
[   16.567743] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   16.567780] page dumped because: kasan: bad access detected
[   16.567810] 
[   16.567827] Memory state around the buggy address:
[   16.567857]  fff00000c7803f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.567897]  fff00000c7803f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.567937] >fff00000c7804000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.567972]                    ^
[   16.567999]  fff00000c7804080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.568059]  fff00000c7804100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.568129] ==================================================================

[   11.007542] ==================================================================
[   11.008040] BUG: KASAN: invalid-free in kfree+0x274/0x3f0
[   11.009090] Free of addr ffff8881029fc001 by task kunit_try_catch/168
[   11.010015] 
[   11.010373] CPU: 0 UID: 0 PID: 168 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   11.010418] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.010430] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.010450] Call Trace:
[   11.010462]  <TASK>
[   11.010476]  dump_stack_lvl+0x73/0xb0
[   11.010503]  print_report+0xd1/0x650
[   11.010524]  ? __virt_addr_valid+0x1db/0x2d0
[   11.010546]  ? kasan_addr_to_slab+0x11/0xa0
[   11.010565]  ? kfree+0x274/0x3f0
[   11.010586]  kasan_report_invalid_free+0x10a/0x130
[   11.010609]  ? kfree+0x274/0x3f0
[   11.010631]  ? kfree+0x274/0x3f0
[   11.010650]  __kasan_kfree_large+0x86/0xd0
[   11.010670]  free_large_kmalloc+0x4b/0x110
[   11.010693]  kfree+0x274/0x3f0
[   11.010717]  kmalloc_large_invalid_free+0x120/0x2b0
[   11.010738]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   11.010760]  ? __schedule+0x10cc/0x2b60
[   11.010780]  ? __pfx_read_tsc+0x10/0x10
[   11.010799]  ? ktime_get_ts64+0x86/0x230
[   11.010821]  kunit_try_run_case+0x1a5/0x480
[   11.010843]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.010864]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.010885]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.010906]  ? __kthread_parkme+0x82/0x180
[   11.010925]  ? preempt_count_sub+0x50/0x80
[   11.010947]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.010969]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.010990]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.011012]  kthread+0x337/0x6f0
[   11.011030]  ? trace_preempt_on+0x20/0xc0
[   11.011052]  ? __pfx_kthread+0x10/0x10
[   11.011072]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.011091]  ? calculate_sigpending+0x7b/0xa0
[   11.011125]  ? __pfx_kthread+0x10/0x10
[   11.011146]  ret_from_fork+0x116/0x1d0
[   11.011164]  ? __pfx_kthread+0x10/0x10
[   11.011183]  ret_from_fork_asm+0x1a/0x30
[   11.011218]  </TASK>
[   11.011229] 
[   11.026561] The buggy address belongs to the physical page:
[   11.026761] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1029fc
[   11.027013] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   11.027286] flags: 0x200000000000040(head|node=0|zone=2)
[   11.027982] page_type: f8(unknown)
[   11.028493] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   11.029366] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   11.030130] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   11.031019] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   11.031813] head: 0200000000000002 ffffea00040a7f01 00000000ffffffff 00000000ffffffff
[   11.032584] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   11.032811] page dumped because: kasan: bad access detected
[   11.032980] 
[   11.033048] Memory state around the buggy address:
[   11.033236]  ffff8881029fbf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.034074]  ffff8881029fbf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.034835] >ffff8881029fc000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   11.035595]                    ^
[   11.035944]  ffff8881029fc080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   11.036670]  ffff8881029fc100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   11.037706] ==================================================================