Hay
Date
May 29, 2025, 7:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   22.372677] ==================================================================
[   22.372955] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x64/0x70
[   22.373117] Read of size 4 at addr fff00000c669e440 by task swapper/1/0
[   22.373237] 
[   22.373332] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G    B            N  6.15.0-next-20250529 #1 PREEMPT 
[   22.376695] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.376852] Hardware name: linux,dummy-virt (DT)
[   22.376955] Call trace:
[   22.377016]  show_stack+0x20/0x38 (C)
[   22.377172]  dump_stack_lvl+0x8c/0xd0
[   22.377349]  print_report+0x118/0x608
[   22.377481]  kasan_report+0xdc/0x128
[   22.377946]  __asan_report_load4_noabort+0x20/0x30
[   22.378172]  rcu_uaf_reclaim+0x64/0x70
[   22.378333]  rcu_core+0x9f4/0x1e20
[   22.378547]  rcu_core_si+0x18/0x30
[   22.378655]  handle_softirqs+0x374/0xb28
[   22.379014]  __do_softirq+0x1c/0x28
[   22.379171]  ____do_softirq+0x18/0x30
[   22.379340]  call_on_irq_stack+0x24/0x30
[   22.379479]  do_softirq_own_stack+0x24/0x38
[   22.379652]  __irq_exit_rcu+0x1fc/0x318
[   22.379814]  irq_exit_rcu+0x1c/0x80
[   22.379959]  el1_interrupt+0x38/0x58
[   22.380073]  el1h_64_irq_handler+0x18/0x28
[   22.380195]  el1h_64_irq+0x6c/0x70
[   22.380453]  arch_local_irq_enable+0x4/0x8 (P)
[   22.380955]  do_idle+0x384/0x4e8
[   22.381091]  cpu_startup_entry+0x64/0x80
[   22.381491]  secondary_start_kernel+0x288/0x340
[   22.381642]  __secondary_switched+0xc0/0xc8
[   22.381779] 
[   22.381832] Allocated by task 198:
[   22.381906]  kasan_save_stack+0x3c/0x68
[   22.382016]  kasan_save_track+0x20/0x40
[   22.382117]  kasan_save_alloc_info+0x40/0x58
[   22.382211]  __kasan_kmalloc+0xd4/0xd8
[   22.382314]  __kmalloc_cache_noprof+0x15c/0x3c0
[   22.382459]  rcu_uaf+0xb0/0x2d8
[   22.382952]  kunit_try_run_case+0x170/0x3f0
[   22.383095]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.383204]  kthread+0x328/0x630
[   22.383322]  ret_from_fork+0x10/0x20
[   22.383450] 
[   22.383532] Freed by task 0:
[   22.383617]  kasan_save_stack+0x3c/0x68
[   22.383720]  kasan_save_track+0x20/0x40
[   22.383817]  kasan_save_free_info+0x4c/0x78
[   22.383910]  __kasan_slab_free+0x6c/0x98
[   22.384011]  kfree+0x214/0x3c8
[   22.384099]  rcu_uaf_reclaim+0x28/0x70
[   22.384199]  rcu_core+0x9f4/0x1e20
[   22.384284]  rcu_core_si+0x18/0x30
[   22.384516]  handle_softirqs+0x374/0xb28
[   22.384837]  __do_softirq+0x1c/0x28
[   22.384963] 
[   22.385099] Last potentially related work creation:
[   22.385189]  kasan_save_stack+0x3c/0x68
[   22.385285]  kasan_record_aux_stack+0xb4/0xc8
[   22.385387]  __call_rcu_common.constprop.0+0x70/0x8b0
[   22.385747]  call_rcu+0x18/0x30
[   22.385851]  rcu_uaf+0x14c/0x2d8
[   22.385936]  kunit_try_run_case+0x170/0x3f0
[   22.386033]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.386144]  kthread+0x328/0x630
[   22.386220]  ret_from_fork+0x10/0x20
[   22.386872] 
[   22.387061] The buggy address belongs to the object at fff00000c669e440
[   22.387061]  which belongs to the cache kmalloc-32 of size 32
[   22.387261] The buggy address is located 0 bytes inside of
[   22.387261]  freed 32-byte region [fff00000c669e440, fff00000c669e460)
[   22.387385] 
[   22.387444] The buggy address belongs to the physical page:
[   22.387539] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10669e
[   22.387665] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   22.388050] page_type: f5(slab)
[   22.388185] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   22.388347] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   22.388470] page dumped because: kasan: bad access detected
[   22.388550] 
[   22.388596] Memory state around the buggy address:
[   22.388685]  fff00000c669e300: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   22.388799]  fff00000c669e380: 00 00 05 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   22.388909] >fff00000c669e400: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   22.389006]                                            ^
[   22.389097]  fff00000c669e480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.389210]  fff00000c669e500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.389310] ==================================================================


