Hay
Date
July 10, 2025, 6:10 p.m.

Environment
qemu-arm64
qemu-x86_64

[   19.017309] ==================================================================
[   19.017653] BUG: KASAN: invalid-free in mempool_kmalloc_invalid_free_helper+0x118/0x2a8
[   19.017716] Free of addr fff00000c5a57701 by task kunit_try_catch/241
[   19.017757] 
[   19.017795] CPU: 0 UID: 0 PID: 241 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   19.017986] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.018022] Hardware name: linux,dummy-virt (DT)
[   19.018055] Call trace:
[   19.018077]  show_stack+0x20/0x38 (C)
[   19.018132]  dump_stack_lvl+0x8c/0xd0
[   19.018653]  print_report+0x118/0x608
[   19.018747]  kasan_report_invalid_free+0xc0/0xe8
[   19.018801]  check_slab_allocation+0xfc/0x108
[   19.018905]  __kasan_mempool_poison_object+0x78/0x150
[   19.019100]  mempool_free+0x28c/0x328
[   19.019194]  mempool_kmalloc_invalid_free_helper+0x118/0x2a8
[   19.019352]  mempool_kmalloc_invalid_free+0xc0/0x118
[   19.019450]  kunit_try_run_case+0x170/0x3f0
[   19.019500]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.019555]  kthread+0x328/0x630
[   19.019597]  ret_from_fork+0x10/0x20
[   19.019655] 
[   19.019674] Allocated by task 241:
[   19.019707]  kasan_save_stack+0x3c/0x68
[   19.020181]  kasan_save_track+0x20/0x40
[   19.020568]  kasan_save_alloc_info+0x40/0x58
[   19.020629]  __kasan_mempool_unpoison_object+0x11c/0x180
[   19.020673]  remove_element+0x130/0x1f8
[   19.020712]  mempool_alloc_preallocated+0x58/0xc0
[   19.021135]  mempool_kmalloc_invalid_free_helper+0x94/0x2a8
[   19.021219]  mempool_kmalloc_invalid_free+0xc0/0x118
[   19.021661]  kunit_try_run_case+0x170/0x3f0
[   19.021760]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.021804]  kthread+0x328/0x630
[   19.021901]  ret_from_fork+0x10/0x20
[   19.021985] 
[   19.022004] The buggy address belongs to the object at fff00000c5a57700
[   19.022004]  which belongs to the cache kmalloc-128 of size 128
[   19.022327] The buggy address is located 1 bytes inside of
[   19.022327]  128-byte region [fff00000c5a57700, fff00000c5a57780)
[   19.022408] 
[   19.022432] The buggy address belongs to the physical page:
[   19.022464] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105a57
[   19.022644] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.023677] page_type: f5(slab)
[   19.023736] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   19.023795] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   19.023889] page dumped because: kasan: bad access detected
[   19.023982] 
[   19.024000] Memory state around the buggy address:
[   19.024105]  fff00000c5a57600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   19.024209]  fff00000c5a57680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.024319] >fff00000c5a57700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.024368]                    ^
[   19.024397]  fff00000c5a57780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.024438]  fff00000c5a57800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.024474] ==================================================================
[   19.031563] ==================================================================
[   19.031630] BUG: KASAN: invalid-free in mempool_kmalloc_invalid_free_helper+0x118/0x2a8
[   19.031696] Free of addr fff00000c795c001 by task kunit_try_catch/243
[   19.031737] 
[   19.031775] CPU: 0 UID: 0 PID: 243 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   19.031858] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.031883] Hardware name: linux,dummy-virt (DT)
[   19.031915] Call trace:
[   19.031938]  show_stack+0x20/0x38 (C)
[   19.031989]  dump_stack_lvl+0x8c/0xd0
[   19.032038]  print_report+0x118/0x608
[   19.032087]  kasan_report_invalid_free+0xc0/0xe8
[   19.032138]  __kasan_mempool_poison_object+0xfc/0x150
[   19.032189]  mempool_free+0x28c/0x328
[   19.032235]  mempool_kmalloc_invalid_free_helper+0x118/0x2a8
[   19.032288]  mempool_kmalloc_large_invalid_free+0xc0/0x118
[   19.032356]  kunit_try_run_case+0x170/0x3f0
[   19.032407]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.032462]  kthread+0x328/0x630
[   19.032506]  ret_from_fork+0x10/0x20
[   19.032554] 
[   19.032575] The buggy address belongs to the physical page:
[   19.032608] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10795c
[   19.032662] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   19.032709] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   19.032763] page_type: f8(unknown)
[   19.032803] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   19.032852] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   19.032902] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   19.032951] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   19.033000] head: 0bfffe0000000002 ffffc1ffc31e5701 00000000ffffffff 00000000ffffffff
[   19.033050] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   19.033089] page dumped because: kasan: bad access detected
[   19.033121] 
[   19.033138] Memory state around the buggy address:
[   19.033170]  fff00000c795bf00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   19.033214]  fff00000c795bf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   19.033258] >fff00000c795c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.033295]                    ^
[   19.033323]  fff00000c795c080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.034455]  fff00000c795c100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.035032] ==================================================================

