Hay
Date
July 9, 2025, 1:08 p.m.

Environment
qemu-arm64
qemu-x86_64

[   29.696142] ==================================================================
[   29.696270] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x64/0x70
[   29.696342] Read of size 4 at addr fff00000c5999d00 by task swapper/0/0
[   29.696389] 
[   29.696429] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Tainted: G    B            N  6.16.0-rc5-next-20250709 #1 PREEMPT 
[   29.696515] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.696543] Hardware name: linux,dummy-virt (DT)
[   29.696574] Call trace:
[   29.696599]  show_stack+0x20/0x38 (C)
[   29.696649]  dump_stack_lvl+0x8c/0xd0
[   29.696698]  print_report+0x118/0x5d0
[   29.696742]  kasan_report+0xdc/0x128
[   29.696783]  __asan_report_load4_noabort+0x20/0x30
[   29.696832]  rcu_uaf_reclaim+0x64/0x70
[   29.696875]  rcu_core+0x9f4/0x1e20
[   29.696922]  rcu_core_si+0x18/0x30
[   29.696965]  handle_softirqs+0x374/0xb28
[   29.697013]  __do_softirq+0x1c/0x28
[   29.697066]  ____do_softirq+0x18/0x30
[   29.697113]  call_on_irq_stack+0x24/0x30
[   29.697158]  do_softirq_own_stack+0x24/0x38
[   29.697203]  __irq_exit_rcu+0x1fc/0x318
[   29.697248]  irq_exit_rcu+0x1c/0x80
[   29.697290]  el1_interrupt+0x38/0x58
[   29.697334]  el1h_64_irq_handler+0x18/0x28
[   29.697379]  el1h_64_irq+0x6c/0x70
[   29.697484]  arch_local_irq_enable+0x4/0x8 (P)
[   29.697535]  do_idle+0x384/0x4e8
[   29.697580]  cpu_startup_entry+0x68/0x80
[   29.697626]  rest_init+0x160/0x188
[   29.697668]  start_kernel+0x30c/0x3d0
[   29.697718]  __primary_switched+0x8c/0xa0
[   29.697770] 
[   29.697789] Allocated by task 230:
[   29.697820]  kasan_save_stack+0x3c/0x68
[   29.697861]  kasan_save_track+0x20/0x40
[   29.697901]  kasan_save_alloc_info+0x40/0x58
[   29.697937]  __kasan_kmalloc+0xd4/0xd8
[   29.697975]  __kmalloc_cache_noprof+0x16c/0x3c0
[   29.698016]  rcu_uaf+0xb0/0x2d8
[   29.698051]  kunit_try_run_case+0x170/0x3f0
[   29.698177]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.698224]  kthread+0x328/0x630
[   29.698258]  ret_from_fork+0x10/0x20
[   29.698292] 
[   29.698310] Freed by task 0:
[   29.698336]  kasan_save_stack+0x3c/0x68
[   29.698373]  kasan_save_track+0x20/0x40
[   29.698442]  kasan_save_free_info+0x4c/0x78
[   29.698478]  __kasan_slab_free+0x6c/0x98
[   29.698517]  kfree+0x214/0x3c8
[   29.698550]  rcu_uaf_reclaim+0x28/0x70
[   29.698585]  rcu_core+0x9f4/0x1e20
[   29.698619]  rcu_core_si+0x18/0x30
[   29.698693]  handle_softirqs+0x374/0xb28
[   29.698730]  __do_softirq+0x1c/0x28
[   29.698765] 
[   29.698792] Last potentially related work creation:
[   29.698827]  kasan_save_stack+0x3c/0x68
[   29.698938]  kasan_record_aux_stack+0xb4/0xc8
[   29.699035]  __call_rcu_common.constprop.0+0x74/0x8c8
[   29.699089]  call_rcu+0x18/0x30
[   29.699159]  rcu_uaf+0x14c/0x2d8
[   29.699194]  kunit_try_run_case+0x170/0x3f0
[   29.699245]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.699291]  kthread+0x328/0x630
[   29.699325]  ret_from_fork+0x10/0x20
[   29.699376] 
[   29.699410] The buggy address belongs to the object at fff00000c5999d00
[   29.699410]  which belongs to the cache kmalloc-32 of size 32
[   29.699472] The buggy address is located 0 bytes inside of
[   29.699472]  freed 32-byte region [fff00000c5999d00, fff00000c5999d20)
[   29.699533] 
[   29.699562] The buggy address belongs to the physical page:
[   29.699605] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105999
[   29.699660] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   29.699711] page_type: f5(slab)
[   29.699752] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   29.699802] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   29.699843] page dumped because: kasan: bad access detected
[   29.699874] 
[   29.699891] Memory state around the buggy address:
[   29.699925]  fff00000c5999c00: 00 00 00 fc fc fc fc fc 00 00 05 fc fc fc fc fc
[   29.699977]  fff00000c5999c80: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   29.700019] >fff00000c5999d00: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   29.700068]                    ^
[   29.700095]  fff00000c5999d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.700135]  fff00000c5999e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.700196] ==================================================================

