Hay
Date
May 15, 2025, 10:38 a.m.

Environment
qemu-arm64
qemu-x86_64

[   18.482844] ==================================================================
[   18.482980] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x64/0x70
[   18.483583] Read of size 4 at addr fff00000c17649c0 by task swapper/1/0
[   18.483662] 
[   18.483855] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT 
[   18.483978] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.484432] Hardware name: linux,dummy-virt (DT)
[   18.484547] Call trace:
[   18.484906]  show_stack+0x20/0x38 (C)
[   18.485433]  dump_stack_lvl+0x8c/0xd0
[   18.485539]  print_report+0x118/0x608
[   18.485890]  kasan_report+0xdc/0x128
[   18.486092]  __asan_report_load4_noabort+0x20/0x30
[   18.486303]  rcu_uaf_reclaim+0x64/0x70
[   18.486461]  rcu_core+0x9f4/0x1e20
[   18.486698]  rcu_core_si+0x18/0x30
[   18.486908]  handle_softirqs+0x374/0xb28
[   18.487001]  __do_softirq+0x1c/0x28
[   18.487088]  ____do_softirq+0x18/0x30
[   18.487442]  call_on_irq_stack+0x24/0x30
[   18.487714]  do_softirq_own_stack+0x24/0x38
[   18.487829]  __irq_exit_rcu+0x1fc/0x318
[   18.488092]  irq_exit_rcu+0x1c/0x80
[   18.488325]  el1_interrupt+0x38/0x58
[   18.488376]  el1h_64_irq_handler+0x18/0x28
[   18.488422]  el1h_64_irq+0x6c/0x70
[   18.489171]  arch_local_irq_enable+0x4/0x8 (P)
[   18.489624]  do_idle+0x384/0x4e8
[   18.489731]  cpu_startup_entry+0x64/0x80
[   18.490250]  secondary_start_kernel+0x288/0x340
[   18.490309]  __secondary_switched+0xc0/0xc8
[   18.490638] 
[   18.490688] Allocated by task 198:
[   18.490720]  kasan_save_stack+0x3c/0x68
[   18.491098]  kasan_save_track+0x20/0x40
[   18.491210]  kasan_save_alloc_info+0x40/0x58
[   18.491383]  __kasan_kmalloc+0xd4/0xd8
[   18.491655]  __kmalloc_cache_noprof+0x15c/0x3c0
[   18.491782]  rcu_uaf+0xb0/0x2d8
[   18.491818]  kunit_try_run_case+0x170/0x3f0
[   18.491928]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.492055]  kthread+0x328/0x630
[   18.492514]  ret_from_fork+0x10/0x20
[   18.492673] 
[   18.492761] Freed by task 0:
[   18.492985]  kasan_save_stack+0x3c/0x68
[   18.493252]  kasan_save_track+0x20/0x40
[   18.493302]  kasan_save_free_info+0x4c/0x78
[   18.493785]  __kasan_slab_free+0x6c/0x98
[   18.493828]  kfree+0x214/0x3c8
[   18.493870]  rcu_uaf_reclaim+0x28/0x70
[   18.494052]  rcu_core+0x9f4/0x1e20
[   18.494412]  rcu_core_si+0x18/0x30
[   18.494460]  handle_softirqs+0x374/0xb28
[   18.494687]  __do_softirq+0x1c/0x28
[   18.494722] 
[   18.494759] Last potentially related work creation:
[   18.495361]  kasan_save_stack+0x3c/0x68
[   18.495450]  kasan_record_aux_stack+0xb4/0xc8
[   18.495679]  __call_rcu_common.constprop.0+0x70/0x8b0
[   18.496259]  call_rcu+0x18/0x30
[   18.496392]  rcu_uaf+0x14c/0x2d8
[   18.496427]  kunit_try_run_case+0x170/0x3f0
[   18.496998]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.497115]  kthread+0x328/0x630
[   18.497412]  ret_from_fork+0x10/0x20
[   18.497477] 
[   18.497803] The buggy address belongs to the object at fff00000c17649c0
[   18.497803]  which belongs to the cache kmalloc-32 of size 32
[   18.497872] The buggy address is located 0 bytes inside of
[   18.497872]  freed 32-byte region [fff00000c17649c0, fff00000c17649e0)
[   18.498207] 
[   18.498235] The buggy address belongs to the physical page:
[   18.498268] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101764
[   18.498777] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.499369] page_type: f5(slab)
[   18.499650] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   18.499989] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   18.500362] page dumped because: kasan: bad access detected
[   18.500399] 
[   18.500576] Memory state around the buggy address:
[   18.500787]  fff00000c1764880: 00 00 00 fc fc fc fc fc 00 00 05 fc fc fc fc fc
[   18.501094]  fff00000c1764900: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   18.501440] >fff00000c1764980: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   18.501693]                                            ^
[   18.502049]  fff00000c1764a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.502103]  fff00000c1764a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.502310] ==================================================================


