Hay
Date
July 24, 2025, 4:41 a.m.

Environment
qemu-arm64
qemu-x86_64

[   32.957394] ==================================================================
[   32.957535] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x64/0x70
[   32.957606] Read of size 4 at addr fff00000c9a90400 by task swapper/0/0
[   32.957655] 
[   32.957701] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Tainted: G    B            N  6.16.0-rc7-next-20250724 #1 PREEMPT 
[   32.957859] Tainted: [B]=BAD_PAGE, [N]=TEST
[   32.957899] Hardware name: linux,dummy-virt (DT)
[   32.957935] Call trace:
[   32.957959]  show_stack+0x20/0x38 (C)
[   32.958010]  dump_stack_lvl+0x8c/0xd0
[   32.958055]  print_report+0x118/0x5e8
[   32.958098]  kasan_report+0xdc/0x128
[   32.958153]  __asan_report_load4_noabort+0x20/0x30
[   32.958202]  rcu_uaf_reclaim+0x64/0x70
[   32.958255]  rcu_core+0x9f4/0x1e58
[   32.958307]  rcu_core_si+0x18/0x30
[   32.958351]  handle_softirqs+0x374/0xb28
[   32.958398]  __do_softirq+0x1c/0x28
[   32.958444]  ____do_softirq+0x18/0x30
[   32.958496]  call_on_irq_stack+0x30/0x48
[   32.958542]  do_softirq_own_stack+0x24/0x38
[   32.958587]  __irq_exit_rcu+0x1fc/0x318
[   32.958639]  irq_exit_rcu+0x1c/0x80
[   32.958695]  el1_interrupt+0x38/0x58
[   32.958742]  el1h_64_irq_handler+0x18/0x28
[   32.958800]  el1h_64_irq+0x6c/0x70
[   32.958897]  arch_local_irq_enable+0x4/0x8 (P)
[   32.958951]  do_idle+0x384/0x4e8
[   32.958995]  cpu_startup_entry+0x68/0x80
[   32.959041]  rest_init+0x160/0x188
[   32.959086]  start_kernel+0x30c/0x3d0
[   32.959136]  __primary_switched+0x8c/0xa0
[   32.959199] 
[   32.959220] Allocated by task 229:
[   32.959249]  kasan_save_stack+0x3c/0x68
[   32.959289]  kasan_save_track+0x20/0x40
[   32.959334]  kasan_save_alloc_info+0x40/0x58
[   32.959374]  __kasan_kmalloc+0xd4/0xd8
[   32.959410]  __kmalloc_cache_noprof+0x16c/0x3c0
[   32.959451]  rcu_uaf+0xb0/0x2d8
[   32.959486]  kunit_try_run_case+0x170/0x3f0
[   32.959535]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.959587]  kthread+0x328/0x630
[   32.959623]  ret_from_fork+0x10/0x20
[   32.959658] 
[   32.959687] Freed by task 0:
[   32.959720]  kasan_save_stack+0x3c/0x68
[   32.960666]  kasan_save_track+0x20/0x40
[   32.960818]  kasan_save_free_info+0x4c/0x78
[   32.960882]  __kasan_slab_free+0x6c/0x98
[   32.960919]  kfree+0x214/0x3c8
[   32.961027]  rcu_uaf_reclaim+0x28/0x70
[   32.961151]  rcu_core+0x9f4/0x1e58
[   32.961251]  rcu_core_si+0x18/0x30
[   32.961297]  handle_softirqs+0x374/0xb28
[   32.961360]  __do_softirq+0x1c/0x28
[   32.961439] 
[   32.961481] Last potentially related work creation:
[   32.961569]  kasan_save_stack+0x3c/0x68
[   32.961708]  kasan_record_aux_stack+0xb4/0xc8
[   32.961778]  __call_rcu_common.constprop.0+0x74/0x8c8
[   32.961820]  call_rcu+0x18/0x30
[   32.961854]  rcu_uaf+0x14c/0x2d8
[   32.961888]  kunit_try_run_case+0x170/0x3f0
[   32.961925]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.961968]  kthread+0x328/0x630
[   32.962000]  ret_from_fork+0x10/0x20
[   32.962041] 
[   32.962068] The buggy address belongs to the object at fff00000c9a90400
[   32.962068]  which belongs to the cache kmalloc-32 of size 32
[   32.962133] The buggy address is located 0 bytes inside of
[   32.962133]  freed 32-byte region [fff00000c9a90400, fff00000c9a90420)
[   32.962194] 
[   32.962215] The buggy address belongs to the physical page:
[   32.962279] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109a90
[   32.962336] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   32.962389] page_type: f5(slab)
[   32.962432] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   32.962559] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   32.962708] page dumped because: kasan: bad access detected
[   32.962761] 
[   32.962779] Memory state around the buggy address:
[   32.963140]  fff00000c9a90300: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   32.963195]  fff00000c9a90380: 00 00 05 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   32.963363] >fff00000c9a90400: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   32.963476]                    ^
[   32.963526]  fff00000c9a90480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.963626]  fff00000c9a90500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.963715] ==================================================================