[   24.641999] ==================================================================
[   24.642446] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x50/0x60
[   24.642832] Read of size 4 at addr ffff8881058cf540 by task swapper/0/0
[   24.643186] 
[   24.643280] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Tainted: G    B   W        N  6.16.0-rc5-next-20250709 #1 PREEMPT(voluntary) 
[   24.643334] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   24.643348] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   24.643394] Call Trace:
[   24.643422]  <IRQ>
[   24.643442]  dump_stack_lvl+0x73/0xb0
[   24.643475]  print_report+0xd1/0x610
[   24.643498]  ? __virt_addr_valid+0x1db/0x2d0
[   24.643522]  ? rcu_uaf_reclaim+0x50/0x60
[   24.643562]  ? kasan_complete_mode_report_info+0x64/0x200
[   24.643590]  ? rcu_uaf_reclaim+0x50/0x60
[   24.643610]  kasan_report+0x141/0x180
[   24.643632]  ? rcu_uaf_reclaim+0x50/0x60
[   24.643656]  __asan_report_load4_noabort+0x18/0x20
[   24.643679]  rcu_uaf_reclaim+0x50/0x60
[   24.643710]  rcu_core+0x66f/0x1c40
[   24.643739]  ? __pfx_rcu_core+0x10/0x10
[   24.643780]  ? ktime_get+0x6b/0x150
[   24.643807]  rcu_core_si+0x12/0x20
[   24.643848]  handle_softirqs+0x209/0x730
[   24.643888]  ? hrtimer_interrupt+0x2fe/0x780
[   24.643911]  ? __pfx_handle_softirqs+0x10/0x10
[   24.643936]  __irq_exit_rcu+0xc9/0x110
[   24.643967]  irq_exit_rcu+0x12/0x20
[   24.643988]  sysvec_apic_timer_interrupt+0x81/0x90
[   24.644014]  </IRQ>
[   24.644024]  <TASK>
[   24.644036]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   24.644109] RIP: 0010:pv_native_safe_halt+0xf/0x20
[   24.644139] Code: 1f 84 00 00 00 00 00 0f 1f 40 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa eb 07 0f 00 2d c3 af 19 00 fb f4 <e9> 7c 1d 02 00 66 2e 0f 1f 84 00 00 00 00 00 66 90 90 90 90 90 90
[   24.644183] RSP: 0000:ffffffff92a07dd8 EFLAGS: 00010206
[   24.644217] RAX: ffff8881c722b000 RBX: ffffffff92a1cb00 RCX: ffffffff918f0a25
[   24.644237] RDX: ffffed102b606193 RSI: 0000000000000004 RDI: 0000000000176ff4
[   24.644256] RBP: ffffffff92a07de0 R08: 0000000000000001 R09: ffffed102b606192
[   24.644274] R10: ffff88815b030c93 R11: ffffffff93e0a700 R12: 0000000000000000
[   24.644293] R13: fffffbfff2543960 R14: ffffffff935e8bd0 R15: 0000000000000000
[   24.644342]  ? ct_kernel_exit.constprop.0+0xa5/0xd0
[   24.644395]  ? default_idle+0xd/0x20
[   24.644414]  arch_cpu_idle+0xd/0x20
[   24.644432]  default_idle_call+0x48/0x80
[   24.644451]  do_idle+0x379/0x4f0
[   24.644476]  ? __pfx_do_idle+0x10/0x10
[   24.644504]  cpu_startup_entry+0x5c/0x70
[   24.644526]  rest_init+0x11a/0x140
[   24.644545]  ? acpi_subsystem_init+0x5d/0x150
[   24.644572]  start_kernel+0x352/0x400
[   24.644595]  x86_64_start_reservations+0x1c/0x30
[   24.644617]  x86_64_start_kernel+0x10d/0x120
[   24.644640]  common_startup_64+0x13e/0x148
[   24.644672]  </TASK>
[   24.644683] 
[   24.654708] Allocated by task 248:
[   24.654926]  kasan_save_stack+0x45/0x70
[   24.655127]  kasan_save_track+0x18/0x40
[   24.655260]  kasan_save_alloc_info+0x3b/0x50
[   24.655400]  __kasan_kmalloc+0xb7/0xc0
[   24.655577]  __kmalloc_cache_noprof+0x189/0x420
[   24.656015]  rcu_uaf+0xb0/0x330
[   24.656192]  kunit_try_run_case+0x1a5/0x480
[   24.656386]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.656602]  kthread+0x337/0x6f0
[   24.656806]  ret_from_fork+0x116/0x1d0
[   24.657166]  ret_from_fork_asm+0x1a/0x30
[   24.657389] 
[   24.657468] Freed by task 0:
[   24.657585]  kasan_save_stack+0x45/0x70
[   24.657729]  kasan_save_track+0x18/0x40
[   24.657861]  kasan_save_free_info+0x3f/0x60
[   24.658161]  __kasan_slab_free+0x56/0x70
[   24.658351]  kfree+0x222/0x3f0
[   24.658506]  rcu_uaf_reclaim+0x1f/0x60
[   24.658686]  rcu_core+0x66f/0x1c40
[   24.658894]  rcu_core_si+0x12/0x20
[   24.659063]  handle_softirqs+0x209/0x730
[   24.659344]  __irq_exit_rcu+0xc9/0x110
[   24.659527]  irq_exit_rcu+0x12/0x20
[   24.659676]  sysvec_apic_timer_interrupt+0x81/0x90
[   24.659950]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   24.660181] 
[   24.660291] Last potentially related work creation:
[   24.660554]  kasan_save_stack+0x45/0x70
[   24.660782]  kasan_record_aux_stack+0xb2/0xc0
[   24.660994]  __call_rcu_common.constprop.0+0x7b/0x9e0
[   24.661464]  call_rcu+0x12/0x20
[   24.661603]  rcu_uaf+0x168/0x330
[   24.661734]  kunit_try_run_case+0x1a5/0x480
[   24.662028]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.662306]  kthread+0x337/0x6f0
[   24.662470]  ret_from_fork+0x116/0x1d0
[   24.662607]  ret_from_fork_asm+0x1a/0x30
[   24.662767] 
[   24.662851] The buggy address belongs to the object at ffff8881058cf540
[   24.662851]  which belongs to the cache kmalloc-32 of size 32
[   24.663455] The buggy address is located 0 bytes inside of
[   24.663455]  freed 32-byte region [ffff8881058cf540, ffff8881058cf560)
[   24.664120] 
[   24.664197] The buggy address belongs to the physical page:
[   24.664360] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1058cf
[   24.664712] flags: 0x200000000000000(node=0|zone=2)
[   24.665129] page_type: f5(slab)
[   24.665322] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   24.665629] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   24.665935] page dumped because: kasan: bad access detected
[   24.666190] 
[   24.666305] Memory state around the buggy address:
[   24.666525]  ffff8881058cf400: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   24.666948]  ffff8881058cf480: 00 00 00 fc fc fc fc fc 00 00 05 fc fc fc fc fc
[   24.667194] >ffff8881058cf500: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   24.667489]                                            ^
[   24.667717]  ffff8881058cf580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.667965]  ffff8881058cf600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.668272] ==================================================================