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

Environment
qemu-arm64
qemu-x86_64

[   20.146499] ==================================================================
[   20.146563] BUG: KASAN: slab-use-after-free in mempool_uaf_helper+0x314/0x340
[   20.146618] Read of size 1 at addr fff00000c56ed700 by task kunit_try_catch/227
[   20.146666] 
[   20.146712] CPU: 1 UID: 0 PID: 227 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   20.147009] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.147078] Hardware name: linux,dummy-virt (DT)
[   20.147251] Call trace:
[   20.147376]  show_stack+0x20/0x38 (C)
[   20.147528]  dump_stack_lvl+0x8c/0xd0
[   20.147682]  print_report+0x118/0x608
[   20.147746]  kasan_report+0xdc/0x128
[   20.147791]  __asan_report_load1_noabort+0x20/0x30
[   20.147842]  mempool_uaf_helper+0x314/0x340
[   20.147887]  mempool_kmalloc_uaf+0xc4/0x120
[   20.147933]  kunit_try_run_case+0x170/0x3f0
[   20.147980]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.148032]  kthread+0x328/0x630
[   20.148081]  ret_from_fork+0x10/0x20
[   20.148224] 
[   20.148243] Allocated by task 227:
[   20.148272]  kasan_save_stack+0x3c/0x68
[   20.148313]  kasan_save_track+0x20/0x40
[   20.148351]  kasan_save_alloc_info+0x40/0x58
[   20.148390]  __kasan_mempool_unpoison_object+0x11c/0x180
[   20.148433]  remove_element+0x130/0x1f8
[   20.148470]  mempool_alloc_preallocated+0x58/0xc0
[   20.148509]  mempool_uaf_helper+0xa4/0x340
[   20.148545]  mempool_kmalloc_uaf+0xc4/0x120
[   20.148583]  kunit_try_run_case+0x170/0x3f0
[   20.148620]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.148663]  kthread+0x328/0x630
[   20.148694]  ret_from_fork+0x10/0x20
[   20.148731] 
[   20.148749] Freed by task 227:
[   20.148813]  kasan_save_stack+0x3c/0x68
[   20.148994]  kasan_save_track+0x20/0x40
[   20.149202]  kasan_save_free_info+0x4c/0x78
[   20.149242]  __kasan_mempool_poison_object+0xc0/0x150
[   20.149283]  mempool_free+0x28c/0x328
[   20.149319]  mempool_uaf_helper+0x104/0x340
[   20.149354]  mempool_kmalloc_uaf+0xc4/0x120
[   20.149391]  kunit_try_run_case+0x170/0x3f0
[   20.149428]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.149734]  kthread+0x328/0x630
[   20.149924]  ret_from_fork+0x10/0x20
[   20.149959] 
[   20.149978] The buggy address belongs to the object at fff00000c56ed700
[   20.149978]  which belongs to the cache kmalloc-128 of size 128
[   20.150041] The buggy address is located 0 bytes inside of
[   20.150041]  freed 128-byte region [fff00000c56ed700, fff00000c56ed780)
[   20.150137] 
[   20.150157] The buggy address belongs to the physical page:
[   20.150231] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1056ed
[   20.150544] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   20.150620] page_type: f5(slab)
[   20.150661] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   20.150710] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   20.150750] page dumped because: kasan: bad access detected
[   20.150781] 
[   20.150798] Memory state around the buggy address:
[   20.150846]  fff00000c56ed600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   20.150922]  fff00000c56ed680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.150964] >fff00000c56ed700: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   20.151002]                    ^
[   20.151028]  fff00000c56ed780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.151069]  fff00000c56ed800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.151107] ==================================================================
[   20.170871] ==================================================================
[   20.170932] BUG: KASAN: slab-use-after-free in mempool_uaf_helper+0x314/0x340
[   20.171005] Read of size 1 at addr fff00000c5706240 by task kunit_try_catch/231
[   20.171217] 
[   20.171270] CPU: 1 UID: 0 PID: 231 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   20.171623] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.171649] Hardware name: linux,dummy-virt (DT)
[   20.171777] Call trace:
[   20.171800]  show_stack+0x20/0x38 (C)
[   20.171847]  dump_stack_lvl+0x8c/0xd0
[   20.171891]  print_report+0x118/0x608
[   20.171937]  kasan_report+0xdc/0x128
[   20.171980]  __asan_report_load1_noabort+0x20/0x30
[   20.172039]  mempool_uaf_helper+0x314/0x340
[   20.172219]  mempool_slab_uaf+0xc0/0x118
[   20.172264]  kunit_try_run_case+0x170/0x3f0
[   20.172309]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.172361]  kthread+0x328/0x630
[   20.172402]  ret_from_fork+0x10/0x20
[   20.172449] 
[   20.172466] Allocated by task 231:
[   20.172493]  kasan_save_stack+0x3c/0x68
[   20.172533]  kasan_save_track+0x20/0x40
[   20.172570]  kasan_save_alloc_info+0x40/0x58
[   20.172610]  __kasan_mempool_unpoison_object+0xbc/0x180
[   20.172653]  remove_element+0x16c/0x1f8
[   20.172689]  mempool_alloc_preallocated+0x58/0xc0
[   20.172728]  mempool_uaf_helper+0xa4/0x340
[   20.172765]  mempool_slab_uaf+0xc0/0x118
[   20.172804]  kunit_try_run_case+0x170/0x3f0
[   20.172842]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.172915]  kthread+0x328/0x630
[   20.173098]  ret_from_fork+0x10/0x20
[   20.173135] 
[   20.173153] Freed by task 231:
[   20.173492]  kasan_save_stack+0x3c/0x68
[   20.173621]  kasan_save_track+0x20/0x40
[   20.173678]  kasan_save_free_info+0x4c/0x78
[   20.173728]  __kasan_mempool_poison_object+0xc0/0x150
[   20.173837]  mempool_free+0x28c/0x328
[   20.173873]  mempool_uaf_helper+0x104/0x340
[   20.173910]  mempool_slab_uaf+0xc0/0x118
[   20.173947]  kunit_try_run_case+0x170/0x3f0
[   20.173984]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.174030]  kthread+0x328/0x630
[   20.174064]  ret_from_fork+0x10/0x20
[   20.174101] 
[   20.174119] The buggy address belongs to the object at fff00000c5706240
[   20.174119]  which belongs to the cache test_cache of size 123
[   20.174178] The buggy address is located 0 bytes inside of
[   20.174178]  freed 123-byte region [fff00000c5706240, fff00000c57062bb)
[   20.174269] 
[   20.174290] The buggy address belongs to the physical page:
[   20.174319] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105706
[   20.174370] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   20.174416] page_type: f5(slab)
[   20.174456] raw: 0bfffe0000000000 fff00000c56e6140 dead000000000122 0000000000000000
[   20.174504] raw: 0000000000000000 0000000080150015 00000000f5000000 0000000000000000
[   20.174558] page dumped because: kasan: bad access detected
[   20.174675] 
[   20.174722] Memory state around the buggy address:
[   20.174773]  fff00000c5706100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   20.174964]  fff00000c5706180: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   20.175006] >fff00000c5706200: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
[   20.175345]                                            ^
[   20.175385]  fff00000c5706280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   20.175476]  fff00000c5706300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.175542] ==================================================================

