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

Environment
qemu-arm64
qemu-x86_64

[   17.561787] ==================================================================
[   17.561982] BUG: KASAN: slab-use-after-free in mempool_uaf_helper+0x314/0x340
[   17.562312] Read of size 1 at addr fff00000c596a240 by task kunit_try_catch/232
[   17.562438] 
[   17.562474] CPU: 1 UID: 0 PID: 232 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   17.563089] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.563142] Hardware name: linux,dummy-virt (DT)
[   17.563217] Call trace:
[   17.563344]  show_stack+0x20/0x38 (C)
[   17.563590]  dump_stack_lvl+0x8c/0xd0
[   17.563640]  print_report+0x118/0x5d0
[   17.563718]  kasan_report+0xdc/0x128
[   17.563763]  __asan_report_load1_noabort+0x20/0x30
[   17.563852]  mempool_uaf_helper+0x314/0x340
[   17.564089]  mempool_slab_uaf+0xc0/0x118
[   17.564141]  kunit_try_run_case+0x170/0x3f0
[   17.564197]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.564251]  kthread+0x328/0x630
[   17.564291]  ret_from_fork+0x10/0x20
[   17.564588] 
[   17.564606] Allocated by task 232:
[   17.564637]  kasan_save_stack+0x3c/0x68
[   17.564679]  kasan_save_track+0x20/0x40
[   17.564714]  kasan_save_alloc_info+0x40/0x58
[   17.564754]  __kasan_mempool_unpoison_object+0xbc/0x180
[   17.564797]  remove_element+0x16c/0x1f8
[   17.565514]  mempool_alloc_preallocated+0x58/0xc0
[   17.565561]  mempool_uaf_helper+0xa4/0x340
[   17.565944]  mempool_slab_uaf+0xc0/0x118
[   17.566040]  kunit_try_run_case+0x170/0x3f0
[   17.566092]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.566138]  kthread+0x328/0x630
[   17.566465]  ret_from_fork+0x10/0x20
[   17.566511] 
[   17.566587] Freed by task 232:
[   17.566617]  kasan_save_stack+0x3c/0x68
[   17.566802]  kasan_save_track+0x20/0x40
[   17.566889]  kasan_save_free_info+0x4c/0x78
[   17.566930]  __kasan_mempool_poison_object+0xc0/0x150
[   17.567021]  mempool_free+0x28c/0x328
[   17.567192]  mempool_uaf_helper+0x104/0x340
[   17.567230]  mempool_slab_uaf+0xc0/0x118
[   17.567424]  kunit_try_run_case+0x170/0x3f0
[   17.567551]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.567602]  kthread+0x328/0x630
[   17.567634]  ret_from_fork+0x10/0x20
[   17.567870] 
[   17.567958] The buggy address belongs to the object at fff00000c596a240
[   17.567958]  which belongs to the cache test_cache of size 123
[   17.568060] The buggy address is located 0 bytes inside of
[   17.568060]  freed 123-byte region [fff00000c596a240, fff00000c596a2bb)
[   17.568213] 
[   17.568233] The buggy address belongs to the physical page:
[   17.568269] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10596a
[   17.568476] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.568526] page_type: f5(slab)
[   17.568573] raw: 0bfffe0000000000 fff00000c590fb40 dead000000000122 0000000000000000
[   17.568822] raw: 0000000000000000 0000000080150015 00000000f5000000 0000000000000000
[   17.569009] page dumped because: kasan: bad access detected
[   17.569100] 
[   17.569123] Memory state around the buggy address:
[   17.569156]  fff00000c596a100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   17.569211]  fff00000c596a180: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   17.569254] >fff00000c596a200: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
[   17.569485]                                            ^
[   17.569530]  fff00000c596a280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   17.569654]  fff00000c596a300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.569711] ==================================================================
[   17.506849] ==================================================================
[   17.506918] BUG: KASAN: slab-use-after-free in mempool_uaf_helper+0x314/0x340
[   17.506990] Read of size 1 at addr fff00000c5962600 by task kunit_try_catch/228
[   17.507041] 
[   17.507092] CPU: 1 UID: 0 PID: 228 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   17.507217] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.507361] Hardware name: linux,dummy-virt (DT)
[   17.507418] Call trace:
[   17.507469]  show_stack+0x20/0x38 (C)
[   17.507533]  dump_stack_lvl+0x8c/0xd0
[   17.507609]  print_report+0x118/0x5d0
[   17.507774]  kasan_report+0xdc/0x128
[   17.507820]  __asan_report_load1_noabort+0x20/0x30
[   17.507873]  mempool_uaf_helper+0x314/0x340
[   17.507918]  mempool_kmalloc_uaf+0xc4/0x120
[   17.507963]  kunit_try_run_case+0x170/0x3f0
[   17.508080]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.508168]  kthread+0x328/0x630
[   17.508242]  ret_from_fork+0x10/0x20
[   17.508307] 
[   17.508325] Allocated by task 228:
[   17.508380]  kasan_save_stack+0x3c/0x68
[   17.508422]  kasan_save_track+0x20/0x40
[   17.508464]  kasan_save_alloc_info+0x40/0x58
[   17.508505]  __kasan_mempool_unpoison_object+0x11c/0x180
[   17.508548]  remove_element+0x130/0x1f8
[   17.508739]  mempool_alloc_preallocated+0x58/0xc0
[   17.508792]  mempool_uaf_helper+0xa4/0x340
[   17.508859]  mempool_kmalloc_uaf+0xc4/0x120
[   17.508914]  kunit_try_run_case+0x170/0x3f0
[   17.508953]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.509079]  kthread+0x328/0x630
[   17.509120]  ret_from_fork+0x10/0x20
[   17.509157] 
[   17.509209] Freed by task 228:
[   17.509238]  kasan_save_stack+0x3c/0x68
[   17.509279]  kasan_save_track+0x20/0x40
[   17.509341]  kasan_save_free_info+0x4c/0x78
[   17.509380]  __kasan_mempool_poison_object+0xc0/0x150
[   17.509422]  mempool_free+0x28c/0x328
[   17.509456]  mempool_uaf_helper+0x104/0x340
[   17.509624]  mempool_kmalloc_uaf+0xc4/0x120
[   17.509795]  kunit_try_run_case+0x170/0x3f0
[   17.509880]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.509994]  kthread+0x328/0x630
[   17.510112]  ret_from_fork+0x10/0x20
[   17.510256] 
[   17.510276] The buggy address belongs to the object at fff00000c5962600
[   17.510276]  which belongs to the cache kmalloc-128 of size 128
[   17.510376] The buggy address is located 0 bytes inside of
[   17.510376]  freed 128-byte region [fff00000c5962600, fff00000c5962680)
[   17.510539] 
[   17.510640] The buggy address belongs to the physical page:
[   17.510708] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105962
[   17.510802] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.510900] page_type: f5(slab)
[   17.511013] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   17.511115] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   17.511155] page dumped because: kasan: bad access detected
[   17.511325] 
[   17.511445] Memory state around the buggy address:
[   17.511512]  fff00000c5962500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   17.511661]  fff00000c5962580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.511750] >fff00000c5962600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   17.511879]                    ^
[   17.511948]  fff00000c5962680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.511990]  fff00000c5962700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   17.512246] ==================================================================

