Hay
Date
May 12, 2025, 11:48 a.m.

Environment
qemu-arm64
qemu-x86_64

[   18.848995] ==================================================================
[   18.849411] BUG: KASAN: slab-use-after-free in mempool_uaf_helper+0x314/0x340
[   18.849482] Read of size 1 at addr fff00000c6bb4240 by task kunit_try_catch/231
[   18.849532] 
[   18.849564] CPU: 0 UID: 0 PID: 231 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250512 #1 PREEMPT 
[   18.849647] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.849672] Hardware name: linux,dummy-virt (DT)
[   18.849703] Call trace:
[   18.853046]  show_stack+0x20/0x38 (C)
[   18.853129]  dump_stack_lvl+0x8c/0xd0
[   18.853177]  print_report+0x118/0x608
[   18.853223]  kasan_report+0xdc/0x128
[   18.853264]  __asan_report_load1_noabort+0x20/0x30
[   18.853330]  mempool_uaf_helper+0x314/0x340
[   18.853432]  mempool_slab_uaf+0xc0/0x118
[   18.853478]  kunit_try_run_case+0x170/0x3f0
[   18.853524]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.853574]  kthread+0x328/0x630
[   18.853614]  ret_from_fork+0x10/0x20
[   18.853661] 
[   18.853716] Allocated by task 231:
[   18.853752]  kasan_save_stack+0x3c/0x68
[   18.853843]  kasan_save_track+0x20/0x40
[   18.853879]  kasan_save_alloc_info+0x40/0x58
[   18.854059]  __kasan_mempool_unpoison_object+0xbc/0x180
[   18.854104]  remove_element+0x16c/0x1f8
[   18.854142]  mempool_alloc_preallocated+0x58/0xc0
[   18.854182]  mempool_uaf_helper+0xa4/0x340
[   18.854215]  mempool_slab_uaf+0xc0/0x118
[   18.854269]  kunit_try_run_case+0x170/0x3f0
[   18.854303]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.854352]  kthread+0x328/0x630
[   18.854391]  ret_from_fork+0x10/0x20
[   18.854425] 
[   18.854616] Freed by task 231:
[   18.854656]  kasan_save_stack+0x3c/0x68
[   18.854729]  kasan_save_track+0x20/0x40
[   18.854764]  kasan_save_free_info+0x4c/0x78
[   18.854803]  __kasan_mempool_poison_object+0xc0/0x150
[   18.854842]  mempool_free+0x28c/0x328
[   18.854878]  mempool_uaf_helper+0x104/0x340
[   18.854913]  mempool_slab_uaf+0xc0/0x118
[   18.854946]  kunit_try_run_case+0x170/0x3f0
[   18.854980]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.855019]  kthread+0x328/0x630
[   18.855064]  ret_from_fork+0x10/0x20
[   18.855102] 
[   18.855133] The buggy address belongs to the object at fff00000c6bb4240
[   18.855133]  which belongs to the cache test_cache of size 123
[   18.855195] The buggy address is located 0 bytes inside of
[   18.855195]  freed 123-byte region [fff00000c6bb4240, fff00000c6bb42bb)
[   18.855322] 
[   18.855344] The buggy address belongs to the physical page:
[   18.855374] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106bb4
[   18.855424] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.855470] page_type: f5(slab)
[   18.855509] raw: 0bfffe0000000000 fff00000c5d1e3c0 dead000000000122 0000000000000000
[   18.855567] raw: 0000000000000000 0000000080150015 00000000f5000000 0000000000000000
[   18.855611] page dumped because: kasan: bad access detected
[   18.855653] 
[   18.855673] Memory state around the buggy address:
[   18.855703]  fff00000c6bb4100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   18.855745]  fff00000c6bb4180: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   18.855834] >fff00000c6bb4200: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
[   18.855868]                                            ^
[   18.855916]  fff00000c6bb4280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   18.856015]  fff00000c6bb4300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.856064] ==================================================================
[   18.823479] ==================================================================
[   18.823549] BUG: KASAN: slab-use-after-free in mempool_uaf_helper+0x314/0x340
[   18.823613] Read of size 1 at addr fff00000c6370f00 by task kunit_try_catch/227
[   18.823663] 
[   18.823699] CPU: 0 UID: 0 PID: 227 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250512 #1 PREEMPT 
[   18.823782] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.823809] Hardware name: linux,dummy-virt (DT)
[   18.823840] Call trace:
[   18.823878]  show_stack+0x20/0x38 (C)
[   18.823927]  dump_stack_lvl+0x8c/0xd0
[   18.823977]  print_report+0x118/0x608
[   18.824020]  kasan_report+0xdc/0x128
[   18.824078]  __asan_report_load1_noabort+0x20/0x30
[   18.824126]  mempool_uaf_helper+0x314/0x340
[   18.824170]  mempool_kmalloc_uaf+0xc4/0x120
[   18.824213]  kunit_try_run_case+0x170/0x3f0
[   18.824259]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.824305]  kthread+0x328/0x630
[   18.824349]  ret_from_fork+0x10/0x20
[   18.824395] 
[   18.824413] Allocated by task 227:
[   18.824442]  kasan_save_stack+0x3c/0x68
[   18.824483]  kasan_save_track+0x20/0x40
[   18.824519]  kasan_save_alloc_info+0x40/0x58
[   18.824557]  __kasan_mempool_unpoison_object+0x11c/0x180
[   18.824598]  remove_element+0x130/0x1f8
[   18.824633]  mempool_alloc_preallocated+0x58/0xc0
[   18.824672]  mempool_uaf_helper+0xa4/0x340
[   18.824706]  mempool_kmalloc_uaf+0xc4/0x120
[   18.824741]  kunit_try_run_case+0x170/0x3f0
[   18.824775]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.824815]  kthread+0x328/0x630
[   18.824848]  ret_from_fork+0x10/0x20
[   18.824883] 
[   18.824908] Freed by task 227:
[   18.824969]  kasan_save_stack+0x3c/0x68
[   18.825079]  kasan_save_track+0x20/0x40
[   18.825121]  kasan_save_free_info+0x4c/0x78
[   18.825159]  __kasan_mempool_poison_object+0xc0/0x150
[   18.825427]  mempool_free+0x28c/0x328
[   18.825464]  mempool_uaf_helper+0x104/0x340
[   18.825499]  mempool_kmalloc_uaf+0xc4/0x120
[   18.825621]  kunit_try_run_case+0x170/0x3f0
[   18.825729]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.825776]  kthread+0x328/0x630
[   18.825972]  ret_from_fork+0x10/0x20
[   18.826022] 
[   18.826051] The buggy address belongs to the object at fff00000c6370f00
[   18.826051]  which belongs to the cache kmalloc-128 of size 128
[   18.826275] The buggy address is located 0 bytes inside of
[   18.826275]  freed 128-byte region [fff00000c6370f00, fff00000c6370f80)
[   18.826336] 
[   18.826357] The buggy address belongs to the physical page:
[   18.826387] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106370
[   18.826760] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.826829] page_type: f5(slab)
[   18.826871] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   18.826922] raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
[   18.826961] page dumped because: kasan: bad access detected
[   18.827009] 
[   18.827079] Memory state around the buggy address:
[   18.827114]  fff00000c6370e00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   18.827158]  fff00000c6370e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.827199] >fff00000c6370f00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   18.827236]                    ^
[   18.827264]  fff00000c6370f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.827305]  fff00000c6371000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.827343] ==================================================================

