Hay
Date
July 16, 2025, 3:10 p.m.

Environment
qemu-arm64
qemu-x86_64

[   18.688892] ==================================================================
[   18.688956] BUG: KASAN: invalid-free in mempool_kmalloc_invalid_free_helper+0x118/0x2a8
[   18.689196] Free of addr fff00000c796c001 by task kunit_try_catch/243
[   18.689592] 
[   18.689644] CPU: 1 UID: 0 PID: 243 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   18.690040] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.690137] Hardware name: linux,dummy-virt (DT)
[   18.690214] Call trace:
[   18.690240]  show_stack+0x20/0x38 (C)
[   18.690337]  dump_stack_lvl+0x8c/0xd0
[   18.690388]  print_report+0x118/0x5d0
[   18.690435]  kasan_report_invalid_free+0xc0/0xe8
[   18.690486]  __kasan_mempool_poison_object+0xfc/0x150
[   18.690538]  mempool_free+0x28c/0x328
[   18.690583]  mempool_kmalloc_invalid_free_helper+0x118/0x2a8
[   18.690989]  mempool_kmalloc_large_invalid_free+0xc0/0x118
[   18.691276]  kunit_try_run_case+0x170/0x3f0
[   18.691411]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.691570]  kthread+0x328/0x630
[   18.691662]  ret_from_fork+0x10/0x20
[   18.691837] 
[   18.691863] The buggy address belongs to the physical page:
[   18.691900] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10796c
[   18.692186] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   18.692304] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   18.692683] page_type: f8(unknown)
[   18.692860] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   18.692937] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   18.693174] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   18.694000] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   18.694248] head: 0bfffe0000000002 ffffc1ffc31e5b01 00000000ffffffff 00000000ffffffff
[   18.694344] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   18.694389] page dumped because: kasan: bad access detected
[   18.694502] 
[   18.694530] Memory state around the buggy address:
[   18.694563]  fff00000c796bf00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   18.694607]  fff00000c796bf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   18.694658] >fff00000c796c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.694705]                    ^
[   18.694753]  fff00000c796c080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.694812]  fff00000c796c100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.694850] ==================================================================
[   18.669560] ==================================================================
[   18.669626] BUG: KASAN: invalid-free in mempool_kmalloc_invalid_free_helper+0x118/0x2a8
[   18.669685] Free of addr fff00000c5967b01 by task kunit_try_catch/241
[   18.669745] 
[   18.669776] CPU: 1 UID: 0 PID: 241 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   18.669859] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.669904] Hardware name: linux,dummy-virt (DT)
[   18.669936] Call trace:
[   18.669957]  show_stack+0x20/0x38 (C)
[   18.670008]  dump_stack_lvl+0x8c/0xd0
[   18.670057]  print_report+0x118/0x5d0
[   18.670117]  kasan_report_invalid_free+0xc0/0xe8
[   18.670167]  check_slab_allocation+0xfc/0x108
[   18.670224]  __kasan_mempool_poison_object+0x78/0x150
[   18.670274]  mempool_free+0x28c/0x328
[   18.670321]  mempool_kmalloc_invalid_free_helper+0x118/0x2a8
[   18.670372]  mempool_kmalloc_invalid_free+0xc0/0x118
[   18.670421]  kunit_try_run_case+0x170/0x3f0
[   18.670470]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.670532]  kthread+0x328/0x630
[   18.670585]  ret_from_fork+0x10/0x20
[   18.670642] 
[   18.670666] Allocated by task 241:
[   18.670703]  kasan_save_stack+0x3c/0x68
[   18.671056]  kasan_save_track+0x20/0x40
[   18.671205]  kasan_save_alloc_info+0x40/0x58
[   18.671703]  __kasan_mempool_unpoison_object+0x11c/0x180
[   18.671776]  remove_element+0x130/0x1f8
[   18.671815]  mempool_alloc_preallocated+0x58/0xc0
[   18.671853]  mempool_kmalloc_invalid_free_helper+0x94/0x2a8
[   18.672312]  mempool_kmalloc_invalid_free+0xc0/0x118
[   18.672688]  kunit_try_run_case+0x170/0x3f0
[   18.672752]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.672795]  kthread+0x328/0x630
[   18.673214]  ret_from_fork+0x10/0x20
[   18.673689] 
[   18.673724] The buggy address belongs to the object at fff00000c5967b00
[   18.673724]  which belongs to the cache kmalloc-128 of size 128
[   18.674485] The buggy address is located 1 bytes inside of
[   18.674485]  128-byte region [fff00000c5967b00, fff00000c5967b80)
[   18.675118] 
[   18.675200] The buggy address belongs to the physical page:
[   18.675235] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105967
[   18.675354] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.675507] page_type: f5(slab)
[   18.675582] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   18.675706] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   18.675799] page dumped because: kasan: bad access detected
[   18.675895] 
[   18.675984] Memory state around the buggy address:
[   18.676142]  fff00000c5967a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   18.676202]  fff00000c5967a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.676417] >fff00000c5967b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.676555]                    ^
[   18.676643]  fff00000c5967b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.676899]  fff00000c5967c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.677056] ==================================================================