[   14.041937] ==================================================================
[   14.042369] BUG: KASAN: slab-use-after-free in mempool_uaf_helper+0x392/0x400
[   14.042694] Read of size 1 at addr ffff888102afcc00 by task kunit_try_catch/244
[   14.043138] 
[   14.043259] CPU: 1 UID: 0 PID: 244 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   14.043304] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.043317] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.043352] Call Trace:
[   14.043364]  <TASK>
[   14.043378]  dump_stack_lvl+0x73/0xb0
[   14.043408]  print_report+0xd1/0x610
[   14.043431]  ? __virt_addr_valid+0x1db/0x2d0
[   14.043463]  ? mempool_uaf_helper+0x392/0x400
[   14.043486]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.043511]  ? mempool_uaf_helper+0x392/0x400
[   14.043534]  kasan_report+0x141/0x180
[   14.043557]  ? mempool_uaf_helper+0x392/0x400
[   14.043584]  __asan_report_load1_noabort+0x18/0x20
[   14.043610]  mempool_uaf_helper+0x392/0x400
[   14.043633]  ? __pfx_mempool_uaf_helper+0x10/0x10
[   14.043661]  ? finish_task_switch.isra.0+0x153/0x700
[   14.043689]  mempool_kmalloc_uaf+0xef/0x140
[   14.043712]  ? __pfx_mempool_kmalloc_uaf+0x10/0x10
[   14.043740]  ? __pfx_mempool_kmalloc+0x10/0x10
[   14.043777]  ? __pfx_mempool_kfree+0x10/0x10
[   14.043803]  ? __pfx_read_tsc+0x10/0x10
[   14.043824]  ? ktime_get_ts64+0x86/0x230
[   14.043849]  kunit_try_run_case+0x1a5/0x480
[   14.043875]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.043899]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.043925]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.043949]  ? __kthread_parkme+0x82/0x180
[   14.043971]  ? preempt_count_sub+0x50/0x80
[   14.043994]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.044019]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.044045]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.044071]  kthread+0x337/0x6f0
[   14.044090]  ? trace_preempt_on+0x20/0xc0
[   14.044114]  ? __pfx_kthread+0x10/0x10
[   14.044135]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.044157]  ? calculate_sigpending+0x7b/0xa0
[   14.044182]  ? __pfx_kthread+0x10/0x10
[   14.044204]  ret_from_fork+0x116/0x1d0
[   14.044223]  ? __pfx_kthread+0x10/0x10
[   14.044244]  ret_from_fork_asm+0x1a/0x30
[   14.044276]  </TASK>
[   14.044286] 
[   14.051509] Allocated by task 244:
[   14.051709]  kasan_save_stack+0x45/0x70
[   14.052125]  kasan_save_track+0x18/0x40
[   14.052318]  kasan_save_alloc_info+0x3b/0x50
[   14.052491]  __kasan_mempool_unpoison_object+0x1a9/0x200
[   14.052667]  remove_element+0x11e/0x190
[   14.052877]  mempool_alloc_preallocated+0x4d/0x90
[   14.053106]  mempool_uaf_helper+0x96/0x400
[   14.053316]  mempool_kmalloc_uaf+0xef/0x140
[   14.053523]  kunit_try_run_case+0x1a5/0x480
[   14.053744]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.053994]  kthread+0x337/0x6f0
[   14.054165]  ret_from_fork+0x116/0x1d0
[   14.054296]  ret_from_fork_asm+0x1a/0x30
[   14.054516] 
[   14.054612] Freed by task 244:
[   14.054782]  kasan_save_stack+0x45/0x70
[   14.054955]  kasan_save_track+0x18/0x40
[   14.055147]  kasan_save_free_info+0x3f/0x60
[   14.055303]  __kasan_mempool_poison_object+0x131/0x1d0
[   14.055474]  mempool_free+0x2ec/0x380
[   14.055608]  mempool_uaf_helper+0x11a/0x400
[   14.055767]  mempool_kmalloc_uaf+0xef/0x140
[   14.055980]  kunit_try_run_case+0x1a5/0x480
[   14.056187]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.056463]  kthread+0x337/0x6f0
[   14.056633]  ret_from_fork+0x116/0x1d0
[   14.056830]  ret_from_fork_asm+0x1a/0x30
[   14.057028] 
[   14.057122] The buggy address belongs to the object at ffff888102afcc00
[   14.057122]  which belongs to the cache kmalloc-128 of size 128
[   14.057594] The buggy address is located 0 bytes inside of
[   14.057594]  freed 128-byte region [ffff888102afcc00, ffff888102afcc80)
[   14.057995] 
[   14.058065] The buggy address belongs to the physical page:
[   14.058284] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102afc
[   14.058878] flags: 0x200000000000000(node=0|zone=2)
[   14.059073] page_type: f5(slab)
[   14.059252] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   14.059607] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   14.059922] page dumped because: kasan: bad access detected
[   14.060114] 
[   14.060183] Memory state around the buggy address:
[   14.060406]  ffff888102afcb00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   14.060779]  ffff888102afcb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.060995] >ffff888102afcc00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   14.061322]                    ^
[   14.061488]  ffff888102afcc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.061976]  ffff888102afcd00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   14.062188] ==================================================================
[   14.086512] ==================================================================
[   14.087017] BUG: KASAN: slab-use-after-free in mempool_uaf_helper+0x392/0x400
[   14.087319] Read of size 1 at addr ffff8881038e2240 by task kunit_try_catch/248
[   14.087633] 
[   14.087730] CPU: 1 UID: 0 PID: 248 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   14.087784] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.087796] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.087817] Call Trace:
[   14.087828]  <TASK>
[   14.087842]  dump_stack_lvl+0x73/0xb0
[   14.087875]  print_report+0xd1/0x610
[   14.087902]  ? __virt_addr_valid+0x1db/0x2d0
[   14.087927]  ? mempool_uaf_helper+0x392/0x400
[   14.087951]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.087976]  ? mempool_uaf_helper+0x392/0x400
[   14.088000]  kasan_report+0x141/0x180
[   14.088024]  ? mempool_uaf_helper+0x392/0x400
[   14.088052]  __asan_report_load1_noabort+0x18/0x20
[   14.088079]  mempool_uaf_helper+0x392/0x400
[   14.088103]  ? __pfx_mempool_uaf_helper+0x10/0x10
[   14.088126]  ? update_load_avg+0x1be/0x21b0
[   14.088155]  ? finish_task_switch.isra.0+0x153/0x700
[   14.088182]  mempool_slab_uaf+0xea/0x140
[   14.088206]  ? __pfx_mempool_slab_uaf+0x10/0x10
[   14.088231]  ? __kasan_check_write+0x18/0x20
[   14.088255]  ? __pfx_mempool_alloc_slab+0x10/0x10
[   14.088282]  ? __pfx_mempool_free_slab+0x10/0x10
[   14.088309]  ? __pfx_read_tsc+0x10/0x10
[   14.088331]  ? ktime_get_ts64+0x86/0x230
[   14.088353]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   14.088383]  kunit_try_run_case+0x1a5/0x480
[   14.088409]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.088435]  ? queued_spin_lock_slowpath+0x116/0xb40
[   14.088461]  ? __kthread_parkme+0x82/0x180
[   14.088483]  ? preempt_count_sub+0x50/0x80
[   14.088507]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.088532]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.088559]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.088585]  kthread+0x337/0x6f0
[   14.088605]  ? trace_preempt_on+0x20/0xc0
[   14.088628]  ? __pfx_kthread+0x10/0x10
[   14.088650]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.088780]  ? calculate_sigpending+0x7b/0xa0
[   14.088806]  ? __pfx_kthread+0x10/0x10
[   14.088829]  ret_from_fork+0x116/0x1d0
[   14.088848]  ? __pfx_kthread+0x10/0x10
[   14.088870]  ret_from_fork_asm+0x1a/0x30
[   14.088900]  </TASK>
[   14.088911] 
[   14.097122] Allocated by task 248:
[   14.097330]  kasan_save_stack+0x45/0x70
[   14.097727]  kasan_save_track+0x18/0x40
[   14.097886]  kasan_save_alloc_info+0x3b/0x50
[   14.098040]  __kasan_mempool_unpoison_object+0x1bb/0x200
[   14.098260]  remove_element+0x11e/0x190
[   14.098688]  mempool_alloc_preallocated+0x4d/0x90
[   14.098920]  mempool_uaf_helper+0x96/0x400
[   14.099112]  mempool_slab_uaf+0xea/0x140
[   14.099295]  kunit_try_run_case+0x1a5/0x480
[   14.099559]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.099806]  kthread+0x337/0x6f0
[   14.099967]  ret_from_fork+0x116/0x1d0
[   14.100134]  ret_from_fork_asm+0x1a/0x30
[   14.100322] 
[   14.100620] Freed by task 248:
[   14.100782]  kasan_save_stack+0x45/0x70
[   14.100941]  kasan_save_track+0x18/0x40
[   14.101123]  kasan_save_free_info+0x3f/0x60
[   14.101311]  __kasan_mempool_poison_object+0x131/0x1d0
[   14.101485]  mempool_free+0x2ec/0x380
[   14.101619]  mempool_uaf_helper+0x11a/0x400
[   14.101774]  mempool_slab_uaf+0xea/0x140
[   14.101913]  kunit_try_run_case+0x1a5/0x480
[   14.102066]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.102244]  kthread+0x337/0x6f0
[   14.102934]  ret_from_fork+0x116/0x1d0
[   14.103246]  ret_from_fork_asm+0x1a/0x30
[   14.105858] 
[   14.105962] The buggy address belongs to the object at ffff8881038e2240
[   14.105962]  which belongs to the cache test_cache of size 123
[   14.107387] The buggy address is located 0 bytes inside of
[   14.107387]  freed 123-byte region [ffff8881038e2240, ffff8881038e22bb)
[   14.107831] 
[   14.107908] The buggy address belongs to the physical page:
[   14.108077] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1038e2
[   14.108312] flags: 0x200000000000000(node=0|zone=2)
[   14.108471] page_type: f5(slab)
[   14.108590] raw: 0200000000000000 ffff8881038d9280 dead000000000122 0000000000000000
[   14.109654] raw: 0000000000000000 0000000080150015 00000000f5000000 0000000000000000
[   14.109992] page dumped because: kasan: bad access detected
[   14.110170] 
[   14.110247] Memory state around the buggy address:
[   14.110558]  ffff8881038e2100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   14.110800]  ffff8881038e2180: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   14.111011] >ffff8881038e2200: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
[   14.111251]                                            ^
[   14.111551]  ffff8881038e2280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   14.112462]  ffff8881038e2300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.112707] ==================================================================