Hay
Date
July 5, 2025, 5:09 p.m.

Environment
qemu-arm64
qemu-x86_64

[   20.261312] ==================================================================
[   20.261395] BUG: KASAN: invalid-free in mempool_kmalloc_invalid_free_helper+0x118/0x2a8
[   20.261461] Free of addr fff00000c7968001 by task kunit_try_catch/243
[   20.261502] 
[   20.261533] CPU: 0 UID: 0 PID: 243 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   20.261851] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.261946] Hardware name: linux,dummy-virt (DT)
[   20.261982] Call trace:
[   20.262011]  show_stack+0x20/0x38 (C)
[   20.262289]  dump_stack_lvl+0x8c/0xd0
[   20.262375]  print_report+0x118/0x608
[   20.262478]  kasan_report_invalid_free+0xc0/0xe8
[   20.262533]  __kasan_mempool_poison_object+0xfc/0x150
[   20.262629]  mempool_free+0x28c/0x328
[   20.262677]  mempool_kmalloc_invalid_free_helper+0x118/0x2a8
[   20.262728]  mempool_kmalloc_large_invalid_free+0xc0/0x118
[   20.263046]  kunit_try_run_case+0x170/0x3f0
[   20.263254]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.263329]  kthread+0x328/0x630
[   20.263563]  ret_from_fork+0x10/0x20
[   20.263745] 
[   20.263869] The buggy address belongs to the physical page:
[   20.263939] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107968
[   20.264079] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   20.264145] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   20.264339] page_type: f8(unknown)
[   20.264409] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   20.264521] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   20.264689] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   20.264801] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   20.264852] head: 0bfffe0000000002 ffffc1ffc31e5a01 00000000ffffffff 00000000ffffffff
[   20.264952] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   20.265143] page dumped because: kasan: bad access detected
[   20.265280] 
[   20.265341] Memory state around the buggy address:
[   20.265474]  fff00000c7967f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   20.265540]  fff00000c7967f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   20.265583] >fff00000c7968000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.265628]                    ^
[   20.265803]  fff00000c7968080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.266039]  fff00000c7968100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.266161] ==================================================================
[   20.248901] ==================================================================
[   20.249022] BUG: KASAN: invalid-free in mempool_kmalloc_invalid_free_helper+0x118/0x2a8
[   20.249096] Free of addr fff00000c6398801 by task kunit_try_catch/241
[   20.249148] 
[   20.249179] CPU: 0 UID: 0 PID: 241 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   20.249272] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.249299] Hardware name: linux,dummy-virt (DT)
[   20.249338] Call trace:
[   20.249359]  show_stack+0x20/0x38 (C)
[   20.249409]  dump_stack_lvl+0x8c/0xd0
[   20.249455]  print_report+0x118/0x608
[   20.249502]  kasan_report_invalid_free+0xc0/0xe8
[   20.249560]  check_slab_allocation+0xfc/0x108
[   20.249607]  __kasan_mempool_poison_object+0x78/0x150
[   20.249658]  mempool_free+0x28c/0x328
[   20.249700]  mempool_kmalloc_invalid_free_helper+0x118/0x2a8
[   20.249753]  mempool_kmalloc_invalid_free+0xc0/0x118
[   20.249800]  kunit_try_run_case+0x170/0x3f0
[   20.249848]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.250254]  kthread+0x328/0x630
[   20.250331]  ret_from_fork+0x10/0x20
[   20.250463] 
[   20.250492] Allocated by task 241:
[   20.250528]  kasan_save_stack+0x3c/0x68
[   20.250571]  kasan_save_track+0x20/0x40
[   20.250617]  kasan_save_alloc_info+0x40/0x58
[   20.250701]  __kasan_mempool_unpoison_object+0x11c/0x180
[   20.250782]  remove_element+0x130/0x1f8
[   20.250932]  mempool_alloc_preallocated+0x58/0xc0
[   20.250987]  mempool_kmalloc_invalid_free_helper+0x94/0x2a8
[   20.251030]  mempool_kmalloc_invalid_free+0xc0/0x118
[   20.251077]  kunit_try_run_case+0x170/0x3f0
[   20.251115]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.251432]  kthread+0x328/0x630
[   20.251513]  ret_from_fork+0x10/0x20
[   20.251633] 
[   20.251658] The buggy address belongs to the object at fff00000c6398800
[   20.251658]  which belongs to the cache kmalloc-128 of size 128
[   20.251906] The buggy address is located 1 bytes inside of
[   20.251906]  128-byte region [fff00000c6398800, fff00000c6398880)
[   20.252116] 
[   20.252147] The buggy address belongs to the physical page:
[   20.252205] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106398
[   20.252339] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   20.252404] page_type: f5(slab)
[   20.252481] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   20.252582] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   20.252623] page dumped because: kasan: bad access detected
[   20.252653] 
[   20.252670] Memory state around the buggy address:
[   20.252884]  fff00000c6398700: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   20.253046]  fff00000c6398780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.253131] >fff00000c6398800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.253278]                    ^
[   20.253347]  fff00000c6398880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.253510]  fff00000c6398900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.253599] ==================================================================

