Hay
Date
July 12, 2025, 11:09 a.m.

Environment
qemu-arm64
qemu-x86_64

[   22.116120] ==================================================================
[   22.116259] BUG: KASAN: invalid-free in mempool_kmalloc_invalid_free_helper+0x118/0x2a8
[   22.116388] Free of addr fff00000c79b8001 by task kunit_try_catch/244
[   22.116489] 
[   22.116568] CPU: 1 UID: 0 PID: 244 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   22.116764] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.117231] Hardware name: linux,dummy-virt (DT)
[   22.117331] Call trace:
[   22.117404]  show_stack+0x20/0x38 (C)
[   22.117525]  dump_stack_lvl+0x8c/0xd0
[   22.117648]  print_report+0x118/0x608
[   22.117795]  kasan_report_invalid_free+0xc0/0xe8
[   22.118187]  __kasan_mempool_poison_object+0xfc/0x150
[   22.118291]  mempool_free+0x28c/0x328
[   22.118595]  mempool_kmalloc_invalid_free_helper+0x118/0x2a8
[   22.118803]  mempool_kmalloc_large_invalid_free+0xc0/0x118
[   22.118952]  kunit_try_run_case+0x170/0x3f0
[   22.119055]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.119172]  kthread+0x328/0x630
[   22.119270]  ret_from_fork+0x10/0x20
[   22.119375] 
[   22.119419] The buggy address belongs to the physical page:
[   22.119490] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1079b8
[   22.119615] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   22.119732] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   22.119858] page_type: f8(unknown)
[   22.120302] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   22.120415] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   22.120530] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   22.120639] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   22.120752] head: 0bfffe0000000002 ffffc1ffc31e6e01 00000000ffffffff 00000000ffffffff
[   22.120874] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   22.120954] page dumped because: kasan: bad access detected
[   22.121175] 
[   22.121220] Memory state around the buggy address:
[   22.121867]  fff00000c79b7f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   22.121967]  fff00000c79b7f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   22.122064] >fff00000c79b8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   22.122146]                    ^
[   22.122185]  fff00000c79b8080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   22.122231]  fff00000c79b8100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   22.122270] ==================================================================
[   22.095129] ==================================================================
[   22.095259] BUG: KASAN: invalid-free in mempool_kmalloc_invalid_free_helper+0x118/0x2a8
[   22.095376] Free of addr fff00000c5942501 by task kunit_try_catch/242
[   22.095476] 
[   22.095544] CPU: 1 UID: 0 PID: 242 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   22.095739] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.095805] Hardware name: linux,dummy-virt (DT)
[   22.096436] Call trace:
[   22.096505]  show_stack+0x20/0x38 (C)
[   22.096633]  dump_stack_lvl+0x8c/0xd0
[   22.096746]  print_report+0x118/0x608
[   22.096871]  kasan_report_invalid_free+0xc0/0xe8
[   22.096984]  check_slab_allocation+0xfc/0x108
[   22.097105]  __kasan_mempool_poison_object+0x78/0x150
[   22.097270]  mempool_free+0x28c/0x328
[   22.097619]  mempool_kmalloc_invalid_free_helper+0x118/0x2a8
[   22.097795]  mempool_kmalloc_invalid_free+0xc0/0x118
[   22.097970]  kunit_try_run_case+0x170/0x3f0
[   22.098089]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.098333]  kthread+0x328/0x630
[   22.098427]  ret_from_fork+0x10/0x20
[   22.098549] 
[   22.098595] Allocated by task 242:
[   22.098723]  kasan_save_stack+0x3c/0x68
[   22.098922]  kasan_save_track+0x20/0x40
[   22.099041]  kasan_save_alloc_info+0x40/0x58
[   22.099216]  __kasan_mempool_unpoison_object+0x11c/0x180
[   22.099582]  remove_element+0x130/0x1f8
[   22.099713]  mempool_alloc_preallocated+0x58/0xc0
[   22.099974]  mempool_kmalloc_invalid_free_helper+0x94/0x2a8
[   22.100089]  mempool_kmalloc_invalid_free+0xc0/0x118
[   22.100187]  kunit_try_run_case+0x170/0x3f0
[   22.100277]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.100753]  kthread+0x328/0x630
[   22.100963]  ret_from_fork+0x10/0x20
[   22.101109] 
[   22.101275] The buggy address belongs to the object at fff00000c5942500
[   22.101275]  which belongs to the cache kmalloc-128 of size 128
[   22.101693] The buggy address is located 1 bytes inside of
[   22.101693]  128-byte region [fff00000c5942500, fff00000c5942580)
[   22.102042] 
[   22.102107] The buggy address belongs to the physical page:
[   22.102397] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105942
[   22.102768] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   22.102923] page_type: f5(slab)
[   22.103010] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   22.103137] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   22.103239] page dumped because: kasan: bad access detected
[   22.103429] 
[   22.103480] Memory state around the buggy address:
[   22.103797]  fff00000c5942400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   22.104029]  fff00000c5942480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.104127] >fff00000c5942500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   22.104319]                    ^
[   22.104412]  fff00000c5942580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.104961]  fff00000c5942600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   22.105283] ==================================================================

