Hay
Date
July 25, 2025, 3:13 a.m.

Environment
qemu-arm64
qemu-x86_64

[   32.887476] ==================================================================
[   32.887612] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x64/0x70
[   32.887703] Read of size 4 at addr fff00000c9b21540 by task swapper/1/0
[   32.887766] 
[   32.887808] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G    B   W        N  6.16.0-rc7-next-20250725 #1 PREEMPT 
[   32.887901] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   32.887940] Hardware name: linux,dummy-virt (DT)
[   32.887971] Call trace:
[   32.887996]  show_stack+0x20/0x38 (C)
[   32.888046]  dump_stack_lvl+0x8c/0xd0
[   32.888094]  print_report+0x118/0x5e8
[   32.888137]  kasan_report+0xdc/0x128
[   32.888180]  __asan_report_load4_noabort+0x20/0x30
[   32.888227]  rcu_uaf_reclaim+0x64/0x70
[   32.888272]  rcu_core+0x9f4/0x1e58
[   32.888317]  rcu_core_si+0x18/0x30
[   32.888361]  handle_softirqs+0x374/0xb28
[   32.888407]  __do_softirq+0x1c/0x28
[   32.888449]  ____do_softirq+0x18/0x30
[   32.888502]  call_on_irq_stack+0x30/0x48
[   32.888547]  do_softirq_own_stack+0x24/0x38
[   32.888593]  __irq_exit_rcu+0x1fc/0x318
[   32.888678]  irq_exit_rcu+0x1c/0x80
[   32.888918]  el1_interrupt+0x38/0x58
[   32.889424]  el1h_64_irq_handler+0x18/0x28
[   32.889690]  el1h_64_irq+0x6c/0x70
[   32.889860]  arch_local_irq_enable+0x4/0x8 (P)
[   32.889920]  do_idle+0x384/0x4e8
[   32.890110]  cpu_startup_entry+0x64/0x80
[   32.890222]  secondary_start_kernel+0x28c/0x340
[   32.890277]  __secondary_switched+0xc0/0xc8
[   32.890331] 
[   32.890466] Allocated by task 230:
[   32.890507]  kasan_save_stack+0x3c/0x68
[   32.890551]  kasan_save_track+0x20/0x40
[   32.890587]  kasan_save_alloc_info+0x40/0x58
[   32.890624]  __kasan_kmalloc+0xd4/0xd8
[   32.890681]  __kmalloc_cache_noprof+0x16c/0x3c0
[   32.890724]  rcu_uaf+0xb0/0x2d8
[   32.890758]  kunit_try_run_case+0x170/0x3f0
[   32.891209]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.891269]  kthread+0x328/0x630
[   32.891305]  ret_from_fork+0x10/0x20
[   32.891341] 
[   32.891361] Freed by task 0:
[   32.891591]  kasan_save_stack+0x3c/0x68
[   32.891766]  kasan_save_track+0x20/0x40
[   32.891807]  kasan_save_free_info+0x4c/0x78
[   32.891892]  __kasan_slab_free+0x7c/0xa8
[   32.891932]  kfree+0x214/0x3c8
[   32.891968]  rcu_uaf_reclaim+0x28/0x70
[   32.892012]  rcu_core+0x9f4/0x1e58
[   32.892049]  rcu_core_si+0x18/0x30
[   32.892085]  handle_softirqs+0x374/0xb28
[   32.892271]  __do_softirq+0x1c/0x28
[   32.892446] 
[   32.892479] Last potentially related work creation:
[   32.892515]  kasan_save_stack+0x3c/0x68
[   32.892555]  kasan_record_aux_stack+0xb4/0xc8
[   32.892965]  __call_rcu_common.constprop.0+0x74/0x8c8
[   32.893070]  call_rcu+0x18/0x30
[   32.893114]  rcu_uaf+0x14c/0x2d8
[   32.893149]  kunit_try_run_case+0x170/0x3f0
[   32.893312]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.893456]  kthread+0x328/0x630
[   32.893491]  ret_from_fork+0x10/0x20
[   32.893633] 
[   32.893718] The buggy address belongs to the object at fff00000c9b21540
[   32.893718]  which belongs to the cache kmalloc-32 of size 32
[   32.893838] The buggy address is located 0 bytes inside of
[   32.893838]  freed 32-byte region [fff00000c9b21540, fff00000c9b21560)
[   32.893901] 
[   32.893923] The buggy address belongs to the physical page:
[   32.893962] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109b21
[   32.894068] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   32.894191] page_type: f5(slab)
[   32.894297] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   32.894382] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   32.894454] page dumped because: kasan: bad access detected
[   32.894485] 
[   32.894503] Memory state around the buggy address:
[   32.894634]  fff00000c9b21400: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   32.895319]  fff00000c9b21480: 00 00 00 fc fc fc fc fc 00 00 05 fc fc fc fc fc
[   32.895370] >fff00000c9b21500: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   32.895470]                                            ^
[   32.895509]  fff00000c9b21580: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.895861]  fff00000c9b21600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.895929] ==================================================================

