Hay
Date
July 17, 2025, 10:12 a.m.

Environment
qemu-arm64
qemu-x86_64

[   31.642683] ==================================================================
[   31.642779] BUG: KASAN: slab-use-after-free in mempool_uaf_helper+0x314/0x340
[   31.642855] Read of size 1 at addr fff00000c98f2100 by task kunit_try_catch/258
[   31.642916] 
[   31.642989] CPU: 0 UID: 0 PID: 258 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250717 #1 PREEMPT 
[   31.643100] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.643140] Hardware name: linux,dummy-virt (DT)
[   31.643173] Call trace:
[   31.643208]  show_stack+0x20/0x38 (C)
[   31.643258]  dump_stack_lvl+0x8c/0xd0
[   31.643319]  print_report+0x118/0x5d0
[   31.643375]  kasan_report+0xdc/0x128
[   31.643419]  __asan_report_load1_noabort+0x20/0x30
[   31.643480]  mempool_uaf_helper+0x314/0x340
[   31.643539]  mempool_kmalloc_uaf+0xc4/0x120
[   31.643605]  kunit_try_run_case+0x170/0x3f0
[   31.643667]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.643731]  kthread+0x328/0x630
[   31.643786]  ret_from_fork+0x10/0x20
[   31.643845] 
[   31.643874] Allocated by task 258:
[   31.643923]  kasan_save_stack+0x3c/0x68
[   31.643961]  kasan_save_track+0x20/0x40
[   31.644008]  kasan_save_alloc_info+0x40/0x58
[   31.644046]  __kasan_mempool_unpoison_object+0x11c/0x180
[   31.644199]  remove_element+0x130/0x1f8
[   31.644242]  mempool_alloc_preallocated+0x58/0xc0
[   31.645020]  mempool_uaf_helper+0xa4/0x340
[   31.645108]  mempool_kmalloc_uaf+0xc4/0x120
[   31.645189]  kunit_try_run_case+0x170/0x3f0
[   31.645230]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.645561]  kthread+0x328/0x630
[   31.645762]  ret_from_fork+0x10/0x20
[   31.646032] 
[   31.646472] Freed by task 258:
[   31.646533]  kasan_save_stack+0x3c/0x68
[   31.646745]  kasan_save_track+0x20/0x40
[   31.646825]  kasan_save_free_info+0x4c/0x78
[   31.646990]  __kasan_mempool_poison_object+0xc0/0x150
[   31.647160]  mempool_free+0x28c/0x328
[   31.647202]  mempool_uaf_helper+0x104/0x340
[   31.647403]  mempool_kmalloc_uaf+0xc4/0x120
[   31.647566]  kunit_try_run_case+0x170/0x3f0
[   31.647749]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.647838]  kthread+0x328/0x630
[   31.648081]  ret_from_fork+0x10/0x20
[   31.648222] 
[   31.648426] The buggy address belongs to the object at fff00000c98f2100
[   31.648426]  which belongs to the cache kmalloc-128 of size 128
[   31.648503] The buggy address is located 0 bytes inside of
[   31.648503]  freed 128-byte region [fff00000c98f2100, fff00000c98f2180)
[   31.648731] 
[   31.649220] The buggy address belongs to the physical page:
[   31.649272] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1098f2
[   31.649463] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.649652] page_type: f5(slab)
[   31.649758] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   31.649838] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   31.650073] page dumped because: kasan: bad access detected
[   31.650191] 
[   31.650289] Memory state around the buggy address:
[   31.650325]  fff00000c98f2000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   31.650749]  fff00000c98f2080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.650810] >fff00000c98f2100: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   31.650974]                    ^
[   31.651404]  fff00000c98f2180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.651510]  fff00000c98f2200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   31.651611] ==================================================================
[   31.683025] ==================================================================
[   31.683535] BUG: KASAN: slab-use-after-free in mempool_uaf_helper+0x314/0x340
[   31.683638] Read of size 1 at addr fff00000c98df240 by task kunit_try_catch/262
[   31.684031] 
[   31.684084] CPU: 0 UID: 0 PID: 262 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250717 #1 PREEMPT 
[   31.684291] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.684329] Hardware name: linux,dummy-virt (DT)
[   31.684712] Call trace:
[   31.685165]  show_stack+0x20/0x38 (C)
[   31.685240]  dump_stack_lvl+0x8c/0xd0
[   31.685331]  print_report+0x118/0x5d0
[   31.685533]  kasan_report+0xdc/0x128
[   31.685833]  __asan_report_load1_noabort+0x20/0x30
[   31.686092]  mempool_uaf_helper+0x314/0x340
[   31.686255]  mempool_slab_uaf+0xc0/0x118
[   31.686343]  kunit_try_run_case+0x170/0x3f0
[   31.686403]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.686463]  kthread+0x328/0x630
[   31.686509]  ret_from_fork+0x10/0x20
[   31.686556] 
[   31.686577] Allocated by task 262:
[   31.686605]  kasan_save_stack+0x3c/0x68
[   31.686645]  kasan_save_track+0x20/0x40
[   31.686693]  kasan_save_alloc_info+0x40/0x58
[   31.686740]  __kasan_mempool_unpoison_object+0xbc/0x180
[   31.686790]  remove_element+0x16c/0x1f8
[   31.686828]  mempool_alloc_preallocated+0x58/0xc0
[   31.686879]  mempool_uaf_helper+0xa4/0x340
[   31.686925]  mempool_slab_uaf+0xc0/0x118
[   31.686971]  kunit_try_run_case+0x170/0x3f0
[   31.687028]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.687091]  kthread+0x328/0x630
[   31.687134]  ret_from_fork+0x10/0x20
[   31.687168] 
[   31.687189] Freed by task 262:
[   31.687225]  kasan_save_stack+0x3c/0x68
[   31.687261]  kasan_save_track+0x20/0x40
[   31.687302]  kasan_save_free_info+0x4c/0x78
[   31.687354]  __kasan_mempool_poison_object+0xc0/0x150
[   31.687395]  mempool_free+0x28c/0x328
[   31.687438]  mempool_uaf_helper+0x104/0x340
[   31.687482]  mempool_slab_uaf+0xc0/0x118
[   31.687527]  kunit_try_run_case+0x170/0x3f0
[   31.687565]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.687614]  kthread+0x328/0x630
[   31.687661]  ret_from_fork+0x10/0x20
[   31.687698] 
[   31.687719] The buggy address belongs to the object at fff00000c98df240
[   31.687719]  which belongs to the cache test_cache of size 123
[   31.687784] The buggy address is located 0 bytes inside of
[   31.687784]  freed 123-byte region [fff00000c98df240, fff00000c98df2bb)
[   31.687855] 
[   31.687876] The buggy address belongs to the physical page:
[   31.687915] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1098df
[   31.687969] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.688018] page_type: f5(slab)
[   31.688066] raw: 0bfffe0000000000 fff00000c3f2ddc0 dead000000000122 0000000000000000
[   31.688322] raw: 0000000000000000 0000000080150015 00000000f5000000 0000000000000000
[   31.688682] page dumped because: kasan: bad access detected
[   31.688724] 
[   31.688766] Memory state around the buggy address:
[   31.689381]  fff00000c98df100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   31.689754]  fff00000c98df180: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   31.690094] >fff00000c98df200: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
[   31.690337]                                            ^
[   31.690542]  fff00000c98df280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   31.690702]  fff00000c98df300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.690743] ==================================================================