[   14.363091] ==================================================================
[   14.363795] BUG: KASAN: invalid-free in mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.364343] Free of addr ffff88810266c001 by task kunit_try_catch/259
[   14.364621] 
[   14.364766] CPU: 1 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   14.364809] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.364820] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.364860] Call Trace:
[   14.364873]  <TASK>
[   14.364888]  dump_stack_lvl+0x73/0xb0
[   14.364988]  print_report+0xd1/0x650
[   14.365013]  ? __virt_addr_valid+0x1db/0x2d0
[   14.365039]  ? kasan_complete_mode_report_info+0x2a/0x200
[   14.365063]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.365090]  kasan_report_invalid_free+0x10a/0x130
[   14.365116]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.365145]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.365172]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.365198]  check_slab_allocation+0x11f/0x130
[   14.365243]  __kasan_mempool_poison_object+0x91/0x1d0
[   14.365268]  mempool_free+0x2ec/0x380
[   14.365313]  mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.365340]  ? __pfx_mempool_kmalloc_invalid_free_helper+0x10/0x10
[   14.365369]  ? __kasan_check_write+0x18/0x20
[   14.365389]  ? __pfx_sched_clock_cpu+0x10/0x10
[   14.365412]  ? finish_task_switch.isra.0+0x153/0x700
[   14.365439]  mempool_kmalloc_invalid_free+0xed/0x140
[   14.365464]  ? __pfx_mempool_kmalloc_invalid_free+0x10/0x10
[   14.365492]  ? __pfx_mempool_kmalloc+0x10/0x10
[   14.365515]  ? __pfx_mempool_kfree+0x10/0x10
[   14.365540]  ? __pfx_read_tsc+0x10/0x10
[   14.365563]  ? ktime_get_ts64+0x86/0x230
[   14.365588]  kunit_try_run_case+0x1a5/0x480
[   14.365614]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.365637]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.365703]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.365728]  ? __kthread_parkme+0x82/0x180
[   14.365762]  ? preempt_count_sub+0x50/0x80
[   14.365786]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.365811]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.365836]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.365862]  kthread+0x337/0x6f0
[   14.365881]  ? trace_preempt_on+0x20/0xc0
[   14.365904]  ? __pfx_kthread+0x10/0x10
[   14.365925]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.365947]  ? calculate_sigpending+0x7b/0xa0
[   14.365973]  ? __pfx_kthread+0x10/0x10
[   14.365995]  ret_from_fork+0x116/0x1d0
[   14.366015]  ? __pfx_kthread+0x10/0x10
[   14.366035]  ret_from_fork_asm+0x1a/0x30
[   14.366067]  </TASK>
[   14.366077] 
[   14.378269] Allocated by task 259:
[   14.378452]  kasan_save_stack+0x45/0x70
[   14.378642]  kasan_save_track+0x18/0x40
[   14.379567]  kasan_save_alloc_info+0x3b/0x50
[   14.379969]  __kasan_mempool_unpoison_object+0x1a9/0x200
[   14.380221]  remove_element+0x11e/0x190
[   14.380411]  mempool_alloc_preallocated+0x4d/0x90
[   14.380628]  mempool_kmalloc_invalid_free_helper+0x83/0x2e0
[   14.381246]  mempool_kmalloc_invalid_free+0xed/0x140
[   14.381873]  kunit_try_run_case+0x1a5/0x480
[   14.382163]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.382421]  kthread+0x337/0x6f0
[   14.382584]  ret_from_fork+0x116/0x1d0
[   14.383166]  ret_from_fork_asm+0x1a/0x30
[   14.383375] 
[   14.383469] The buggy address belongs to the object at ffff88810266c000
[   14.383469]  which belongs to the cache kmalloc-128 of size 128
[   14.384644] The buggy address is located 1 bytes inside of
[   14.384644]  128-byte region [ffff88810266c000, ffff88810266c080)
[   14.385298] 
[   14.385395] The buggy address belongs to the physical page:
[   14.385633] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10266c
[   14.386345] flags: 0x200000000000000(node=0|zone=2)
[   14.386782] page_type: f5(slab)
[   14.386948] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   14.387264] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   14.387571] page dumped because: kasan: bad access detected
[   14.388197] 
[   14.388390] Memory state around the buggy address:
[   14.388924]  ffff88810266bf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.389449]  ffff88810266bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.390336] >ffff88810266c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   14.390824]                    ^
[   14.391086]  ffff88810266c080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.391608]  ffff88810266c100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   14.392121] ==================================================================
[   14.395098] ==================================================================
[   14.395912] BUG: KASAN: invalid-free in mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.396393] Free of addr ffff888103b74001 by task kunit_try_catch/261
[   14.396825] 
[   14.397156] CPU: 1 UID: 0 PID: 261 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   14.397210] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.397222] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.397244] Call Trace:
[   14.397257]  <TASK>
[   14.397275]  dump_stack_lvl+0x73/0xb0
[   14.397344]  print_report+0xd1/0x650
[   14.397367]  ? __virt_addr_valid+0x1db/0x2d0
[   14.397392]  ? kasan_addr_to_slab+0x11/0xa0
[   14.397413]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.397440]  kasan_report_invalid_free+0x10a/0x130
[   14.397465]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.397494]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.397520]  __kasan_mempool_poison_object+0x102/0x1d0
[   14.397546]  mempool_free+0x2ec/0x380
[   14.397572]  mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.397599]  ? __pfx_mempool_kmalloc_invalid_free_helper+0x10/0x10
[   14.397630]  ? finish_task_switch.isra.0+0x153/0x700
[   14.397673]  mempool_kmalloc_large_invalid_free+0xed/0x140
[   14.397700]  ? __pfx_mempool_kmalloc_large_invalid_free+0x10/0x10
[   14.397729]  ? __pfx_mempool_kmalloc+0x10/0x10
[   14.397764]  ? __pfx_mempool_kfree+0x10/0x10
[   14.397790]  ? __pfx_read_tsc+0x10/0x10
[   14.397812]  ? ktime_get_ts64+0x86/0x230
[   14.397836]  kunit_try_run_case+0x1a5/0x480
[   14.397860]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.397883]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.397907]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.397932]  ? __kthread_parkme+0x82/0x180
[   14.397952]  ? preempt_count_sub+0x50/0x80
[   14.397975]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.398000]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.398025]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.398050]  kthread+0x337/0x6f0
[   14.398069]  ? trace_preempt_on+0x20/0xc0
[   14.398093]  ? __pfx_kthread+0x10/0x10
[   14.398113]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.398134]  ? calculate_sigpending+0x7b/0xa0
[   14.398158]  ? __pfx_kthread+0x10/0x10
[   14.398179]  ret_from_fork+0x116/0x1d0
[   14.398198]  ? __pfx_kthread+0x10/0x10
[   14.398219]  ret_from_fork_asm+0x1a/0x30
[   14.398248]  </TASK>
[   14.398259] 
[   14.410402] The buggy address belongs to the physical page:
[   14.410859] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103b74
[   14.411281] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   14.411597] flags: 0x200000000000040(head|node=0|zone=2)
[   14.412062] page_type: f8(unknown)
[   14.412247] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   14.412564] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   14.413473] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   14.414088] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   14.414551] head: 0200000000000002 ffffea00040edd01 00000000ffffffff 00000000ffffffff
[   14.415055] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   14.415614] page dumped because: kasan: bad access detected
[   14.416128] 
[   14.416235] Memory state around the buggy address:
[   14.416454]  ffff888103b73f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   14.417073]  ffff888103b73f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   14.417495] >ffff888103b74000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   14.418214]                    ^
[   14.418472]  ffff888103b74080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   14.419024]  ffff888103b74100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   14.419327] ==================================================================