[   18.392848] ==================================================================
[   18.393421] BUG: KASAN: slab-use-after-free in mempool_uaf_helper+0x392/0x400
[   18.393995] Read of size 1 at addr ffff888102306800 by task kunit_try_catch/244
[   18.394533] 
[   18.394719] CPU: 0 UID: 0 PID: 244 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250512 #1 PREEMPT(voluntary) 
[   18.394835] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.394863] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   18.394904] Call Trace:
[   18.394932]  <TASK>
[   18.394972]  dump_stack_lvl+0x73/0xb0
[   18.395080]  print_report+0xd1/0x650
[   18.395128]  ? __virt_addr_valid+0x1db/0x2d0
[   18.395174]  ? mempool_uaf_helper+0x392/0x400
[   18.395221]  ? kasan_complete_mode_report_info+0x64/0x200
[   18.395316]  ? mempool_uaf_helper+0x392/0x400
[   18.395371]  kasan_report+0x141/0x180
[   18.395424]  ? mempool_uaf_helper+0x392/0x400
[   18.395485]  __asan_report_load1_noabort+0x18/0x20
[   18.395529]  mempool_uaf_helper+0x392/0x400
[   18.395574]  ? __pfx_mempool_uaf_helper+0x10/0x10
[   18.395619]  ? __pfx_sched_clock_cpu+0x10/0x10
[   18.395694]  ? finish_task_switch.isra.0+0x153/0x700
[   18.395751]  mempool_kmalloc_uaf+0xef/0x140
[   18.395801]  ? __pfx_mempool_kmalloc_uaf+0x10/0x10
[   18.395847]  ? __pfx_mempool_kmalloc+0x10/0x10
[   18.395890]  ? __pfx_mempool_kfree+0x10/0x10
[   18.395936]  ? __pfx_read_tsc+0x10/0x10
[   18.395978]  ? ktime_get_ts64+0x86/0x230
[   18.396026]  kunit_try_run_case+0x1a5/0x480
[   18.396078]  ? __pfx_kunit_try_run_case+0x10/0x10
[   18.396122]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   18.396177]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   18.396225]  ? __kthread_parkme+0x82/0x180
[   18.396277]  ? preempt_count_sub+0x50/0x80
[   18.396324]  ? __pfx_kunit_try_run_case+0x10/0x10
[   18.396376]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   18.396421]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   18.396468]  kthread+0x337/0x6f0
[   18.396511]  ? trace_preempt_on+0x20/0xc0
[   18.396558]  ? __pfx_kthread+0x10/0x10
[   18.396585]  ? _raw_spin_unlock_irq+0x47/0x80
[   18.396610]  ? calculate_sigpending+0x7b/0xa0
[   18.396639]  ? __pfx_kthread+0x10/0x10
[   18.396688]  ret_from_fork+0x116/0x1d0
[   18.396737]  ? __pfx_kthread+0x10/0x10
[   18.396762]  ret_from_fork_asm+0x1a/0x30
[   18.396796]  </TASK>
[   18.396812] 
[   18.410487] Allocated by task 244:
[   18.410890]  kasan_save_stack+0x45/0x70
[   18.411404]  kasan_save_track+0x18/0x40
[   18.411732]  kasan_save_alloc_info+0x3b/0x50
[   18.412241]  __kasan_mempool_unpoison_object+0x1a9/0x200
[   18.412722]  remove_element+0x11e/0x190
[   18.412908]  mempool_alloc_preallocated+0x4d/0x90
[   18.413095]  mempool_uaf_helper+0x96/0x400
[   18.413285]  mempool_kmalloc_uaf+0xef/0x140
[   18.413528]  kunit_try_run_case+0x1a5/0x480
[   18.414548]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   18.415087]  kthread+0x337/0x6f0
[   18.415436]  ret_from_fork+0x116/0x1d0
[   18.415870]  ret_from_fork_asm+0x1a/0x30
[   18.416347] 
[   18.416676] Freed by task 244:
[   18.416989]  kasan_save_stack+0x45/0x70
[   18.417195]  kasan_save_track+0x18/0x40
[   18.417518]  kasan_save_free_info+0x3f/0x60
[   18.417789]  __kasan_mempool_poison_object+0x131/0x1d0
[   18.418550]  mempool_free+0x2ec/0x380
[   18.419197]  mempool_uaf_helper+0x11a/0x400
[   18.419519]  mempool_kmalloc_uaf+0xef/0x140
[   18.419869]  kunit_try_run_case+0x1a5/0x480
[   18.420079]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   18.420904]  kthread+0x337/0x6f0
[   18.421194]  ret_from_fork+0x116/0x1d0
[   18.421566]  ret_from_fork_asm+0x1a/0x30
[   18.421991] 
[   18.422176] The buggy address belongs to the object at ffff888102306800
[   18.422176]  which belongs to the cache kmalloc-128 of size 128
[   18.423211] The buggy address is located 0 bytes inside of
[   18.423211]  freed 128-byte region [ffff888102306800, ffff888102306880)
[   18.423898] 
[   18.424102] The buggy address belongs to the physical page:
[   18.424744] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102306
[   18.425056] flags: 0x200000000000000(node=0|zone=2)
[   18.425426] page_type: f5(slab)
[   18.425795] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   18.426247] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   18.426597] page dumped because: kasan: bad access detected
[   18.427032] 
[   18.427159] Memory state around the buggy address:
[   18.427403]  ffff888102306700: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   18.427923]  ffff888102306780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.428246] >ffff888102306800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   18.428598]                    ^
[   18.428900]  ffff888102306880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.429233]  ffff888102306900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.429752] ==================================================================
[   18.470857] ==================================================================
[   18.471768] BUG: KASAN: slab-use-after-free in mempool_uaf_helper+0x392/0x400
[   18.472110] Read of size 1 at addr ffff888102b61240 by task kunit_try_catch/248
[   18.472414] 
[   18.472554] CPU: 1 UID: 0 PID: 248 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250512 #1 PREEMPT(voluntary) 
[   18.472616] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.472630] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   18.472658] Call Trace:
[   18.472682]  <TASK>
[   18.472710]  dump_stack_lvl+0x73/0xb0
[   18.472744]  print_report+0xd1/0x650
[   18.472770]  ? __virt_addr_valid+0x1db/0x2d0
[   18.472795]  ? mempool_uaf_helper+0x392/0x400
[   18.472819]  ? kasan_complete_mode_report_info+0x64/0x200
[   18.472845]  ? mempool_uaf_helper+0x392/0x400
[   18.472868]  kasan_report+0x141/0x180
[   18.472892]  ? mempool_uaf_helper+0x392/0x400
[   18.472920]  __asan_report_load1_noabort+0x18/0x20
[   18.472942]  mempool_uaf_helper+0x392/0x400
[   18.472967]  ? __pfx_mempool_uaf_helper+0x10/0x10
[   18.472994]  ? __pfx_sched_clock_cpu+0x10/0x10
[   18.473018]  ? finish_task_switch.isra.0+0x153/0x700
[   18.473045]  mempool_slab_uaf+0xea/0x140
[   18.473070]  ? __pfx_mempool_slab_uaf+0x10/0x10
[   18.473097]  ? __pfx_mempool_alloc_slab+0x10/0x10
[   18.473120]  ? __pfx_mempool_free_slab+0x10/0x10
[   18.473144]  ? __pfx_read_tsc+0x10/0x10
[   18.473166]  ? ktime_get_ts64+0x86/0x230
[   18.473191]  kunit_try_run_case+0x1a5/0x480
[   18.473217]  ? __pfx_kunit_try_run_case+0x10/0x10
[   18.473241]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   18.473735]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   18.473800]  ? __kthread_parkme+0x82/0x180
[   18.474188]  ? preempt_count_sub+0x50/0x80
[   18.474252]  ? __pfx_kunit_try_run_case+0x10/0x10
[   18.474319]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   18.474376]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   18.474427]  kthread+0x337/0x6f0
[   18.474458]  ? trace_preempt_on+0x20/0xc0
[   18.474487]  ? __pfx_kthread+0x10/0x10
[   18.474509]  ? _raw_spin_unlock_irq+0x47/0x80
[   18.474532]  ? calculate_sigpending+0x7b/0xa0
[   18.474558]  ? __pfx_kthread+0x10/0x10
[   18.474582]  ret_from_fork+0x116/0x1d0
[   18.474603]  ? __pfx_kthread+0x10/0x10
[   18.474625]  ret_from_fork_asm+0x1a/0x30
[   18.474661]  </TASK>
[   18.474698] 
[   18.489521] Allocated by task 248:
[   18.489790]  kasan_save_stack+0x45/0x70
[   18.490186]  kasan_save_track+0x18/0x40
[   18.490579]  kasan_save_alloc_info+0x3b/0x50
[   18.490823]  __kasan_mempool_unpoison_object+0x1bb/0x200
[   18.491314]  remove_element+0x11e/0x190
[   18.491555]  mempool_alloc_preallocated+0x4d/0x90
[   18.492582]  mempool_uaf_helper+0x96/0x400
[   18.493150]  mempool_slab_uaf+0xea/0x140
[   18.493497]  kunit_try_run_case+0x1a5/0x480
[   18.493714]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   18.494164]  kthread+0x337/0x6f0
[   18.494393]  ret_from_fork+0x116/0x1d0
[   18.494569]  ret_from_fork_asm+0x1a/0x30
[   18.494826] 
[   18.495014] Freed by task 248:
[   18.495364]  kasan_save_stack+0x45/0x70
[   18.495591]  kasan_save_track+0x18/0x40
[   18.496557]  kasan_save_free_info+0x3f/0x60
[   18.496756]  __kasan_mempool_poison_object+0x131/0x1d0
[   18.497367]  mempool_free+0x2ec/0x380
[   18.497576]  mempool_uaf_helper+0x11a/0x400
[   18.498305]  mempool_slab_uaf+0xea/0x140
[   18.498572]  kunit_try_run_case+0x1a5/0x480
[   18.498754]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   18.499568]  kthread+0x337/0x6f0
[   18.499862]  ret_from_fork+0x116/0x1d0
[   18.500360]  ret_from_fork_asm+0x1a/0x30
[   18.500495] 
[   18.500556] The buggy address belongs to the object at ffff888102b61240
[   18.500556]  which belongs to the cache test_cache of size 123
[   18.501228] The buggy address is located 0 bytes inside of
[   18.501228]  freed 123-byte region [ffff888102b61240, ffff888102b612bb)
[   18.502753] 
[   18.502986] The buggy address belongs to the physical page:
[   18.503396] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b61
[   18.504355] flags: 0x200000000000000(node=0|zone=2)
[   18.504589] page_type: f5(slab)
[   18.505272] raw: 0200000000000000 ffff888102b5a280 dead000000000122 0000000000000000
[   18.505644] raw: 0000000000000000 0000000080150015 00000000f5000000 0000000000000000
[   18.506367] page dumped because: kasan: bad access detected
[   18.506667] 
[   18.507053] Memory state around the buggy address:
[   18.507267]  ffff888102b61100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   18.507835]  ffff888102b61180: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   18.508457] >ffff888102b61200: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
[   18.508788]                                            ^
[   18.509008]  ffff888102b61280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   18.509317]  ffff888102b61300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.509778] ==================================================================