[   14.209260] ==================================================================
[   14.210100] BUG: KASAN: invalid-free in mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.210463] Free of addr ffff888102791b01 by task kunit_try_catch/258
[   14.210784] 
[   14.210935] CPU: 1 UID: 0 PID: 258 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   14.210981] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.210993] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.211022] Call Trace:
[   14.211050]  <TASK>
[   14.211065]  dump_stack_lvl+0x73/0xb0
[   14.211094]  print_report+0xd1/0x650
[   14.211116]  ? __virt_addr_valid+0x1db/0x2d0
[   14.211138]  ? kasan_complete_mode_report_info+0x2a/0x200
[   14.211162]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.211189]  kasan_report_invalid_free+0x10a/0x130
[   14.211224]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.211254]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.211290]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.211316]  check_slab_allocation+0x11f/0x130
[   14.211339]  __kasan_mempool_poison_object+0x91/0x1d0
[   14.211365]  mempool_free+0x2ec/0x380
[   14.211390]  mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.211418]  ? __pfx_mempool_kmalloc_invalid_free_helper+0x10/0x10
[   14.211445]  ? update_load_avg+0x1be/0x21b0
[   14.211468]  ? dequeue_entities+0x27e/0x1740
[   14.211494]  ? finish_task_switch.isra.0+0x153/0x700
[   14.211519]  mempool_kmalloc_invalid_free+0xed/0x140
[   14.211544]  ? __pfx_mempool_kmalloc_invalid_free+0x10/0x10
[   14.211573]  ? __pfx_mempool_kmalloc+0x10/0x10
[   14.211596]  ? __pfx_mempool_kfree+0x10/0x10
[   14.211621]  ? __pfx_read_tsc+0x10/0x10
[   14.211651]  ? ktime_get_ts64+0x86/0x230
[   14.211674]  kunit_try_run_case+0x1a5/0x480
[   14.211699]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.211732]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.211756]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.211780]  ? __kthread_parkme+0x82/0x180
[   14.211801]  ? preempt_count_sub+0x50/0x80
[   14.211832]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.211858]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.211883]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.211908]  kthread+0x337/0x6f0
[   14.211927]  ? trace_preempt_on+0x20/0xc0
[   14.211996]  ? __pfx_kthread+0x10/0x10
[   14.212018]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.212049]  ? calculate_sigpending+0x7b/0xa0
[   14.212073]  ? __pfx_kthread+0x10/0x10
[   14.212097]  ret_from_fork+0x116/0x1d0
[   14.212116]  ? __pfx_kthread+0x10/0x10
[   14.212137]  ret_from_fork_asm+0x1a/0x30
[   14.212167]  </TASK>
[   14.212177] 
[   14.222106] Allocated by task 258:
[   14.222347]  kasan_save_stack+0x45/0x70
[   14.222499]  kasan_save_track+0x18/0x40
[   14.222636]  kasan_save_alloc_info+0x3b/0x50
[   14.222785]  __kasan_mempool_unpoison_object+0x1a9/0x200
[   14.223024]  remove_element+0x11e/0x190
[   14.223231]  mempool_alloc_preallocated+0x4d/0x90
[   14.223456]  mempool_kmalloc_invalid_free_helper+0x83/0x2e0
[   14.223835]  mempool_kmalloc_invalid_free+0xed/0x140
[   14.224014]  kunit_try_run_case+0x1a5/0x480
[   14.224171]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.224347]  kthread+0x337/0x6f0
[   14.224711]  ret_from_fork+0x116/0x1d0
[   14.225124]  ret_from_fork_asm+0x1a/0x30
[   14.225362] 
[   14.225482] The buggy address belongs to the object at ffff888102791b00
[   14.225482]  which belongs to the cache kmalloc-128 of size 128
[   14.226200] The buggy address is located 1 bytes inside of
[   14.226200]  128-byte region [ffff888102791b00, ffff888102791b80)
[   14.226573] 
[   14.226684] The buggy address belongs to the physical page:
[   14.227069] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102791
[   14.227558] flags: 0x200000000000000(node=0|zone=2)
[   14.227778] page_type: f5(slab)
[   14.227959] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   14.228350] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   14.228645] page dumped because: kasan: bad access detected
[   14.229025] 
[   14.229223] Memory state around the buggy address:
[   14.229463]  ffff888102791a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   14.229782]  ffff888102791a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.230177] >ffff888102791b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   14.230501]                    ^
[   14.230670]  ffff888102791b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.231104]  ffff888102791c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   14.231394] ==================================================================
[   14.236449] ==================================================================
[   14.236955] BUG: KASAN: invalid-free in mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.237398] Free of addr ffff888102ad4001 by task kunit_try_catch/260
[   14.237652] 
[   14.238092] CPU: 0 UID: 0 PID: 260 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   14.238146] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.238159] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.238192] Call Trace:
[   14.238205]  <TASK>
[   14.238222]  dump_stack_lvl+0x73/0xb0
[   14.238268]  print_report+0xd1/0x650
[   14.238293]  ? __virt_addr_valid+0x1db/0x2d0
[   14.238320]  ? kasan_addr_to_slab+0x11/0xa0
[   14.238342]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.238373]  kasan_report_invalid_free+0x10a/0x130
[   14.238401]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.238432]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.238460]  __kasan_mempool_poison_object+0x102/0x1d0
[   14.238497]  mempool_free+0x2ec/0x380
[   14.238528]  mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.238567]  ? __pfx_mempool_kmalloc_invalid_free_helper+0x10/0x10
[   14.238598]  ? __pfx_sched_clock_cpu+0x10/0x10
[   14.238623]  ? finish_task_switch.isra.0+0x153/0x700
[   14.238652]  mempool_kmalloc_large_invalid_free+0xed/0x140
[   14.238679]  ? __pfx_mempool_kmalloc_large_invalid_free+0x10/0x10
[   14.238710]  ? __pfx_mempool_kmalloc+0x10/0x10
[   14.238734]  ? __pfx_mempool_kfree+0x10/0x10
[   14.238761]  ? __pfx_read_tsc+0x10/0x10
[   14.238785]  ? ktime_get_ts64+0x86/0x230
[   14.238811]  kunit_try_run_case+0x1a5/0x480
[   14.238894]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.238919]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.238953]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.238979]  ? __kthread_parkme+0x82/0x180
[   14.239004]  ? preempt_count_sub+0x50/0x80
[   14.239041]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.239067]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.239094]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.239120]  kthread+0x337/0x6f0
[   14.239141]  ? trace_preempt_on+0x20/0xc0
[   14.239165]  ? __pfx_kthread+0x10/0x10
[   14.239187]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.239210]  ? calculate_sigpending+0x7b/0xa0
[   14.239237]  ? __pfx_kthread+0x10/0x10
[   14.239260]  ret_from_fork+0x116/0x1d0
[   14.239281]  ? __pfx_kthread+0x10/0x10
[   14.239303]  ret_from_fork_asm+0x1a/0x30
[   14.239336]  </TASK>
[   14.239346] 
[   14.248749] The buggy address belongs to the physical page:
[   14.249130] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102ad4
[   14.249445] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   14.249676] flags: 0x200000000000040(head|node=0|zone=2)
[   14.249853] page_type: f8(unknown)
[   14.250173] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   14.250713] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   14.251175] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   14.251486] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   14.251721] head: 0200000000000002 ffffea00040ab501 00000000ffffffff 00000000ffffffff
[   14.252292] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   14.252948] page dumped because: kasan: bad access detected
[   14.253187] 
[   14.253275] Memory state around the buggy address:
[   14.253504]  ffff888102ad3f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   14.253872]  ffff888102ad3f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   14.254241] >ffff888102ad4000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   14.254561]                    ^
[   14.254735]  ffff888102ad4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   14.255062]  ffff888102ad4100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   14.255352] ==================================================================