[   14.335446] ==================================================================
[   14.335976] BUG: KASAN: invalid-free in mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.336493] Free of addr ffff88810307a301 by task kunit_try_catch/258
[   14.336930] 
[   14.337058] CPU: 1 UID: 0 PID: 258 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   14.337104] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.337117] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.337139] Call Trace:
[   14.337153]  <TASK>
[   14.337228]  dump_stack_lvl+0x73/0xb0
[   14.337260]  print_report+0xd1/0x610
[   14.337521]  ? __virt_addr_valid+0x1db/0x2d0
[   14.337586]  ? kasan_complete_mode_report_info+0x2a/0x200
[   14.337610]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.337651]  kasan_report_invalid_free+0x10a/0x130
[   14.337677]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.337707]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.337733]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.337768]  check_slab_allocation+0x11f/0x130
[   14.337791]  __kasan_mempool_poison_object+0x91/0x1d0
[   14.337817]  mempool_free+0x2ec/0x380
[   14.337844]  mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.337872]  ? __pfx_mempool_kmalloc_invalid_free_helper+0x10/0x10
[   14.337903]  ? finish_task_switch.isra.0+0x153/0x700
[   14.337931]  mempool_kmalloc_invalid_free+0xed/0x140
[   14.337956]  ? __pfx_mempool_kmalloc_invalid_free+0x10/0x10
[   14.338036]  ? __pfx_mempool_kmalloc+0x10/0x10
[   14.338062]  ? __pfx_mempool_kfree+0x10/0x10
[   14.338087]  ? __pfx_read_tsc+0x10/0x10
[   14.338109]  ? ktime_get_ts64+0x86/0x230
[   14.338133]  kunit_try_run_case+0x1a5/0x480
[   14.338159]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.338183]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.338208]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.338233]  ? __kthread_parkme+0x82/0x180
[   14.338254]  ? preempt_count_sub+0x50/0x80
[   14.338279]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.338303]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.338329]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.338356]  kthread+0x337/0x6f0
[   14.338375]  ? trace_preempt_on+0x20/0xc0
[   14.338399]  ? __pfx_kthread+0x10/0x10
[   14.338420]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.338443]  ? calculate_sigpending+0x7b/0xa0
[   14.338469]  ? __pfx_kthread+0x10/0x10
[   14.338490]  ret_from_fork+0x116/0x1d0
[   14.338509]  ? __pfx_kthread+0x10/0x10
[   14.338530]  ret_from_fork_asm+0x1a/0x30
[   14.338561]  </TASK>
[   14.338571] 
[   14.348958] Allocated by task 258:
[   14.349154]  kasan_save_stack+0x45/0x70
[   14.349311]  kasan_save_track+0x18/0x40
[   14.349642]  kasan_save_alloc_info+0x3b/0x50
[   14.349892]  __kasan_mempool_unpoison_object+0x1a9/0x200
[   14.350127]  remove_element+0x11e/0x190
[   14.350463]  mempool_alloc_preallocated+0x4d/0x90
[   14.350645]  mempool_kmalloc_invalid_free_helper+0x83/0x2e0
[   14.350839]  mempool_kmalloc_invalid_free+0xed/0x140
[   14.351292]  kunit_try_run_case+0x1a5/0x480
[   14.351523]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.351795]  kthread+0x337/0x6f0
[   14.352141]  ret_from_fork+0x116/0x1d0
[   14.352322]  ret_from_fork_asm+0x1a/0x30
[   14.352553] 
[   14.352627] The buggy address belongs to the object at ffff88810307a300
[   14.352627]  which belongs to the cache kmalloc-128 of size 128
[   14.353338] The buggy address is located 1 bytes inside of
[   14.353338]  128-byte region [ffff88810307a300, ffff88810307a380)
[   14.353909] 
[   14.354031] The buggy address belongs to the physical page:
[   14.354343] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10307a
[   14.354684] flags: 0x200000000000000(node=0|zone=2)
[   14.354986] page_type: f5(slab)
[   14.355161] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   14.355592] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   14.356231] page dumped because: kasan: bad access detected
[   14.356497] 
[   14.356638] Memory state around the buggy address:
[   14.356858]  ffff88810307a200: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   14.357167]  ffff88810307a280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.357612] >ffff88810307a300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   14.358004]                    ^
[   14.358145]  ffff88810307a380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.358434]  ffff88810307a400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   14.358734] ==================================================================
[   14.362205] ==================================================================
[   14.362643] BUG: KASAN: invalid-free in mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.362914] Free of addr ffff888103a20001 by task kunit_try_catch/260
[   14.363115] 
[   14.363209] CPU: 0 UID: 0 PID: 260 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   14.363254] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.363267] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.363288] Call Trace:
[   14.363300]  <TASK>
[   14.363317]  dump_stack_lvl+0x73/0xb0
[   14.363346]  print_report+0xd1/0x610
[   14.363368]  ? __virt_addr_valid+0x1db/0x2d0
[   14.363391]  ? kasan_addr_to_slab+0x11/0xa0
[   14.363411]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.363437]  kasan_report_invalid_free+0x10a/0x130
[   14.363461]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.363489]  ? mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.363514]  __kasan_mempool_poison_object+0x102/0x1d0
[   14.363539]  mempool_free+0x2ec/0x380
[   14.363565]  mempool_kmalloc_invalid_free_helper+0x132/0x2e0
[   14.363591]  ? __pfx_mempool_kmalloc_invalid_free_helper+0x10/0x10
[   14.363615]  ? update_load_avg+0x1be/0x21b0
[   14.363638]  ? update_load_avg+0x1be/0x21b0
[   14.363659]  ? update_curr+0x80/0x810
[   14.363680]  ? finish_task_switch.isra.0+0x153/0x700
[   14.363706]  mempool_kmalloc_large_invalid_free+0xed/0x140
[   14.363730]  ? __pfx_mempool_kmalloc_large_invalid_free+0x10/0x10
[   14.364361]  ? __pfx_mempool_kmalloc+0x10/0x10
[   14.364403]  ? __pfx_mempool_kfree+0x10/0x10
[   14.364445]  ? __pfx_read_tsc+0x10/0x10
[   14.364468]  ? ktime_get_ts64+0x86/0x230
[   14.364497]  kunit_try_run_case+0x1a5/0x480
[   14.364523]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.364547]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.364573]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.364641]  ? __kthread_parkme+0x82/0x180
[   14.364663]  ? preempt_count_sub+0x50/0x80
[   14.364687]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.364712]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.364738]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.364780]  kthread+0x337/0x6f0
[   14.364799]  ? trace_preempt_on+0x20/0xc0
[   14.364824]  ? __pfx_kthread+0x10/0x10
[   14.364844]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.364866]  ? calculate_sigpending+0x7b/0xa0
[   14.364891]  ? __pfx_kthread+0x10/0x10
[   14.364912]  ret_from_fork+0x116/0x1d0
[   14.364931]  ? __pfx_kthread+0x10/0x10
[   14.364953]  ret_from_fork_asm+0x1a/0x30
[   14.365616]  </TASK>
[   14.365629] 
[   14.378228] The buggy address belongs to the physical page:
[   14.378479] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103a20
[   14.378804] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   14.379243] flags: 0x200000000000040(head|node=0|zone=2)
[   14.379433] page_type: f8(unknown)
[   14.379592] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   14.379844] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   14.380463] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   14.380839] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   14.381285] head: 0200000000000002 ffffea00040e8801 00000000ffffffff 00000000ffffffff
[   14.381661] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   14.382087] page dumped because: kasan: bad access detected
[   14.382318] 
[   14.382414] Memory state around the buggy address:
[   14.382600]  ffff888103a1ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   14.382830]  ffff888103a1ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   14.383248] >ffff888103a20000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   14.383595]                    ^
[   14.383772]  ffff888103a20080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   14.384166]  ffff888103a20100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   14.384478] ==================================================================