Hay
Date
July 19, 2025, 11:12 p.m.

Environment
qemu-arm64
qemu-x86_64

[   17.412293] ==================================================================
[   17.412359] BUG: KASAN: invalid-free in mempool_kmalloc_invalid_free_helper+0x118/0x2a8
[   17.412416] Free of addr fff00000c790e101 by task kunit_try_catch/241
[   17.412471] 
[   17.412504] CPU: 0 UID: 0 PID: 241 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   17.412612] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.412948] Hardware name: linux,dummy-virt (DT)
[   17.413043] Call trace:
[   17.413089]  show_stack+0x20/0x38 (C)
[   17.413139]  dump_stack_lvl+0x8c/0xd0
[   17.413197]  print_report+0x118/0x5d0
[   17.413359]  kasan_report_invalid_free+0xc0/0xe8
[   17.413427]  check_slab_allocation+0xfc/0x108
[   17.413488]  __kasan_mempool_poison_object+0x78/0x150
[   17.413703]  mempool_free+0x28c/0x328
[   17.413749]  mempool_kmalloc_invalid_free_helper+0x118/0x2a8
[   17.413801]  mempool_kmalloc_invalid_free+0xc0/0x118
[   17.413871]  kunit_try_run_case+0x170/0x3f0
[   17.414089]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.414204]  kthread+0x328/0x630
[   17.414309]  ret_from_fork+0x10/0x20
[   17.414533] 
[   17.414607] Allocated by task 241:
[   17.414638]  kasan_save_stack+0x3c/0x68
[   17.414938]  kasan_save_track+0x20/0x40
[   17.415127]  kasan_save_alloc_info+0x40/0x58
[   17.415168]  __kasan_mempool_unpoison_object+0x11c/0x180
[   17.415210]  remove_element+0x130/0x1f8
[   17.415245]  mempool_alloc_preallocated+0x58/0xc0
[   17.415283]  mempool_kmalloc_invalid_free_helper+0x94/0x2a8
[   17.415325]  mempool_kmalloc_invalid_free+0xc0/0x118
[   17.415460]  kunit_try_run_case+0x170/0x3f0
[   17.415500]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.415542]  kthread+0x328/0x630
[   17.416032]  ret_from_fork+0x10/0x20
[   17.416245] 
[   17.416301] The buggy address belongs to the object at fff00000c790e100
[   17.416301]  which belongs to the cache kmalloc-128 of size 128
[   17.416361] The buggy address is located 1 bytes inside of
[   17.416361]  128-byte region [fff00000c790e100, fff00000c790e180)
[   17.416420] 
[   17.416441] The buggy address belongs to the physical page:
[   17.416521] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10790e
[   17.416767] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.416820] page_type: f5(slab)
[   17.417008] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   17.417077] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   17.417119] page dumped because: kasan: bad access detected
[   17.417152] 
[   17.417169] Memory state around the buggy address:
[   17.417201]  fff00000c790e000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   17.417244]  fff00000c790e080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.417348] >fff00000c790e100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   17.417432]                    ^
[   17.417506]  fff00000c790e180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.417583]  fff00000c790e200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   17.418195] ==================================================================
[   17.427304] ==================================================================
[   17.427368] BUG: KASAN: invalid-free in mempool_kmalloc_invalid_free_helper+0x118/0x2a8
[   17.427422] Free of addr fff00000c78e8001 by task kunit_try_catch/243
[   17.427463] 
[   17.427492] CPU: 0 UID: 0 PID: 243 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   17.427653] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.427679] Hardware name: linux,dummy-virt (DT)
[   17.427722] Call trace:
[   17.427743]  show_stack+0x20/0x38 (C)
[   17.427793]  dump_stack_lvl+0x8c/0xd0
[   17.428119]  print_report+0x118/0x5d0
[   17.428245]  kasan_report_invalid_free+0xc0/0xe8
[   17.428302]  __kasan_mempool_poison_object+0xfc/0x150
[   17.428372]  mempool_free+0x28c/0x328
[   17.428417]  mempool_kmalloc_invalid_free_helper+0x118/0x2a8
[   17.428469]  mempool_kmalloc_large_invalid_free+0xc0/0x118
[   17.428543]  kunit_try_run_case+0x170/0x3f0
[   17.428593]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.428645]  kthread+0x328/0x630
[   17.428696]  ret_from_fork+0x10/0x20
[   17.428988] 
[   17.429011] The buggy address belongs to the physical page:
[   17.429044] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1078e8
[   17.429098] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   17.429155] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   17.429208] page_type: f8(unknown)
[   17.429270] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   17.429611] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   17.429665] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   17.429726] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   17.429776] head: 0bfffe0000000002 ffffc1ffc31e3a01 00000000ffffffff 00000000ffffffff
[   17.429965] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   17.430028] page dumped because: kasan: bad access detected
[   17.430130] 
[   17.430172] Memory state around the buggy address:
[   17.430272]  fff00000c78e7f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.430401]  fff00000c78e7f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.430515] >fff00000c78e8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   17.430554]                    ^
[   17.430612]  fff00000c78e8080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   17.430779]  fff00000c78e8100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   17.430896] ==================================================================

