Hay
Date
July 12, 2025, 11:09 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.977368] ==================================================================
[   16.977529] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x64/0x70
[   16.977597] Read of size 4 at addr fff00000c5931300 by task swapper/1/0
[   16.977645] 
[   16.977683] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   16.977766] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.977793] Hardware name: linux,dummy-virt (DT)
[   16.977823] Call trace:
[   16.977845]  show_stack+0x20/0x38 (C)
[   16.977894]  dump_stack_lvl+0x8c/0xd0
[   16.977945]  print_report+0x118/0x5d0
[   16.977992]  kasan_report+0xdc/0x128
[   16.978037]  __asan_report_load4_noabort+0x20/0x30
[   16.978090]  rcu_uaf_reclaim+0x64/0x70
[   16.978134]  rcu_core+0x9f4/0x1e20
[   16.978194]  rcu_core_si+0x18/0x30
[   16.978245]  handle_softirqs+0x374/0xb28
[   16.978384]  __do_softirq+0x1c/0x28
[   16.978507]  ____do_softirq+0x18/0x30
[   16.978736]  call_on_irq_stack+0x24/0x30
[   16.978974]  do_softirq_own_stack+0x24/0x38
[   16.979020]  __irq_exit_rcu+0x1fc/0x318
[   16.979065]  irq_exit_rcu+0x1c/0x80
[   16.979115]  el1_interrupt+0x38/0x58
[   16.979435]  el1h_64_irq_handler+0x18/0x28
[   16.980146]  el1h_64_irq+0x6c/0x70
[   16.980300]  arch_local_irq_enable+0x4/0x8 (P)
[   16.980357]  do_idle+0x384/0x4e8
[   16.980473]  cpu_startup_entry+0x64/0x80
[   16.980811]  secondary_start_kernel+0x288/0x340
[   16.981061]  __secondary_switched+0xc0/0xc8
[   16.981120] 
[   16.981139] Allocated by task 198:
[   16.981195]  kasan_save_stack+0x3c/0x68
[   16.981240]  kasan_save_track+0x20/0x40
[   16.981277]  kasan_save_alloc_info+0x40/0x58
[   16.981468]  __kasan_kmalloc+0xd4/0xd8
[   16.981512]  __kmalloc_cache_noprof+0x16c/0x3c0
[   16.981831]  rcu_uaf+0xb0/0x2d8
[   16.981901]  kunit_try_run_case+0x170/0x3f0
[   16.981997]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.982063]  kthread+0x328/0x630
[   16.982119]  ret_from_fork+0x10/0x20
[   16.982157] 
[   16.982189] Freed by task 0:
[   16.982216]  kasan_save_stack+0x3c/0x68
[   16.982496]  kasan_save_track+0x20/0x40
[   16.982605]  kasan_save_free_info+0x4c/0x78
[   16.982665]  __kasan_slab_free+0x6c/0x98
[   16.982743]  kfree+0x214/0x3c8
[   16.982851]  rcu_uaf_reclaim+0x28/0x70
[   16.982901]  rcu_core+0x9f4/0x1e20
[   16.982938]  rcu_core_si+0x18/0x30
[   16.982973]  handle_softirqs+0x374/0xb28
[   16.983010]  __do_softirq+0x1c/0x28
[   16.983045] 
[   16.983078] Last potentially related work creation:
[   16.983611]  kasan_save_stack+0x3c/0x68
[   16.983720]  kasan_record_aux_stack+0xb4/0xc8
[   16.983793]  __call_rcu_common.constprop.0+0x74/0x8c8
[   16.983835]  call_rcu+0x18/0x30
[   16.984002]  rcu_uaf+0x14c/0x2d8
[   16.984201]  kunit_try_run_case+0x170/0x3f0
[   16.984285]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.984385]  kthread+0x328/0x630
[   16.984419]  ret_from_fork+0x10/0x20
[   16.984510] 
[   16.984619] The buggy address belongs to the object at fff00000c5931300
[   16.984619]  which belongs to the cache kmalloc-32 of size 32
[   16.984741] The buggy address is located 0 bytes inside of
[   16.984741]  freed 32-byte region [fff00000c5931300, fff00000c5931320)
[   16.984852] 
[   16.984948] The buggy address belongs to the physical page:
[   16.985051] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105931
[   16.985122] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.985213] page_type: f5(slab)
[   16.985308] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   16.985449] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   16.985498] page dumped because: kasan: bad access detected
[   16.985641] 
[   16.985660] Memory state around the buggy address:
[   16.985696]  fff00000c5931200: 00 00 00 fc fc fc fc fc 00 00 05 fc fc fc fc fc
[   16.985782]  fff00000c5931280: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   16.985891] >fff00000c5931300: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   16.986023]                    ^
[   16.986128]  fff00000c5931380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.986457]  fff00000c5931400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.986842] ==================================================================

