Hay
Date
Nov. 27, 2024, 3:37 a.m.

Environment
qemu-arm64
qemu-x86_64

[   46.899686] ==================================================================
[   46.900942] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   46.902133] Free of addr fff00000c6574001 by task kunit_try_catch/139
[   46.903123] 
[   46.903525] CPU: 0 UID: 0 PID: 139 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241127 #1
[   46.904779] Tainted: [B]=BAD_PAGE, [N]=TEST
[   46.905408] Hardware name: linux,dummy-virt (DT)
[   46.905954] Call trace:
[   46.906838]  show_stack+0x20/0x38 (C)
[   46.907323]  dump_stack_lvl+0x8c/0xd0
[   46.907958]  print_report+0x118/0x5e0
[   46.908532]  kasan_report_invalid_free+0xb0/0xd8
[   46.909529]  __kasan_kfree_large+0x5c/0xa8
[   46.910120]  free_large_kmalloc+0x58/0x140
[   46.910702]  kfree+0x270/0x3c8
[   46.911192]  kmalloc_large_invalid_free+0x108/0x270
[   46.912466]  kunit_try_run_case+0x14c/0x3d0
[   46.913432]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   46.914119]  kthread+0x24c/0x2d0
[   46.914794]  ret_from_fork+0x10/0x20
[   46.915371] 
[   46.915729] The buggy address belongs to the physical page:
[   46.916477] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106574
[   46.917579] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   46.918502] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   46.919891] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   46.920956] raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   46.921828] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   46.922986] head: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   46.924005] head: 0bfffe0000000002 ffffc1ffc3195d01 ffffffffffffffff 0000000000000000
[   46.925205] head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000
[   46.926438] page dumped because: kasan: bad access detected
[   46.927251] 
[   46.927588] Memory state around the buggy address:
[   46.928343]  fff00000c6573f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   46.929157]  fff00000c6573f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   46.930357] >fff00000c6574000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   46.931205]                    ^
[   46.931673]  fff00000c6574080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   46.932538]  fff00000c6574100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   46.933802] ==================================================================

[   23.984677] ==================================================================
[   23.986048] BUG: KASAN: invalid-free in kfree+0x271/0x3f0
[   23.987619] Free of addr ffff888102cc0001 by task kunit_try_catch/158
[   23.988611] 
[   23.988899] CPU: 0 UID: 0 PID: 158 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241127 #1
[   23.990602] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.991271] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   23.992206] Call Trace:
[   23.992466]  <TASK>
[   23.992718]  dump_stack_lvl+0x73/0xb0
[   23.993102]  print_report+0xd1/0x640
[   23.993448]  ? __virt_addr_valid+0x1db/0x2d0
[   23.993830]  ? kfree+0x271/0x3f0
[   23.995135]  ? kasan_addr_to_slab+0x11/0xa0
[   23.995970]  ? kfree+0x271/0x3f0
[   23.996760]  kasan_report_invalid_free+0xc0/0xf0
[   23.997599]  ? kfree+0x271/0x3f0
[   23.997897]  ? kfree+0x271/0x3f0
[   23.998448]  __kasan_kfree_large+0x86/0xd0
[   23.999305]  free_large_kmalloc+0x3b/0xd0
[   23.999664]  kfree+0x271/0x3f0
[   23.999842]  kmalloc_large_invalid_free+0x121/0x2b0
[   24.000928]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   24.001567]  ? __schedule+0xc3e/0x2790
[   24.002563]  ? __pfx_read_tsc+0x10/0x10
[   24.003031]  ? ktime_get_ts64+0x84/0x230
[   24.003782]  kunit_try_run_case+0x1b3/0x490
[   24.004163]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.004759]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   24.005913]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   24.006867]  ? __kthread_parkme+0x82/0x160
[   24.007507]  ? preempt_count_sub+0x50/0x80
[   24.008250]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.008664]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   24.009851]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.010676]  kthread+0x257/0x310
[   24.011477]  ? __pfx_kthread+0x10/0x10
[   24.012128]  ret_from_fork+0x41/0x80
[   24.012840]  ? __pfx_kthread+0x10/0x10
[   24.013467]  ret_from_fork_asm+0x1a/0x30
[   24.014269]  </TASK>
[   24.014543] 
[   24.014748] The buggy address belongs to the physical page:
[   24.015826] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102cc0
[   24.016901] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   24.017931] flags: 0x200000000000040(head|node=0|zone=2)
[   24.018733] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   24.019929] raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   24.021086] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   24.021764] head: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   24.023518] head: 0200000000000002 ffffea00040b3001 ffffffffffffffff 0000000000000000
[   24.024251] head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000
[   24.024800] page dumped because: kasan: bad access detected
[   24.025696] 
[   24.025937] Memory state around the buggy address:
[   24.026897]  ffff888102cbff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.028039]  ffff888102cbff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.029613] >ffff888102cc0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   24.030292]                    ^
[   24.031062]  ffff888102cc0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   24.032356]  ffff888102cc0100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   24.032964] ==================================================================