[   26.339063] ==================================================================
[   26.339541] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x50/0x60
[   26.339838] Read of size 4 at addr ffff888106252900 by task swapper/1/0
[   26.340433] 
[   26.340560] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G    B            N  6.16.0-rc7-next-20250725 #1 PREEMPT(voluntary) 
[   26.340682] Tainted: [B]=BAD_PAGE, [N]=TEST
[   26.340697] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   26.340718] Call Trace:
[   26.340741]  <IRQ>
[   26.340775]  dump_stack_lvl+0x73/0xb0
[   26.340824]  print_report+0xd1/0x640
[   26.340991]  ? __virt_addr_valid+0x1db/0x2d0
[   26.341029]  ? rcu_uaf_reclaim+0x50/0x60
[   26.341062]  ? kasan_complete_mode_report_info+0x64/0x200
[   26.341090]  ? rcu_uaf_reclaim+0x50/0x60
[   26.341112]  kasan_report+0x141/0x180
[   26.341141]  ? rcu_uaf_reclaim+0x50/0x60
[   26.341167]  __asan_report_load4_noabort+0x18/0x20
[   26.341192]  rcu_uaf_reclaim+0x50/0x60
[   26.341214]  rcu_core+0x66f/0x1c40
[   26.341244]  ? __pfx_rcu_core+0x10/0x10
[   26.341267]  ? ktime_get+0x6b/0x150
[   26.341294]  rcu_core_si+0x12/0x20
[   26.341315]  handle_softirqs+0x209/0x730
[   26.341337]  ? hrtimer_interrupt+0x2fe/0x780
[   26.341362]  ? __pfx_handle_softirqs+0x10/0x10
[   26.341388]  __irq_exit_rcu+0xc9/0x110
[   26.341409]  irq_exit_rcu+0x12/0x20
[   26.341429]  sysvec_apic_timer_interrupt+0x81/0x90
[   26.341454]  </IRQ>
[   26.341485]  <TASK>
[   26.341496]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   26.341587] RIP: 0010:pv_native_safe_halt+0xf/0x20
[   26.341803] 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 a3 e3 14 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
[   26.341885] RSP: 0000:ffff88810087fdc8 EFLAGS: 00010216
[   26.341993] RAX: ffff8881a050d000 RBX: ffff88810085b000 RCX: ffffffffb873d965
[   26.342041] RDX: ffffed102b626193 RSI: 0000000000000004 RDI: 000000000002c11c
[   26.342085] RBP: ffff88810087fdd0 R08: 0000000000000001 R09: ffffed102b626192
[   26.342127] R10: ffff88815b130c93 R11: ffff88815b1363c8 R12: 0000000000000001
[   26.342170] R13: ffffed102010b600 R14: ffffffffba3ff4d0 R15: 0000000000000000
[   26.342227]  ? ct_kernel_exit.constprop.0+0xa5/0xd0
[   26.342280]  ? default_idle+0xd/0x20
[   26.342302]  arch_cpu_idle+0xd/0x20
[   26.342324]  default_idle_call+0x48/0x80
[   26.342346]  do_idle+0x379/0x4f0
[   26.342373]  ? __pfx_do_idle+0x10/0x10
[   26.342395]  ? _raw_spin_unlock_irqrestore+0x49/0x90
[   26.342422]  ? complete+0x15b/0x1d0
[   26.342450]  cpu_startup_entry+0x5c/0x70
[   26.342474]  start_secondary+0x211/0x290
[   26.342498]  ? __pfx_start_secondary+0x10/0x10
[   26.342526]  common_startup_64+0x13e/0x148
[   26.342560]  </TASK>
[   26.342572] 
[   26.356518] Allocated by task 247:
[   26.356712]  kasan_save_stack+0x45/0x70
[   26.356920]  kasan_save_track+0x18/0x40
[   26.357383]  kasan_save_alloc_info+0x3b/0x50
[   26.357582]  __kasan_kmalloc+0xb7/0xc0
[   26.357766]  __kmalloc_cache_noprof+0x189/0x420
[   26.358030]  rcu_uaf+0xb0/0x330
[   26.358151]  kunit_try_run_case+0x1a5/0x480
[   26.358298]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.358669]  kthread+0x337/0x6f0
[   26.358960]  ret_from_fork+0x116/0x1d0
[   26.359218]  ret_from_fork_asm+0x1a/0x30
[   26.359461] 
[   26.359571] Freed by task 0:
[   26.359734]  kasan_save_stack+0x45/0x70
[   26.360056]  kasan_save_track+0x18/0x40
[   26.360284]  kasan_save_free_info+0x3f/0x60
[   26.360432]  __kasan_slab_free+0x5e/0x80
[   26.360569]  kfree+0x222/0x3f0
[   26.360717]  rcu_uaf_reclaim+0x1f/0x60
[   26.361239]  rcu_core+0x66f/0x1c40
[   26.361461]  rcu_core_si+0x12/0x20
[   26.361697]  handle_softirqs+0x209/0x730
[   26.362074]  __irq_exit_rcu+0xc9/0x110
[   26.362291]  irq_exit_rcu+0x12/0x20
[   26.362420]  sysvec_apic_timer_interrupt+0x81/0x90
[   26.362611]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   26.362878] 
[   26.363018] Last potentially related work creation:
[   26.363375]  kasan_save_stack+0x45/0x70
[   26.363593]  kasan_record_aux_stack+0xb2/0xc0
[   26.363835]  __call_rcu_common.constprop.0+0x7b/0x9e0
[   26.364112]  call_rcu+0x12/0x20
[   26.364277]  rcu_uaf+0x168/0x330
[   26.364445]  kunit_try_run_case+0x1a5/0x480
[   26.365015]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.365297]  kthread+0x337/0x6f0
[   26.365451]  ret_from_fork+0x116/0x1d0
[   26.365637]  ret_from_fork_asm+0x1a/0x30
[   26.365963] 
[   26.366072] The buggy address belongs to the object at ffff888106252900
[   26.366072]  which belongs to the cache kmalloc-32 of size 32
[   26.366614] The buggy address is located 0 bytes inside of
[   26.366614]  freed 32-byte region [ffff888106252900, ffff888106252920)
[   26.367197] 
[   26.367317] The buggy address belongs to the physical page:
[   26.367580] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106252
[   26.367935] flags: 0x200000000000000(node=0|zone=2)
[   26.368267] page_type: f5(slab)
[   26.368435] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   26.368689] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   26.369263] page dumped because: kasan: bad access detected
[   26.369523] 
[   26.369597] Memory state around the buggy address:
[   26.369932]  ffff888106252800: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   26.370292]  ffff888106252880: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   26.370613] >ffff888106252900: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   26.370994]                    ^
[   26.371157]  ffff888106252980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.371496]  ffff888106252a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.371883] ==================================================================