[   11.415872] ==================================================================
[   11.416572] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x50/0x60
[   11.417262] Read of size 4 at addr ffff8881028a3680 by task swapper/1/0
[   11.417784] 
[   11.418049] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G    B            N  6.15.0-next-20250529 #1 PREEMPT(voluntary) 
[   11.418106] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.418119] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.418142] Call Trace:
[   11.418207]  <IRQ>
[   11.418231]  dump_stack_lvl+0x73/0xb0
[   11.418265]  print_report+0xd1/0x650
[   11.418288]  ? __virt_addr_valid+0x1db/0x2d0
[   11.418313]  ? rcu_uaf_reclaim+0x50/0x60
[   11.418333]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.418355]  ? rcu_uaf_reclaim+0x50/0x60
[   11.418376]  kasan_report+0x141/0x180
[   11.418398]  ? rcu_uaf_reclaim+0x50/0x60
[   11.418424]  __asan_report_load4_noabort+0x18/0x20
[   11.418445]  rcu_uaf_reclaim+0x50/0x60
[   11.418467]  rcu_core+0x66f/0x1c40
[   11.418496]  ? __pfx_rcu_core+0x10/0x10
[   11.418518]  ? ktime_get+0x6b/0x150
[   11.418547]  ? handle_softirqs+0x18e/0x730
[   11.418572]  rcu_core_si+0x12/0x20
[   11.418593]  handle_softirqs+0x209/0x730
[   11.418624]  ? hrtimer_interrupt+0x2fe/0x780
[   11.418646]  ? __pfx_handle_softirqs+0x10/0x10
[   11.418672]  __irq_exit_rcu+0xc9/0x110
[   11.418692]  irq_exit_rcu+0x12/0x20
[   11.418711]  sysvec_apic_timer_interrupt+0x81/0x90
[   11.418738]  </IRQ>
[   11.418768]  <TASK>
[   11.418780]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   11.418870] RIP: 0010:pv_native_safe_halt+0xf/0x20
[   11.419076] 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 23 a8 1d 00 fb f4 <c3> cc cc cc cc 66 2e 0f 1f 84 00 00 00 00 00 66 90 90 90 90 90 90
[   11.419166] RSP: 0000:ffff88810087fdc8 EFLAGS: 00010216
[   11.419258] RAX: ffff8881c975b000 RBX: ffff88810085b000 RCX: ffffffff88ab1245
[   11.419305] RDX: ffffed102a8e618b RSI: 0000000000000004 RDI: 000000000001ce7c
[   11.419348] RBP: ffff88810087fdd0 R08: 0000000000000001 R09: ffffed102a8e618a
[   11.419389] R10: ffff888154730c53 R11: 0000000000012800 R12: 0000000000000001
[   11.419431] R13: ffffed102010b600 R14: ffffffff8a7c3190 R15: 0000000000000000
[   11.419489]  ? ct_kernel_exit.constprop.0+0xa5/0xd0
[   11.419539]  ? default_idle+0xd/0x20
[   11.419559]  arch_cpu_idle+0xd/0x20
[   11.419577]  default_idle_call+0x48/0x80
[   11.419597]  do_idle+0x379/0x4f0
[   11.419628]  ? complete+0x15b/0x1d0
[   11.419647]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.419673]  ? __pfx_do_idle+0x10/0x10
[   11.419690]  ? _raw_spin_unlock_irqrestore+0x49/0x90
[   11.419714]  ? complete+0x15b/0x1d0
[   11.419735]  cpu_startup_entry+0x5c/0x70
[   11.419755]  start_secondary+0x211/0x290
[   11.419777]  ? __pfx_start_secondary+0x10/0x10
[   11.419803]  common_startup_64+0x13e/0x148
[   11.419836]  </TASK>
[   11.419847] 
[   11.434067] Allocated by task 215:
[   11.434363]  kasan_save_stack+0x45/0x70
[   11.434780]  kasan_save_track+0x18/0x40
[   11.435083]  kasan_save_alloc_info+0x3b/0x50
[   11.435300]  __kasan_kmalloc+0xb7/0xc0
[   11.435484]  __kmalloc_cache_noprof+0x189/0x420
[   11.435702]  rcu_uaf+0xb0/0x330
[   11.436121]  kunit_try_run_case+0x1a5/0x480
[   11.436538]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.437006]  kthread+0x337/0x6f0
[   11.437311]  ret_from_fork+0x116/0x1d0
[   11.437509]  ret_from_fork_asm+0x1a/0x30
[   11.437709] 
[   11.438047] Freed by task 0:
[   11.438263]  kasan_save_stack+0x45/0x70
[   11.438597]  kasan_save_track+0x18/0x40
[   11.439136]  kasan_save_free_info+0x3f/0x60
[   11.439347]  __kasan_slab_free+0x56/0x70
[   11.439532]  kfree+0x222/0x3f0
[   11.439690]  rcu_uaf_reclaim+0x1f/0x60
[   11.440137]  rcu_core+0x66f/0x1c40
[   11.440438]  rcu_core_si+0x12/0x20
[   11.440735]  handle_softirqs+0x209/0x730
[   11.441139]  __irq_exit_rcu+0xc9/0x110
[   11.441324]  irq_exit_rcu+0x12/0x20
[   11.441487]  sysvec_apic_timer_interrupt+0x81/0x90
[   11.441716]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   11.442294] 
[   11.442550] Last potentially related work creation:
[   11.442891]  kasan_save_stack+0x45/0x70
[   11.443237]  kasan_record_aux_stack+0xb2/0xc0
[   11.443443]  __call_rcu_common.constprop.0+0x72/0x9d0
[   11.443667]  call_rcu+0x12/0x20
[   11.444097]  rcu_uaf+0x168/0x330
[   11.444325]  kunit_try_run_case+0x1a5/0x480
[   11.444675]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.445135]  kthread+0x337/0x6f0
[   11.445314]  ret_from_fork+0x116/0x1d0
[   11.445487]  ret_from_fork_asm+0x1a/0x30
[   11.445692] 
[   11.446071] The buggy address belongs to the object at ffff8881028a3680
[   11.446071]  which belongs to the cache kmalloc-32 of size 32
[   11.446889] The buggy address is located 0 bytes inside of
[   11.446889]  freed 32-byte region [ffff8881028a3680, ffff8881028a36a0)
[   11.447365] 
[   11.447460] The buggy address belongs to the physical page:
[   11.447707] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1028a3
[   11.448451] flags: 0x200000000000000(node=0|zone=2)
[   11.448929] page_type: f5(slab)
[   11.449245] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   11.449806] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   11.450267] page dumped because: kasan: bad access detected
[   11.450489] 
[   11.450578] Memory state around the buggy address:
[   11.451061]  ffff8881028a3580: 00 00 00 fc fc fc fc fc 00 00 05 fc fc fc fc fc
[   11.451511]  ffff8881028a3600: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   11.452270] >ffff8881028a3680: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   11.452566]                    ^
[   11.452737]  ffff8881028a3700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.453312]  ffff8881028a3780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.453903] ==================================================================