Hay
Date
Nov. 20, 2024, 6:35 a.m.

Environment
qemu-arm64
qemu-x86_64

[   35.816090] ==================================================================
[   35.817224] BUG: KASAN: invalid-free in kfree+0x278/0x3d0
[   35.818372] Free of addr fff00000c6730001 by task kunit_try_catch/139
[   35.819801] 
[   35.820185] CPU: 1 UID: 0 PID: 139 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241120 #1
[   35.821255] Tainted: [B]=BAD_PAGE, [N]=TEST
[   35.821987] Hardware name: linux,dummy-virt (DT)
[   35.822426] Call trace:
[   35.822833]  show_stack+0x20/0x38 (C)
[   35.823430]  dump_stack_lvl+0x8c/0xd0
[   35.824043]  print_report+0x118/0x5e0
[   35.824594]  kasan_report_invalid_free+0xb0/0xd8
[   35.825216]  __kasan_kfree_large+0x5c/0xa8
[   35.825835]  free_large_kmalloc+0x58/0x140
[   35.826464]  kfree+0x278/0x3d0
[   35.827006]  kmalloc_large_invalid_free+0x108/0x270
[   35.827792]  kunit_try_run_case+0x14c/0x3d0
[   35.828466]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   35.829137]  kthread+0x24c/0x2d0
[   35.829887]  ret_from_fork+0x10/0x20
[   35.830487] 
[   35.830820] The buggy address belongs to the physical page:
[   35.831344] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106730
[   35.832282] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   35.833023] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   35.834242] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   35.835104] raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   35.836118] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   35.836943] head: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   35.837739] head: 0bfffe0000000002 ffffc1ffc319cc01 ffffffffffffffff 0000000000000000
[   35.838553] head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000
[   35.839312] page dumped because: kasan: bad access detected
[   35.840854] 
[   35.841266] Memory state around the buggy address:
[   35.842132]  fff00000c672ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   35.843147]  fff00000c672ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   35.843979] >fff00000c6730000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   35.844848]                    ^
[   35.845772]  fff00000c6730080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   35.846521]  fff00000c6730100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   35.847305] ==================================================================

[   27.056851] ==================================================================
[   27.058251] BUG: KASAN: invalid-free in kfree+0x271/0x3f0
[   27.059198] Free of addr ffff888102320001 by task kunit_try_catch/157
[   27.060132] 
[   27.061417] CPU: 0 UID: 0 PID: 157 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241120 #1
[   27.062493] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.063518] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   27.064320] Call Trace:
[   27.065149]  <TASK>
[   27.065385]  dump_stack_lvl+0x73/0xb0
[   27.065719]  print_report+0xd1/0x640
[   27.066544]  ? __virt_addr_valid+0x1db/0x2d0
[   27.067313]  ? kfree+0x271/0x3f0
[   27.067647]  ? kasan_addr_to_slab+0x11/0xa0
[   27.068419]  ? kfree+0x271/0x3f0
[   27.069114]  kasan_report_invalid_free+0xc0/0xf0
[   27.069587]  ? kfree+0x271/0x3f0
[   27.069973]  ? kfree+0x271/0x3f0
[   27.070346]  __kasan_kfree_large+0x86/0xd0
[   27.071594]  free_large_kmalloc+0x3b/0xd0
[   27.072182]  kfree+0x271/0x3f0
[   27.072635]  kmalloc_large_invalid_free+0x121/0x2b0
[   27.073201]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   27.073813]  ? __schedule+0xc3e/0x2790
[   27.074444]  ? __pfx_read_tsc+0x10/0x10
[   27.075242]  ? ktime_get_ts64+0x84/0x230
[   27.076090]  kunit_try_run_case+0x1b3/0x490
[   27.076514]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.077646]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   27.078439]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   27.078791]  ? __kthread_parkme+0x82/0x160
[   27.079228]  ? preempt_count_sub+0x50/0x80
[   27.079639]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.080025]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   27.080635]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.081207]  kthread+0x257/0x310
[   27.081571]  ? __pfx_kthread+0x10/0x10
[   27.082577]  ret_from_fork+0x41/0x80
[   27.083123]  ? __pfx_kthread+0x10/0x10
[   27.083429]  ret_from_fork_asm+0x1a/0x30
[   27.084126]  </TASK>
[   27.084419] 
[   27.084635] The buggy address belongs to the physical page:
[   27.085335] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102320
[   27.085821] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   27.086945] flags: 0x200000000000040(head|node=0|zone=2)
[   27.087844] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   27.088559] raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   27.090174] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   27.091019] head: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   27.091906] head: 0200000000000002 ffffea000408c801 ffffffffffffffff 0000000000000000
[   27.092523] head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000
[   27.093445] page dumped because: kasan: bad access detected
[   27.094126] 
[   27.094274] Memory state around the buggy address:
[   27.095088]  ffff88810231ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.095871]  ffff88810231ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.096604] >ffff888102320000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   27.097207]                    ^
[   27.097569]  ffff888102320080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   27.098778]  ffff888102320100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   27.099518] ==================================================================