Hay
Date
May 12, 2025, 6:12 p.m.

Environment
qemu-arm64
qemu-x86_64

[   18.034437] ==================================================================
[   18.035245] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   18.035976] Free of addr fff00000c6094001 by task kunit_try_catch/139
[   18.036777] 
[   18.037147] CPU: 1 UID: 0 PID: 139 Comm: kunit_try_catch Tainted: G    B            N 6.14.7-rc1 #1
[   18.037380] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.037453] Hardware name: linux,dummy-virt (DT)
[   18.037527] Call trace:
[   18.037565]  show_stack+0x20/0x38 (C)
[   18.037635]  dump_stack_lvl+0x8c/0xd0
[   18.037689]  print_report+0x118/0x608
[   18.037767]  kasan_report_invalid_free+0xc0/0xe8
[   18.037828]  __kasan_kfree_large+0x5c/0xa8
[   18.037880]  free_large_kmalloc+0x58/0x140
[   18.037932]  kfree+0x270/0x3c8
[   18.037978]  kmalloc_large_invalid_free+0x108/0x270
[   18.038031]  kunit_try_run_case+0x170/0x3f0
[   18.038099]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.038156]  kthread+0x318/0x620
[   18.038205]  ret_from_fork+0x10/0x20
[   18.038260] 
[   18.043096] The buggy address belongs to the physical page:
[   18.043298] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106094
[   18.043551] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   18.043878] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   18.044730] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   18.045610] raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   18.046326] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   18.046981] head: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   18.047232] head: 0bfffe0000000002 ffffc1ffc3182501 ffffffffffffffff 0000000000000000
[   18.047463] head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000
[   18.047683] page dumped because: kasan: bad access detected
[   18.048271] 
[   18.048582] Memory state around the buggy address:
[   18.049180]  fff00000c6093f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.049928]  fff00000c6093f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.050521] >fff00000c6094000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.051074]                    ^
[   18.051389]  fff00000c6094080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.051938]  fff00000c6094100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.052594] ==================================================================

[   11.907618] ==================================================================
[   11.908238] BUG: KASAN: invalid-free in kfree+0x276/0x3f0
[   11.908580] Free of addr ffff888102938001 by task kunit_try_catch/158
[   11.908885] 
[   11.909060] CPU: 1 UID: 0 PID: 158 Comm: kunit_try_catch Tainted: G    B            N 6.14.7-rc1 #1
[   11.909126] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.909138] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.909161] Call Trace:
[   11.909176]  <TASK>
[   11.909199]  dump_stack_lvl+0x73/0xb0
[   11.909232]  print_report+0xd1/0x650
[   11.909255]  ? __virt_addr_valid+0x1db/0x2d0
[   11.909280]  ? kasan_addr_to_slab+0x11/0xa0
[   11.909300]  ? kfree+0x276/0x3f0
[   11.909323]  kasan_report_invalid_free+0xfc/0x120
[   11.909346]  ? kfree+0x276/0x3f0
[   11.909368]  ? kfree+0x276/0x3f0
[   11.909388]  __kasan_kfree_large+0x86/0xd0
[   11.909408]  free_large_kmalloc+0x3b/0xd0
[   11.909430]  kfree+0x276/0x3f0
[   11.909451]  ? kmalloc_large_invalid_free+0x90/0x2b0
[   11.909474]  kmalloc_large_invalid_free+0x121/0x2b0
[   11.909495]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   11.909530]  ? __pfx_queued_spin_lock_slowpath+0x10/0x10
[   11.909555]  ? __pfx_read_tsc+0x10/0x10
[   11.909578]  ? ktime_get_ts64+0x86/0x230
[   11.909616]  kunit_try_run_case+0x1a6/0x480
[   11.909641]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.909662]  ? _raw_spin_lock_irqsave+0xfb/0x110
[   11.909681]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.909706]  ? __kthread_parkme+0x82/0x160
[   11.909729]  ? preempt_count_sub+0x50/0x80
[   11.909760]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.909781]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.909806]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.909831]  kthread+0x324/0x6e0
[   11.909861]  ? trace_preempt_on+0x20/0xc0
[   11.909887]  ? __pfx_kthread+0x10/0x10
[   11.909909]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.909932]  ? calculate_sigpending+0x7b/0xa0
[   11.909954]  ? __pfx_kthread+0x10/0x10
[   11.909976]  ret_from_fork+0x41/0x80
[   11.910013]  ? __pfx_kthread+0x10/0x10
[   11.910059]  ret_from_fork_asm+0x1a/0x30
[   11.910091]  </TASK>
[   11.910114] 
[   11.918943] The buggy address belongs to the physical page:
[   11.919351] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102938
[   11.919732] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   11.920075] flags: 0x200000000000040(head|node=0|zone=2)
[   11.920361] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   11.920653] raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   11.921128] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   11.921468] head: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   11.921804] head: 0200000000000002 ffffea00040a4e01 ffffffffffffffff 0000000000000000
[   11.922369] head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000
[   11.922695] page dumped because: kasan: bad access detected
[   11.922961] 
[   11.923147] Memory state around the buggy address:
[   11.923396]  ffff888102937f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.923676]  ffff888102937f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.923968] >ffff888102938000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   11.924356]                    ^
[   11.924524]  ffff888102938080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   11.924848]  ffff888102938100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   11.925278] ==================================================================