[   27.425044] ==================================================================
[   27.425477] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x50/0x60
[   27.425743] Read of size 4 at addr ffff888104fcb8c0 by task swapper/1/0
[   27.425948] 
[   27.426039] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G    B   W        N  6.16.0-rc7-next-20250724 #1 PREEMPT(voluntary) 
[   27.426092] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   27.426106] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   27.426128] Call Trace:
[   27.426156]  <IRQ>
[   27.426178]  dump_stack_lvl+0x73/0xb0
[   27.426207]  print_report+0xd1/0x640
[   27.426230]  ? __virt_addr_valid+0x1db/0x2d0
[   27.426255]  ? rcu_uaf_reclaim+0x50/0x60
[   27.426274]  ? kasan_complete_mode_report_info+0x64/0x200
[   27.426299]  ? rcu_uaf_reclaim+0x50/0x60
[   27.426318]  kasan_report+0x141/0x180
[   27.426339]  ? rcu_uaf_reclaim+0x50/0x60
[   27.426363]  __asan_report_load4_noabort+0x18/0x20
[   27.426386]  rcu_uaf_reclaim+0x50/0x60
[   27.426405]  rcu_core+0x66f/0x1c40
[   27.426433]  ? __pfx_rcu_core+0x10/0x10
[   27.426454]  ? ktime_get+0x6b/0x150
[   27.426476]  ? handle_softirqs+0x18e/0x730
[   27.426500]  rcu_core_si+0x12/0x20
[   27.426519]  handle_softirqs+0x209/0x730
[   27.426538]  ? hrtimer_interrupt+0x2fe/0x780
[   27.426560]  ? __pfx_handle_softirqs+0x10/0x10
[   27.427173]  __irq_exit_rcu+0xc9/0x110
[   27.427215]  irq_exit_rcu+0x12/0x20
[   27.427237]  sysvec_apic_timer_interrupt+0x81/0x90
[   27.427268]  </IRQ>
[   27.427278]  <TASK>
[   27.427289]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   27.427366] RIP: 0010:pv_native_safe_halt+0xf/0x20
[   27.427394] 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 63 93 15 00 fb f4 <e9> bc 2a 02 00 66 2e 0f 1f 84 00 00 00 00 00 66 90 90 90 90 90 90
[   27.427433] RSP: 0000:ffff88810087fdc8 EFLAGS: 00010202
[   27.427470] RAX: ffff8881aff0d000 RBX: ffff88810085b000 RCX: ffffffffa8d329a5
[   27.427491] RDX: ffffed102b626193 RSI: 0000000000000004 RDI: 000000000001bf84
[   27.427509] RBP: ffff88810087fdd0 R08: 0000000000000001 R09: ffffed102b626192
[   27.427528] R10: ffff88815b130c93 R11: ffff88815b1363c8 R12: 0000000000000001
[   27.427547] R13: ffffed102010b600 R14: ffffffffaa9ff1d0 R15: 0000000000000000
[   27.427608]  ? ct_kernel_exit.constprop.0+0xa5/0xd0
[   27.427663]  ? default_idle+0xd/0x20
[   27.427684]  arch_cpu_idle+0xd/0x20
[   27.427704]  default_idle_call+0x48/0x80
[   27.427724]  do_idle+0x379/0x4f0
[   27.427751]  ? __pfx_do_idle+0x10/0x10
[   27.427771]  ? _raw_spin_unlock_irqrestore+0x49/0x90
[   27.427796]  ? complete+0x15b/0x1d0
[   27.427822]  cpu_startup_entry+0x5c/0x70
[   27.427845]  start_secondary+0x211/0x290
[   27.427869]  ? __pfx_start_secondary+0x10/0x10
[   27.427894]  common_startup_64+0x13e/0x148
[   27.427929]  </TASK>
[   27.427940] 
[   27.441655] Allocated by task 246:
[   27.441824]  kasan_save_stack+0x45/0x70
[   27.442327]  kasan_save_track+0x18/0x40
[   27.442758]  kasan_save_alloc_info+0x3b/0x50
[   27.443038]  __kasan_kmalloc+0xb7/0xc0
[   27.443213]  __kmalloc_cache_noprof+0x189/0x420
[   27.443416]  rcu_uaf+0xb0/0x330
[   27.443565]  kunit_try_run_case+0x1a5/0x480
[   27.443720]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.443981]  kthread+0x337/0x6f0
[   27.444116]  ret_from_fork+0x116/0x1d0
[   27.444242]  ret_from_fork_asm+0x1a/0x30
[   27.444394] 
[   27.444482] Freed by task 0:
[   27.444677]  kasan_save_stack+0x45/0x70
[   27.444848]  kasan_save_track+0x18/0x40
[   27.445121]  kasan_save_free_info+0x3f/0x60
[   27.445262]  __kasan_slab_free+0x56/0x70
[   27.445387]  kfree+0x222/0x3f0
[   27.445513]  rcu_uaf_reclaim+0x1f/0x60
[   27.445698]  rcu_core+0x66f/0x1c40
[   27.445865]  rcu_core_si+0x12/0x20
[   27.446181]  handle_softirqs+0x209/0x730
[   27.446365]  __irq_exit_rcu+0xc9/0x110
[   27.446487]  irq_exit_rcu+0x12/0x20
[   27.446612]  sysvec_apic_timer_interrupt+0x81/0x90
[   27.446834]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   27.447275] 
[   27.447414] Last potentially related work creation:
[   27.447657]  kasan_save_stack+0x45/0x70
[   27.447863]  kasan_record_aux_stack+0xb2/0xc0
[   27.448098]  __call_rcu_common.constprop.0+0x7b/0x9e0
[   27.448415]  call_rcu+0x12/0x20
[   27.449451]  rcu_uaf+0x168/0x330
[   27.449612]  kunit_try_run_case+0x1a5/0x480
[   27.449837]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.450179]  kthread+0x337/0x6f0
[   27.450373]  ret_from_fork+0x116/0x1d0
[   27.450687]  ret_from_fork_asm+0x1a/0x30
[   27.450907] 
[   27.451354] The buggy address belongs to the object at ffff888104fcb8c0
[   27.451354]  which belongs to the cache kmalloc-32 of size 32
[   27.451914] The buggy address is located 0 bytes inside of
[   27.451914]  freed 32-byte region [ffff888104fcb8c0, ffff888104fcb8e0)
[   27.452510] 
[   27.452837] The buggy address belongs to the physical page:
[   27.453137] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104fcb
[   27.453653] flags: 0x200000000000000(node=0|zone=2)
[   27.454018] page_type: f5(slab)
[   27.454197] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   27.454613] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   27.455190] page dumped because: kasan: bad access detected
[   27.455519] 
[   27.455624] Memory state around the buggy address:
[   27.456109]  ffff888104fcb780: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.456494]  ffff888104fcb800: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   27.456930] >ffff888104fcb880: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.457283]                                            ^
[   27.457531]  ffff888104fcb900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.457989]  ffff888104fcb980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.458380] ==================================================================