[   13.547144] ==================================================================
[   13.547615] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x50/0x60
[   13.547941] Read of size 4 at addr ffff888103a4fac0 by task swapper/0/0
[   13.548240] 
[   13.548382] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   13.548424] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.548436] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.548458] Call Trace:
[   13.548490]  <IRQ>
[   13.548505]  dump_stack_lvl+0x73/0xb0
[   13.548536]  print_report+0xd1/0x610
[   13.548584]  ? __virt_addr_valid+0x1db/0x2d0
[   13.548608]  ? rcu_uaf_reclaim+0x50/0x60
[   13.548628]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.548651]  ? rcu_uaf_reclaim+0x50/0x60
[   13.548671]  kasan_report+0x141/0x180
[   13.548693]  ? rcu_uaf_reclaim+0x50/0x60
[   13.548717]  __asan_report_load4_noabort+0x18/0x20
[   13.548850]  rcu_uaf_reclaim+0x50/0x60
[   13.548871]  rcu_core+0x66f/0x1c40
[   13.548922]  ? __pfx_rcu_core+0x10/0x10
[   13.548944]  ? ktime_get+0x6b/0x150
[   13.548964]  ? handle_softirqs+0x18e/0x730
[   13.548999]  rcu_core_si+0x12/0x20
[   13.549018]  handle_softirqs+0x209/0x730
[   13.549047]  ? hrtimer_interrupt+0x2fe/0x780
[   13.549069]  ? __pfx_handle_softirqs+0x10/0x10
[   13.549094]  __irq_exit_rcu+0xc9/0x110
[   13.549114]  irq_exit_rcu+0x12/0x20
[   13.549134]  sysvec_apic_timer_interrupt+0x81/0x90
[   13.549160]  </IRQ>
[   13.549186]  <TASK>
[   13.549222]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   13.549339] RIP: 0010:pv_native_safe_halt+0xf/0x20
[   13.549605] 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 71 21 00 fb f4 <e9> 3c 1d 02 00 66 2e 0f 1f 84 00 00 00 00 00 66 90 90 90 90 90 90
[   13.549691] RSP: 0000:ffffffff8e607dd8 EFLAGS: 00010212
[   13.549777] RAX: ffff8881cb672000 RBX: ffffffff8e61cac0 RCX: ffffffff8d475125
[   13.549823] RDX: ffffed102b60618b RSI: 0000000000000004 RDI: 000000000001819c
[   13.549865] RBP: ffffffff8e607de0 R08: 0000000000000001 R09: ffffed102b60618a
[   13.549909] R10: ffff88815b030c53 R11: 000000000000ac00 R12: 0000000000000000
[   13.549952] R13: fffffbfff1cc3958 R14: ffffffff8f1b1490 R15: 0000000000000000
[   13.550024]  ? ct_kernel_exit.constprop.0+0xa5/0xd0
[   13.550104]  ? default_idle+0xd/0x20
[   13.550127]  arch_cpu_idle+0xd/0x20
[   13.550148]  default_idle_call+0x48/0x80
[   13.550167]  do_idle+0x379/0x4f0
[   13.550194]  ? __pfx_do_idle+0x10/0x10
[   13.550215]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.550239]  ? trace_preempt_on+0x20/0xc0
[   13.550271]  ? schedule+0x86/0x2e0
[   13.550291]  ? preempt_count_sub+0x50/0x80
[   13.550314]  cpu_startup_entry+0x5c/0x70
[   13.550334]  rest_init+0x11a/0x140
[   13.550351]  ? acpi_subsystem_init+0x5d/0x150
[   13.550376]  start_kernel+0x330/0x410
[   13.550401]  x86_64_start_reservations+0x1c/0x30
[   13.550426]  x86_64_start_kernel+0x10d/0x120
[   13.550450]  common_startup_64+0x13e/0x148
[   13.550482]  </TASK>
[   13.550492] 
[   13.566131] Allocated by task 215:
[   13.566325]  kasan_save_stack+0x45/0x70
[   13.566523]  kasan_save_track+0x18/0x40
[   13.566707]  kasan_save_alloc_info+0x3b/0x50
[   13.566902]  __kasan_kmalloc+0xb7/0xc0
[   13.567678]  __kmalloc_cache_noprof+0x189/0x420
[   13.567956]  rcu_uaf+0xb0/0x330
[   13.568228]  kunit_try_run_case+0x1a5/0x480
[   13.568439]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.568664]  kthread+0x337/0x6f0
[   13.568822]  ret_from_fork+0x116/0x1d0
[   13.569052]  ret_from_fork_asm+0x1a/0x30
[   13.569236] 
[   13.569334] Freed by task 0:
[   13.569471]  kasan_save_stack+0x45/0x70
[   13.569647]  kasan_save_track+0x18/0x40
[   13.569826]  kasan_save_free_info+0x3f/0x60
[   13.570241]  __kasan_slab_free+0x56/0x70
[   13.570455]  kfree+0x222/0x3f0
[   13.570604]  rcu_uaf_reclaim+0x1f/0x60
[   13.570777]  rcu_core+0x66f/0x1c40
[   13.570926]  rcu_core_si+0x12/0x20
[   13.571168]  handle_softirqs+0x209/0x730
[   13.571367]  __irq_exit_rcu+0xc9/0x110
[   13.571541]  irq_exit_rcu+0x12/0x20
[   13.571704]  sysvec_apic_timer_interrupt+0x81/0x90
[   13.571903]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   13.572170] 
[   13.572299] Last potentially related work creation:
[   13.572521]  kasan_save_stack+0x45/0x70
[   13.572702]  kasan_record_aux_stack+0xb2/0xc0
[   13.572899]  __call_rcu_common.constprop.0+0x7b/0x9e0
[   13.573338]  call_rcu+0x12/0x20
[   13.573489]  rcu_uaf+0x168/0x330
[   13.573644]  kunit_try_run_case+0x1a5/0x480
[   13.573829]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.574192]  kthread+0x337/0x6f0
[   13.574368]  ret_from_fork+0x116/0x1d0
[   13.574540]  ret_from_fork_asm+0x1a/0x30
[   13.574738] 
[   13.574836] The buggy address belongs to the object at ffff888103a4fac0
[   13.574836]  which belongs to the cache kmalloc-32 of size 32
[   13.575572] The buggy address is located 0 bytes inside of
[   13.575572]  freed 32-byte region [ffff888103a4fac0, ffff888103a4fae0)
[   13.576135] 
[   13.576231] The buggy address belongs to the physical page:
[   13.576474] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103a4f
[   13.576799] flags: 0x200000000000000(node=0|zone=2)
[   13.577057] page_type: f5(slab)
[   13.577224] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.577539] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   13.577839] page dumped because: kasan: bad access detected
[   13.578124] 
[   13.578212] Memory state around the buggy address:
[   13.578430]  ffff888103a4f980: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.578724]  ffff888103a4fa00: 00 00 00 fc fc fc fc fc 00 00 05 fc fc fc fc fc
[   13.579081] >ffff888103a4fa80: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   13.579378]                                            ^
[   13.579601]  ffff888103a4fb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.579875]  ffff888103a4fb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.580206] ==================================================================