[   14.696712] ==================================================================
[   14.697201] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x50/0x60
[   14.697707] Read of size 4 at addr ffff88810230d380 by task swapper/1/0
[   14.698267] 
[   14.698448] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT(voluntary) 
[   14.698540] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.698561] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.698589] Call Trace:
[   14.698629]  <IRQ>
[   14.698652]  dump_stack_lvl+0x73/0xb0
[   14.698691]  print_report+0xd1/0x650
[   14.698716]  ? __virt_addr_valid+0x1db/0x2d0
[   14.698741]  ? rcu_uaf_reclaim+0x50/0x60
[   14.698761]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.698782]  ? rcu_uaf_reclaim+0x50/0x60
[   14.698802]  kasan_report+0x141/0x180
[   14.698822]  ? rcu_uaf_reclaim+0x50/0x60
[   14.698847]  __asan_report_load4_noabort+0x18/0x20
[   14.698867]  rcu_uaf_reclaim+0x50/0x60
[   14.698886]  rcu_core+0x66f/0x1c40
[   14.698914]  ? __pfx_rcu_core+0x10/0x10
[   14.698935]  ? ktime_get+0x6b/0x150
[   14.698956]  ? handle_softirqs+0x18e/0x730
[   14.698982]  rcu_core_si+0x12/0x20
[   14.699001]  handle_softirqs+0x209/0x730
[   14.699019]  ? hrtimer_interrupt+0x2fe/0x780
[   14.699041]  ? __pfx_handle_softirqs+0x10/0x10
[   14.699066]  __irq_exit_rcu+0xc9/0x110
[   14.699085]  irq_exit_rcu+0x12/0x20
[   14.699103]  sysvec_apic_timer_interrupt+0x81/0x90
[   14.699127]  </IRQ>
[   14.699156]  <TASK>
[   14.699166]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   14.699302] RIP: 0010:pv_native_safe_halt+0xf/0x20
[   14.699888] 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 36 23 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
[   14.700059] RSP: 0000:ffff888100877dc8 EFLAGS: 00010202
[   14.700243] RAX: ffff8881b0976000 RBX: ffff888100853000 RCX: ffffffffa82583e5
[   14.700321] RDX: ffffed102b62618b RSI: 0000000000000004 RDI: 000000000000c084
[   14.700390] RBP: ffff888100877dd0 R08: 0000000000000001 R09: ffffed102b62618a
[   14.700475] R10: ffff88815b130c53 R11: 0000000000016400 R12: 0000000000000001
[   14.700555] R13: ffffed102010a600 R14: ffffffffa9fb0b90 R15: 0000000000000000
[   14.700671]  ? ct_kernel_exit.constprop.0+0xa5/0xd0
[   14.700802]  ? default_idle+0xd/0x20
[   14.700832]  arch_cpu_idle+0xd/0x20
[   14.700855]  default_idle_call+0x48/0x80
[   14.700875]  do_idle+0x379/0x4f0
[   14.700898]  ? __pfx_do_idle+0x10/0x10
[   14.700915]  ? _raw_spin_unlock_irqrestore+0x49/0x90
[   14.700937]  ? complete+0x15b/0x1d0
[   14.700959]  cpu_startup_entry+0x5c/0x70
[   14.700978]  start_secondary+0x211/0x290
[   14.701000]  ? __pfx_start_secondary+0x10/0x10
[   14.701024]  common_startup_64+0x13e/0x148
[   14.701057]  </TASK>
[   14.701069] 
[   14.715046] Allocated by task 216:
[   14.715624]  kasan_save_stack+0x45/0x70
[   14.716199]  kasan_save_track+0x18/0x40
[   14.716374]  kasan_save_alloc_info+0x3b/0x50
[   14.716686]  __kasan_kmalloc+0xb7/0xc0
[   14.716998]  __kmalloc_cache_noprof+0x189/0x420
[   14.717262]  rcu_uaf+0xb0/0x330
[   14.717760]  kunit_try_run_case+0x1a5/0x480
[   14.718082]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.718405]  kthread+0x337/0x6f0
[   14.718836]  ret_from_fork+0x116/0x1d0
[   14.719120]  ret_from_fork_asm+0x1a/0x30
[   14.719449] 
[   14.719768] Freed by task 0:
[   14.719927]  kasan_save_stack+0x45/0x70
[   14.720196]  kasan_save_track+0x18/0x40
[   14.720888]  kasan_save_free_info+0x3f/0x60
[   14.721196]  __kasan_slab_free+0x56/0x70
[   14.721389]  kfree+0x222/0x3f0
[   14.721645]  rcu_uaf_reclaim+0x1f/0x60
[   14.721861]  rcu_core+0x66f/0x1c40
[   14.722375]  rcu_core_si+0x12/0x20
[   14.722686]  handle_softirqs+0x209/0x730
[   14.722943]  __irq_exit_rcu+0xc9/0x110
[   14.723113]  irq_exit_rcu+0x12/0x20
[   14.723309]  sysvec_apic_timer_interrupt+0x81/0x90
[   14.723870]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   14.724330] 
[   14.724558] Last potentially related work creation:
[   14.725077]  kasan_save_stack+0x45/0x70
[   14.725397]  kasan_record_aux_stack+0xb2/0xc0
[   14.725589]  __call_rcu_common.constprop.0+0x72/0x9d0
[   14.725903]  call_rcu+0x12/0x20
[   14.726378]  rcu_uaf+0x168/0x330
[   14.726975]  kunit_try_run_case+0x1a5/0x480
[   14.727296]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.727758]  kthread+0x337/0x6f0
[   14.728048]  ret_from_fork+0x116/0x1d0
[   14.728317]  ret_from_fork_asm+0x1a/0x30
[   14.728809] 
[   14.728959] The buggy address belongs to the object at ffff88810230d380
[   14.728959]  which belongs to the cache kmalloc-32 of size 32
[   14.729843] The buggy address is located 0 bytes inside of
[   14.729843]  freed 32-byte region [ffff88810230d380, ffff88810230d3a0)
[   14.730576] 
[   14.730762] The buggy address belongs to the physical page:
[   14.731263] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10230d
[   14.732091] flags: 0x200000000000000(node=0|zone=2)
[   14.732629] page_type: f5(slab)
[   14.732917] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   14.733252] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   14.733902] page dumped because: kasan: bad access detected
[   14.734091] 
[   14.734214] Memory state around the buggy address:
[   14.734695]  ffff88810230d280: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.734923]  ffff88810230d300: 00 00 05 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   14.735380] >ffff88810230d380: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   14.735907]                    ^
[   14.736136]  ffff88810230d400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.736555]  ffff88810230d480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.736968] ==================================================================