[   27.160761] ==================================================================
[   27.161189] BUG: KASAN: slab-use-after-free in mempool_uaf_helper+0x392/0x400
[   27.161632] Read of size 1 at addr ffff888104588000 by task kunit_try_catch/276
[   27.161911] 
[   27.162023] CPU: 1 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250717 #1 PREEMPT(voluntary) 
[   27.162071] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.162093] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   27.162113] Call Trace:
[   27.162125]  <TASK>
[   27.162140]  dump_stack_lvl+0x73/0xb0
[   27.162168]  print_report+0xd1/0x610
[   27.162189]  ? __virt_addr_valid+0x1db/0x2d0
[   27.162212]  ? mempool_uaf_helper+0x392/0x400
[   27.162232]  ? kasan_complete_mode_report_info+0x64/0x200
[   27.162316]  ? mempool_uaf_helper+0x392/0x400
[   27.162338]  kasan_report+0x141/0x180
[   27.162360]  ? mempool_uaf_helper+0x392/0x400
[   27.162386]  __asan_report_load1_noabort+0x18/0x20
[   27.162410]  mempool_uaf_helper+0x392/0x400
[   27.162432]  ? __pfx_mempool_uaf_helper+0x10/0x10
[   27.162453]  ? update_load_avg+0x1be/0x21b0
[   27.162486]  ? update_curr+0x7d/0x7f0
[   27.162507]  ? finish_task_switch.isra.0+0x153/0x700
[   27.162532]  mempool_kmalloc_uaf+0xef/0x140
[   27.162553]  ? __pfx_mempool_kmalloc_uaf+0x10/0x10
[   27.162578]  ? __pfx_mempool_kmalloc+0x10/0x10
[   27.162599]  ? __pfx_mempool_kfree+0x10/0x10
[   27.162623]  ? __pfx_read_tsc+0x10/0x10
[   27.162645]  ? ktime_get_ts64+0x86/0x230
[   27.162667]  kunit_try_run_case+0x1a5/0x480
[   27.162691]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.162712]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   27.162735]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   27.162758]  ? __kthread_parkme+0x82/0x180
[   27.162782]  ? preempt_count_sub+0x50/0x80
[   27.162804]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.162827]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.162849]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   27.162872]  kthread+0x337/0x6f0
[   27.162890]  ? trace_preempt_on+0x20/0xc0
[   27.162912]  ? __pfx_kthread+0x10/0x10
[   27.162931]  ? _raw_spin_unlock_irq+0x47/0x80
[   27.162952]  ? calculate_sigpending+0x7b/0xa0
[   27.162975]  ? __pfx_kthread+0x10/0x10
[   27.162996]  ret_from_fork+0x116/0x1d0
[   27.163014]  ? __pfx_kthread+0x10/0x10
[   27.163034]  ret_from_fork_asm+0x1a/0x30
[   27.163065]  </TASK>
[   27.163075] 
[   27.171877] Allocated by task 276:
[   27.172148]  kasan_save_stack+0x45/0x70
[   27.172470]  kasan_save_track+0x18/0x40
[   27.173158]  kasan_save_alloc_info+0x3b/0x50
[   27.174098]  __kasan_mempool_unpoison_object+0x1a9/0x200
[   27.174450]  remove_element+0x11e/0x190
[   27.174815]  mempool_alloc_preallocated+0x4d/0x90
[   27.175032]  mempool_uaf_helper+0x96/0x400
[   27.175225]  mempool_kmalloc_uaf+0xef/0x140
[   27.175485]  kunit_try_run_case+0x1a5/0x480
[   27.175667]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.175898]  kthread+0x337/0x6f0
[   27.176046]  ret_from_fork+0x116/0x1d0
[   27.176224]  ret_from_fork_asm+0x1a/0x30
[   27.176544] 
[   27.176630] Freed by task 276:
[   27.176770]  kasan_save_stack+0x45/0x70
[   27.176944]  kasan_save_track+0x18/0x40
[   27.177168]  kasan_save_free_info+0x3f/0x60
[   27.177315]  __kasan_mempool_poison_object+0x131/0x1d0
[   27.177477]  mempool_free+0x2ec/0x380
[   27.177777]  mempool_uaf_helper+0x11a/0x400
[   27.177980]  mempool_kmalloc_uaf+0xef/0x140
[   27.178197]  kunit_try_run_case+0x1a5/0x480
[   27.178484]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.178748]  kthread+0x337/0x6f0
[   27.178907]  ret_from_fork+0x116/0x1d0
[   27.179096]  ret_from_fork_asm+0x1a/0x30
[   27.179349] 
[   27.179434] The buggy address belongs to the object at ffff888104588000
[   27.179434]  which belongs to the cache kmalloc-128 of size 128
[   27.179889] The buggy address is located 0 bytes inside of
[   27.179889]  freed 128-byte region [ffff888104588000, ffff888104588080)
[   27.180431] 
[   27.180531] The buggy address belongs to the physical page:
[   27.180764] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104588
[   27.181109] flags: 0x200000000000000(node=0|zone=2)
[   27.181363] page_type: f5(slab)
[   27.181651] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   27.181987] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   27.182388] page dumped because: kasan: bad access detected
[   27.182572] 
[   27.182661] Memory state around the buggy address:
[   27.182870]  ffff888104587f00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   27.183195]  ffff888104587f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.183534] >ffff888104588000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   27.183743]                    ^
[   27.183851]  ffff888104588080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.184057]  ffff888104588100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   27.184271] ==================================================================
[   27.216624] ==================================================================
[   27.217054] BUG: KASAN: slab-use-after-free in mempool_uaf_helper+0x392/0x400
[   27.217596] Read of size 1 at addr ffff888106189240 by task kunit_try_catch/280
[   27.218018] 
[   27.218421] CPU: 0 UID: 0 PID: 280 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250717 #1 PREEMPT(voluntary) 
[   27.218574] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.218588] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   27.218611] Call Trace:
[   27.218624]  <TASK>
[   27.218642]  dump_stack_lvl+0x73/0xb0
[   27.218675]  print_report+0xd1/0x610
[   27.218697]  ? __virt_addr_valid+0x1db/0x2d0
[   27.218722]  ? mempool_uaf_helper+0x392/0x400
[   27.218744]  ? kasan_complete_mode_report_info+0x64/0x200
[   27.218770]  ? mempool_uaf_helper+0x392/0x400
[   27.218792]  kasan_report+0x141/0x180
[   27.218813]  ? mempool_uaf_helper+0x392/0x400
[   27.218840]  __asan_report_load1_noabort+0x18/0x20
[   27.218863]  mempool_uaf_helper+0x392/0x400
[   27.218885]  ? __pfx_mempool_uaf_helper+0x10/0x10
[   27.218909]  ? __pfx_sched_clock_cpu+0x10/0x10
[   27.218930]  ? finish_task_switch.isra.0+0x153/0x700
[   27.218955]  mempool_slab_uaf+0xea/0x140
[   27.218976]  ? __pfx_mempool_slab_uaf+0x10/0x10
[   27.219001]  ? __pfx_mempool_alloc_slab+0x10/0x10
[   27.219024]  ? __pfx_mempool_free_slab+0x10/0x10
[   27.219049]  ? __pfx_read_tsc+0x10/0x10
[   27.219070]  ? ktime_get_ts64+0x86/0x230
[   27.219107]  kunit_try_run_case+0x1a5/0x480
[   27.219131]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.219153]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   27.219176]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   27.219198]  ? __kthread_parkme+0x82/0x180
[   27.219222]  ? preempt_count_sub+0x50/0x80
[   27.219291]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.219318]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.219341]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   27.219363]  kthread+0x337/0x6f0
[   27.219382]  ? trace_preempt_on+0x20/0xc0
[   27.219406]  ? __pfx_kthread+0x10/0x10
[   27.219426]  ? _raw_spin_unlock_irq+0x47/0x80
[   27.219447]  ? calculate_sigpending+0x7b/0xa0
[   27.219469]  ? __pfx_kthread+0x10/0x10
[   27.219490]  ret_from_fork+0x116/0x1d0
[   27.219510]  ? __pfx_kthread+0x10/0x10
[   27.219529]  ret_from_fork_asm+0x1a/0x30
[   27.219561]  </TASK>
[   27.219572] 
[   27.230315] Allocated by task 280:
[   27.230666]  kasan_save_stack+0x45/0x70
[   27.230855]  kasan_save_track+0x18/0x40
[   27.231021]  kasan_save_alloc_info+0x3b/0x50
[   27.231220]  __kasan_mempool_unpoison_object+0x1bb/0x200
[   27.231808]  remove_element+0x11e/0x190
[   27.231966]  mempool_alloc_preallocated+0x4d/0x90
[   27.232500]  mempool_uaf_helper+0x96/0x400
[   27.232802]  mempool_slab_uaf+0xea/0x140
[   27.232954]  kunit_try_run_case+0x1a5/0x480
[   27.233173]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.233428]  kthread+0x337/0x6f0
[   27.233863]  ret_from_fork+0x116/0x1d0
[   27.234126]  ret_from_fork_asm+0x1a/0x30
[   27.234387] 
[   27.234472] Freed by task 280:
[   27.234627]  kasan_save_stack+0x45/0x70
[   27.234813]  kasan_save_track+0x18/0x40
[   27.234992]  kasan_save_free_info+0x3f/0x60
[   27.235180]  __kasan_mempool_poison_object+0x131/0x1d0
[   27.235839]  mempool_free+0x2ec/0x380
[   27.236011]  mempool_uaf_helper+0x11a/0x400
[   27.236209]  mempool_slab_uaf+0xea/0x140
[   27.236682]  kunit_try_run_case+0x1a5/0x480
[   27.236846]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.237201]  kthread+0x337/0x6f0
[   27.237570]  ret_from_fork+0x116/0x1d0
[   27.237746]  ret_from_fork_asm+0x1a/0x30
[   27.237920] 
[   27.237995] The buggy address belongs to the object at ffff888106189240
[   27.237995]  which belongs to the cache test_cache of size 123
[   27.238924] The buggy address is located 0 bytes inside of
[   27.238924]  freed 123-byte region [ffff888106189240, ffff8881061892bb)
[   27.239705] 
[   27.239810] The buggy address belongs to the physical page:
[   27.240030] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106189
[   27.240602] flags: 0x200000000000000(node=0|zone=2)
[   27.240818] page_type: f5(slab)
[   27.241114] raw: 0200000000000000 ffff888101e9ea00 dead000000000122 0000000000000000
[   27.241628] raw: 0000000000000000 0000000080150015 00000000f5000000 0000000000000000
[   27.241927] page dumped because: kasan: bad access detected
[   27.242174] 
[   27.242239] Memory state around the buggy address:
[   27.242804]  ffff888106189100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   27.243070]  ffff888106189180: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   27.243586] >ffff888106189200: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
[   27.243947]                                            ^
[   27.244203]  ffff888106189280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   27.244762]  ffff888106189300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.245003] ==================================================================