[   13.720182] ==================================================================
[   13.721289] BUG: KASAN: invalid-free in mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   13.721842] Free of addr ffff888102fd1a01 by task kunit_try_catch/258
[   13.722122] 
[   13.722230] CPU: 0 UID: 0 PID: 258 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   13.722273] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.722284] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.722304] Call Trace:
[   13.722315]  <TASK>
[   13.722329]  dump_stack_lvl+0x73/0xb0
[   13.722359]  print_report+0xd1/0x610
[   13.722380]  ? __virt_addr_valid+0x1db/0x2d0
[   13.722402]  ? kasan_complete_mode_report_info+0x2a/0x200
[   13.722423]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   13.722448]  kasan_report_invalid_free+0x10a/0x130
[   13.722471]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   13.722497]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   13.722520]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   13.722543]  check_slab_allocation+0x11f/0x130
[   13.722564]  __kasan_mempool_poison_object+0x91/0x1d0
[   13.722587]  mempool_free+0x2ec/0x380
[   13.722613]  mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   13.722638]  ? __pfx_mempool_kmalloc_invalid_free_helper+0x10/0x10
[   13.722663]  ? __kasan_check_write+0x18/0x20
[   13.722682]  ? __pfx_sched_clock_cpu+0x10/0x10
[   13.722702]  ? finish_task_switch.isra.0+0x153/0x700
[   13.722727]  mempool_kmalloc_invalid_free+0xed/0x140
[   13.722749]  ? __pfx_mempool_kmalloc_invalid_free+0x10/0x10
[   13.722775]  ? __pfx_mempool_kmalloc+0x10/0x10
[   13.722796]  ? __pfx_mempool_kfree+0x10/0x10
[   13.722820]  ? __pfx_read_tsc+0x10/0x10
[   13.722840]  ? ktime_get_ts64+0x86/0x230
[   13.722863]  kunit_try_run_case+0x1a5/0x480
[   13.722887]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.722909]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.722932]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.722955]  ? __kthread_parkme+0x82/0x180
[   13.722974]  ? preempt_count_sub+0x50/0x80
[   13.722996]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.723031]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.723053]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.723077]  kthread+0x337/0x6f0
[   13.723096]  ? trace_preempt_on+0x20/0xc0
[   13.723119]  ? __pfx_kthread+0x10/0x10
[   13.723139]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.723159]  ? calculate_sigpending+0x7b/0xa0
[   13.723183]  ? __pfx_kthread+0x10/0x10
[   13.723203]  ret_from_fork+0x116/0x1d0
[   13.723221]  ? __pfx_kthread+0x10/0x10
[   13.723240]  ret_from_fork_asm+0x1a/0x30
[   13.723270]  </TASK>
[   13.723280] 
[   13.732510] Allocated by task 258:
[   13.732696]  kasan_save_stack+0x45/0x70
[   13.732903]  kasan_save_track+0x18/0x40
[   13.733114]  kasan_save_alloc_info+0x3b/0x50
[   13.733298]  __kasan_mempool_unpoison_object+0x1a9/0x200
[   13.733602]  remove_element+0x11e/0x190
[   13.733796]  mempool_alloc_preallocated+0x4d/0x90
[   13.733970]  mempool_kmalloc_invalid_free_helper+0x83/0x2e0
[   13.734210]  mempool_kmalloc_invalid_free+0xed/0x140
[   13.734597]  kunit_try_run_case+0x1a5/0x480
[   13.734798]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.735034]  kthread+0x337/0x6f0
[   13.735193]  ret_from_fork+0x116/0x1d0
[   13.735423]  ret_from_fork_asm+0x1a/0x30
[   13.735602] 
[   13.735702] The buggy address belongs to the object at ffff888102fd1a00
[   13.735702]  which belongs to the cache kmalloc-128 of size 128
[   13.736183] The buggy address is located 1 bytes inside of
[   13.736183]  128-byte region [ffff888102fd1a00, ffff888102fd1a80)
[   13.736700] 
[   13.736802] The buggy address belongs to the physical page:
[   13.737045] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102fd1
[   13.737350] flags: 0x200000000000000(node=0|zone=2)
[   13.737513] page_type: f5(slab)
[   13.737632] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   13.737862] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   13.738137] page dumped because: kasan: bad access detected
[   13.738387] 
[   13.738499] Memory state around the buggy address:
[   13.738720]  ffff888102fd1900: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   13.739043]  ffff888102fd1980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.739258] >ffff888102fd1a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.739803]                    ^
[   13.739980]  ffff888102fd1a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.740309]  ffff888102fd1b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.740761] ==================================================================
[   13.745938] ==================================================================
[   13.746419] BUG: KASAN: invalid-free in mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   13.746960] Free of addr ffff8881039f8001 by task kunit_try_catch/260
[   13.747223] 
[   13.747333] CPU: 1 UID: 0 PID: 260 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   13.747375] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.747386] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.747407] Call Trace:
[   13.747418]  <TASK>
[   13.747431]  dump_stack_lvl+0x73/0xb0
[   13.747458]  print_report+0xd1/0x610
[   13.747479]  ? __virt_addr_valid+0x1db/0x2d0
[   13.747514]  ? kasan_addr_to_slab+0x11/0xa0
[   13.747533]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   13.747558]  kasan_report_invalid_free+0x10a/0x130
[   13.747581]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   13.747608]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   13.747631]  __kasan_mempool_poison_object+0x102/0x1d0
[   13.747654]  mempool_free+0x2ec/0x380
[   13.747679]  mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   13.747704]  ? __pfx_mempool_kmalloc_invalid_free_helper+0x10/0x10
[   13.747730]  ? __pfx_sched_clock_cpu+0x10/0x10
[   13.747751]  ? finish_task_switch.isra.0+0x153/0x700
[   13.747775]  mempool_kmalloc_large_invalid_free+0xed/0x140
[   13.747799]  ? __pfx_mempool_kmalloc_large_invalid_free+0x10/0x10
[   13.747826]  ? __pfx_mempool_kmalloc+0x10/0x10
[   13.747848]  ? __pfx_mempool_kfree+0x10/0x10
[   13.747873]  ? __pfx_read_tsc+0x10/0x10
[   13.747893]  ? ktime_get_ts64+0x86/0x230
[   13.747916]  kunit_try_run_case+0x1a5/0x480
[   13.747939]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.747960]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.747982]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.748014]  ? __kthread_parkme+0x82/0x180
[   13.748042]  ? preempt_count_sub+0x50/0x80
[   13.748064]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.748107]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.748129]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.748152]  kthread+0x337/0x6f0
[   13.748170]  ? trace_preempt_on+0x20/0xc0
[   13.748193]  ? __pfx_kthread+0x10/0x10
[   13.748212]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.748232]  ? calculate_sigpending+0x7b/0xa0
[   13.748254]  ? __pfx_kthread+0x10/0x10
[   13.748274]  ret_from_fork+0x116/0x1d0
[   13.748291]  ? __pfx_kthread+0x10/0x10
[   13.748311]  ret_from_fork_asm+0x1a/0x30
[   13.748340]  </TASK>
[   13.748351] 
[   13.757354] The buggy address belongs to the physical page:
[   13.757772] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1039f8
[   13.758139] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   13.758367] flags: 0x200000000000040(head|node=0|zone=2)
[   13.758622] page_type: f8(unknown)
[   13.758803] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   13.759157] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   13.759528] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   13.759775] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   13.760055] head: 0200000000000002 ffffea00040e7e01 00000000ffffffff 00000000ffffffff
[   13.760391] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   13.761042] page dumped because: kasan: bad access detected
[   13.761216] 
[   13.761285] Memory state around the buggy address:
[   13.761439]  ffff8881039f7f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.761674]  ffff8881039f7f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.761988] >ffff8881039f8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.762313]                    ^
[   13.762477]  ffff8881039f8080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.762776]  ffff8881039f8100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.762991] ==================================================================