[   13.340876] ==================================================================
[   13.342120] BUG: KASAN: invalid-free in mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   13.342918] Free of addr ffff888103960001 by task kunit_try_catch/261
[   13.343626] 
[   13.343814] CPU: 1 UID: 0 PID: 261 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   13.343861] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.343874] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.343897] Call Trace:
[   13.343910]  <TASK>
[   13.343929]  dump_stack_lvl+0x73/0xb0
[   13.343959]  print_report+0xd1/0x650
[   13.343981]  ? __virt_addr_valid+0x1db/0x2d0
[   13.344006]  ? kasan_addr_to_slab+0x11/0xa0
[   13.344026]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   13.344052]  kasan_report_invalid_free+0x10a/0x130
[   13.344076]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   13.344104]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   13.344128]  __kasan_mempool_poison_object+0x102/0x1d0
[   13.344152]  mempool_free+0x2ec/0x380
[   13.344175]  mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   13.344211]  ? __pfx_mempool_kmalloc_invalid_free_helper+0x10/0x10
[   13.344236]  ? update_curr+0x5c1/0x810
[   13.344265]  mempool_kmalloc_large_invalid_free+0xed/0x140
[   13.344290]  ? __pfx_mempool_kmalloc_large_invalid_free+0x10/0x10
[   13.344313]  ? schedule+0x7c/0x2e0
[   13.344336]  ? __pfx_mempool_kmalloc+0x10/0x10
[   13.344358]  ? __pfx_mempool_kfree+0x10/0x10
[   13.344383]  ? __pfx_read_tsc+0x10/0x10
[   13.344405]  ? ktime_get_ts64+0x86/0x230
[   13.344429]  kunit_try_run_case+0x1a5/0x480
[   13.344465]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.344489]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.344513]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.344535]  ? __kthread_parkme+0x82/0x180
[   13.344556]  ? preempt_count_sub+0x50/0x80
[   13.344580]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.344602]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.344625]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.344647]  kthread+0x337/0x6f0
[   13.344667]  ? trace_preempt_on+0x20/0xc0
[   13.344690]  ? __pfx_kthread+0x10/0x10
[   13.344711]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.344732]  ? calculate_sigpending+0x7b/0xa0
[   13.344755]  ? __pfx_kthread+0x10/0x10
[   13.344776]  ret_from_fork+0x116/0x1d0
[   13.344794]  ? __pfx_kthread+0x10/0x10
[   13.344814]  ret_from_fork_asm+0x1a/0x30
[   13.344844]  </TASK>
[   13.344855] 
[   13.356768] The buggy address belongs to the physical page:
[   13.356996] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103960
[   13.357534] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   13.357887] flags: 0x200000000000040(head|node=0|zone=2)
[   13.358164] page_type: f8(unknown)
[   13.358342] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   13.358593] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   13.359007] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   13.359357] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   13.359664] head: 0200000000000002 ffffea00040e5801 00000000ffffffff 00000000ffffffff
[   13.360022] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   13.360490] page dumped because: kasan: bad access detected
[   13.360744] 
[   13.360844] Memory state around the buggy address:
[   13.361043]  ffff88810395ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.361337]  ffff88810395ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.361828] >ffff888103960000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.362170]                    ^
[   13.362330]  ffff888103960080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.362632]  ffff888103960100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.362995] ==================================================================
[   13.299959] ==================================================================
[   13.300701] BUG: KASAN: invalid-free in mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   13.301031] Free of addr ffff8881031c1501 by task kunit_try_catch/259
[   13.301236] 
[   13.302359] CPU: 0 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   13.302413] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.302425] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.302447] Call Trace:
[   13.302475]  <TASK>
[   13.302491]  dump_stack_lvl+0x73/0xb0
[   13.302522]  print_report+0xd1/0x650
[   13.302547]  ? __virt_addr_valid+0x1db/0x2d0
[   13.302570]  ? kasan_complete_mode_report_info+0x2a/0x200
[   13.302593]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   13.302619]  kasan_report_invalid_free+0x10a/0x130
[   13.302642]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   13.302953]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   13.303856]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   13.303958]  check_slab_allocation+0x11f/0x130
[   13.303983]  __kasan_mempool_poison_object+0x91/0x1d0
[   13.304008]  mempool_free+0x2ec/0x380
[   13.304032]  mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   13.304058]  ? __pfx_mempool_kmalloc_invalid_free_helper+0x10/0x10
[   13.304083]  ? update_load_avg+0x1be/0x21b0
[   13.304110]  ? finish_task_switch.isra.0+0x153/0x700
[   13.304135]  mempool_kmalloc_invalid_free+0xed/0x140
[   13.304158]  ? __pfx_mempool_kmalloc_invalid_free+0x10/0x10
[   13.304206]  ? __pfx_mempool_kmalloc+0x10/0x10
[   13.304229]  ? __pfx_mempool_kfree+0x10/0x10
[   13.304253]  ? __pfx_read_tsc+0x10/0x10
[   13.304274]  ? ktime_get_ts64+0x86/0x230
[   13.304297]  kunit_try_run_case+0x1a5/0x480
[   13.304321]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.304343]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.304366]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.304389]  ? __kthread_parkme+0x82/0x180
[   13.304408]  ? preempt_count_sub+0x50/0x80
[   13.304431]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.304473]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.304495]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.304519]  kthread+0x337/0x6f0
[   13.304538]  ? trace_preempt_on+0x20/0xc0
[   13.304561]  ? __pfx_kthread+0x10/0x10
[   13.304582]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.304603]  ? calculate_sigpending+0x7b/0xa0
[   13.304627]  ? __pfx_kthread+0x10/0x10
[   13.304649]  ret_from_fork+0x116/0x1d0
[   13.304683]  ? __pfx_kthread+0x10/0x10
[   13.304703]  ret_from_fork_asm+0x1a/0x30
[   13.304733]  </TASK>
[   13.304745] 
[   13.321157] Allocated by task 259:
[   13.322087]  kasan_save_stack+0x45/0x70
[   13.322647]  kasan_save_track+0x18/0x40
[   13.323104]  kasan_save_alloc_info+0x3b/0x50
[   13.323575]  __kasan_mempool_unpoison_object+0x1a9/0x200
[   13.324138]  remove_element+0x11e/0x190
[   13.324751]  mempool_alloc_preallocated+0x4d/0x90
[   13.325154]  mempool_kmalloc_invalid_free_helper+0x83/0x2e0
[   13.325671]  mempool_kmalloc_invalid_free+0xed/0x140
[   13.325969]  kunit_try_run_case+0x1a5/0x480
[   13.326119]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.326367]  kthread+0x337/0x6f0
[   13.326677]  ret_from_fork+0x116/0x1d0
[   13.327058]  ret_from_fork_asm+0x1a/0x30
[   13.327511] 
[   13.327696] The buggy address belongs to the object at ffff8881031c1500
[   13.327696]  which belongs to the cache kmalloc-128 of size 128
[   13.329090] The buggy address is located 1 bytes inside of
[   13.329090]  128-byte region [ffff8881031c1500, ffff8881031c1580)
[   13.329833] 
[   13.330002] The buggy address belongs to the physical page:
[   13.330535] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1031c1
[   13.330994] flags: 0x200000000000000(node=0|zone=2)
[   13.331166] page_type: f5(slab)
[   13.331530] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   13.332384] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   13.333102] page dumped because: kasan: bad access detected
[   13.333641] 
[   13.333786] Memory state around the buggy address:
[   13.334192]  ffff8881031c1400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   13.334605]  ffff8881031c1480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.335160] >ffff8881031c1500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.335911]                    ^
[   13.336223]  ffff8881031c1580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.336765]  ffff8881031c1600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.336996] ==================================================================