[   13.190335] ==================================================================
[   13.190929] BUG: KASAN: slab-use-after-free in mempool_uaf_helper+0x392/0x400
[   13.191571] Read of size 1 at addr ffff888103a18240 by task kunit_try_catch/248
[   13.191886] 
[   13.192023] CPU: 0 UID: 0 PID: 248 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   13.192072] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.192085] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.192107] Call Trace:
[   13.192121]  <TASK>
[   13.192140]  dump_stack_lvl+0x73/0xb0
[   13.192171]  print_report+0xd1/0x650
[   13.192196]  ? __virt_addr_valid+0x1db/0x2d0
[   13.192222]  ? mempool_uaf_helper+0x392/0x400
[   13.192244]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.192279]  ? mempool_uaf_helper+0x392/0x400
[   13.192301]  kasan_report+0x141/0x180
[   13.192324]  ? mempool_uaf_helper+0x392/0x400
[   13.192362]  __asan_report_load1_noabort+0x18/0x20
[   13.192387]  mempool_uaf_helper+0x392/0x400
[   13.192409]  ? __pfx_mempool_uaf_helper+0x10/0x10
[   13.192434]  ? __pfx_sched_clock_cpu+0x10/0x10
[   13.192458]  ? finish_task_switch.isra.0+0x153/0x700
[   13.192483]  mempool_slab_uaf+0xea/0x140
[   13.192515]  ? __pfx_mempool_slab_uaf+0x10/0x10
[   13.192541]  ? __pfx_mempool_alloc_slab+0x10/0x10
[   13.192563]  ? __pfx_mempool_free_slab+0x10/0x10
[   13.192631]  ? __pfx_read_tsc+0x10/0x10
[   13.192655]  ? ktime_get_ts64+0x86/0x230
[   13.192681]  kunit_try_run_case+0x1a5/0x480
[   13.192708]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.192731]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.192756]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.192779]  ? __kthread_parkme+0x82/0x180
[   13.192800]  ? preempt_count_sub+0x50/0x80
[   13.192824]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.192848]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.192871]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.192894]  kthread+0x337/0x6f0
[   13.192914]  ? trace_preempt_on+0x20/0xc0
[   13.192948]  ? __pfx_kthread+0x10/0x10
[   13.192970]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.192991]  ? calculate_sigpending+0x7b/0xa0
[   13.193016]  ? __pfx_kthread+0x10/0x10
[   13.193038]  ret_from_fork+0x116/0x1d0
[   13.193057]  ? __pfx_kthread+0x10/0x10
[   13.193077]  ret_from_fork_asm+0x1a/0x30
[   13.193108]  </TASK>
[   13.193121] 
[   13.202097] Allocated by task 248:
[   13.202342]  kasan_save_stack+0x45/0x70
[   13.202536]  kasan_save_track+0x18/0x40
[   13.202781]  kasan_save_alloc_info+0x3b/0x50
[   13.202942]  __kasan_mempool_unpoison_object+0x1bb/0x200
[   13.203133]  remove_element+0x11e/0x190
[   13.203404]  mempool_alloc_preallocated+0x4d/0x90
[   13.203661]  mempool_uaf_helper+0x96/0x400
[   13.203906]  mempool_slab_uaf+0xea/0x140
[   13.204162]  kunit_try_run_case+0x1a5/0x480
[   13.204345]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.204749]  kthread+0x337/0x6f0
[   13.204996]  ret_from_fork+0x116/0x1d0
[   13.205183]  ret_from_fork_asm+0x1a/0x30
[   13.205390] 
[   13.205465] Freed by task 248:
[   13.205578]  kasan_save_stack+0x45/0x70
[   13.205716]  kasan_save_track+0x18/0x40
[   13.205852]  kasan_save_free_info+0x3f/0x60
[   13.206074]  __kasan_mempool_poison_object+0x131/0x1d0
[   13.206314]  mempool_free+0x2ec/0x380
[   13.206589]  mempool_uaf_helper+0x11a/0x400
[   13.206885]  mempool_slab_uaf+0xea/0x140
[   13.207048]  kunit_try_run_case+0x1a5/0x480
[   13.207263]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.207457]  kthread+0x337/0x6f0
[   13.207705]  ret_from_fork+0x116/0x1d0
[   13.207906]  ret_from_fork_asm+0x1a/0x30
[   13.208055] 
[   13.208128] The buggy address belongs to the object at ffff888103a18240
[   13.208128]  which belongs to the cache test_cache of size 123
[   13.208595] The buggy address is located 0 bytes inside of
[   13.208595]  freed 123-byte region [ffff888103a18240, ffff888103a182bb)
[   13.209379] 
[   13.209460] The buggy address belongs to the physical page:
[   13.209635] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103a18
[   13.209879] flags: 0x200000000000000(node=0|zone=2)
[   13.210324] page_type: f5(slab)
[   13.210533] raw: 0200000000000000 ffff888101dc2a00 dead000000000122 0000000000000000
[   13.211232] raw: 0000000000000000 0000000080150015 00000000f5000000 0000000000000000
[   13.211680] page dumped because: kasan: bad access detected
[   13.212076] 
[   13.212174] Memory state around the buggy address:
[   13.212363]  ffff888103a18100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   13.212761]  ffff888103a18180: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   13.213272] >ffff888103a18200: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
[   13.213607]                                            ^
[   13.213869]  ffff888103a18280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   13.214177]  ffff888103a18300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.214497] ==================================================================
[   13.124595] ==================================================================
[   13.125816] BUG: KASAN: slab-use-after-free in mempool_uaf_helper+0x392/0x400
[   13.126185] Read of size 1 at addr ffff888102794b00 by task kunit_try_catch/244
[   13.127403] 
[   13.127697] CPU: 1 UID: 0 PID: 244 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   13.127865] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.127882] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.127907] Call Trace:
[   13.127923]  <TASK>
[   13.127955]  dump_stack_lvl+0x73/0xb0
[   13.127992]  print_report+0xd1/0x650
[   13.128016]  ? __virt_addr_valid+0x1db/0x2d0
[   13.128042]  ? mempool_uaf_helper+0x392/0x400
[   13.128104]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.128130]  ? mempool_uaf_helper+0x392/0x400
[   13.128151]  kasan_report+0x141/0x180
[   13.128174]  ? mempool_uaf_helper+0x392/0x400
[   13.128200]  __asan_report_load1_noabort+0x18/0x20
[   13.128225]  mempool_uaf_helper+0x392/0x400
[   13.128279]  ? __pfx_mempool_uaf_helper+0x10/0x10
[   13.128304]  ? __kasan_check_write+0x18/0x20
[   13.128324]  ? __pfx_sched_clock_cpu+0x10/0x10
[   13.128348]  ? finish_task_switch.isra.0+0x153/0x700
[   13.128374]  mempool_kmalloc_uaf+0xef/0x140
[   13.128397]  ? __pfx_mempool_kmalloc_uaf+0x10/0x10
[   13.128422]  ? __pfx_mempool_kmalloc+0x10/0x10
[   13.128448]  ? __pfx_mempool_kfree+0x10/0x10
[   13.128474]  ? __pfx_read_tsc+0x10/0x10
[   13.128497]  ? ktime_get_ts64+0x86/0x230
[   13.128523]  kunit_try_run_case+0x1a5/0x480
[   13.128549]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.128571]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.128597]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.128620]  ? __kthread_parkme+0x82/0x180
[   13.128642]  ? preempt_count_sub+0x50/0x80
[   13.128665]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.128688]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.128711]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.128735]  kthread+0x337/0x6f0
[   13.128755]  ? trace_preempt_on+0x20/0xc0
[   13.128779]  ? __pfx_kthread+0x10/0x10
[   13.128800]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.128822]  ? calculate_sigpending+0x7b/0xa0
[   13.128847]  ? __pfx_kthread+0x10/0x10
[   13.128869]  ret_from_fork+0x116/0x1d0
[   13.128887]  ? __pfx_kthread+0x10/0x10
[   13.128907]  ret_from_fork_asm+0x1a/0x30
[   13.128951]  </TASK>
[   13.128964] 
[   13.145162] Allocated by task 244:
[   13.145403]  kasan_save_stack+0x45/0x70
[   13.145861]  kasan_save_track+0x18/0x40
[   13.146159]  kasan_save_alloc_info+0x3b/0x50
[   13.146315]  __kasan_mempool_unpoison_object+0x1a9/0x200
[   13.146635]  remove_element+0x11e/0x190
[   13.147028]  mempool_alloc_preallocated+0x4d/0x90
[   13.147582]  mempool_uaf_helper+0x96/0x400
[   13.147987]  mempool_kmalloc_uaf+0xef/0x140
[   13.148289]  kunit_try_run_case+0x1a5/0x480
[   13.148440]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.148624]  kthread+0x337/0x6f0
[   13.148749]  ret_from_fork+0x116/0x1d0
[   13.148884]  ret_from_fork_asm+0x1a/0x30
[   13.149387] 
[   13.149625] Freed by task 244:
[   13.150069]  kasan_save_stack+0x45/0x70
[   13.150570]  kasan_save_track+0x18/0x40
[   13.151022]  kasan_save_free_info+0x3f/0x60
[   13.151466]  __kasan_mempool_poison_object+0x131/0x1d0
[   13.152024]  mempool_free+0x2ec/0x380
[   13.152472]  mempool_uaf_helper+0x11a/0x400
[   13.153004]  mempool_kmalloc_uaf+0xef/0x140
[   13.153442]  kunit_try_run_case+0x1a5/0x480
[   13.153640]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.154245]  kthread+0x337/0x6f0
[   13.154448]  ret_from_fork+0x116/0x1d0
[   13.154850]  ret_from_fork_asm+0x1a/0x30
[   13.155251] 
[   13.155334] The buggy address belongs to the object at ffff888102794b00
[   13.155334]  which belongs to the cache kmalloc-128 of size 128
[   13.156185] The buggy address is located 0 bytes inside of
[   13.156185]  freed 128-byte region [ffff888102794b00, ffff888102794b80)
[   13.157542] 
[   13.157686] The buggy address belongs to the physical page:
[   13.157864] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102794
[   13.158283] flags: 0x200000000000000(node=0|zone=2)
[   13.158899] page_type: f5(slab)
[   13.159305] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   13.160129] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   13.160697] page dumped because: kasan: bad access detected
[   13.160884] 
[   13.160980] Memory state around the buggy address:
[   13.161179]  ffff888102794a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   13.161543]  ffff888102794a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.161804] >ffff888102794b00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   13.162221]                    ^
[   13.162366]  ffff888102794b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.162711]  ffff888102794c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.163055] ==================================================================