Hay
Date
June 16, 2025, 7:07 a.m.

Environment
qemu-arm64
qemu-x86_64

[   19.942490] ==================================================================
[   19.942753] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x64/0x70
[   19.942920] Read of size 4 at addr fff00000c6406880 by task swapper/0/0
[   19.943034] 
[   19.943128] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Tainted: G    B            N  6.16.0-rc2-next-20250616 #1 PREEMPT 
[   19.944818] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.945259] Hardware name: linux,dummy-virt (DT)
[   19.945344] Call trace:
[   19.945394]  show_stack+0x20/0x38 (C)
[   19.945514]  dump_stack_lvl+0x8c/0xd0
[   19.945614]  print_report+0x118/0x608
[   19.946937]  kasan_report+0xdc/0x128
[   19.947568]  __asan_report_load4_noabort+0x20/0x30
[   19.947993]  rcu_uaf_reclaim+0x64/0x70
[   19.948226]  rcu_core+0x9f4/0x1e20
[   19.948372]  rcu_core_si+0x18/0x30
[   19.948849]  handle_softirqs+0x374/0xb28
[   19.949330]  __do_softirq+0x1c/0x28
[   19.949549]  ____do_softirq+0x18/0x30
[   19.949658]  call_on_irq_stack+0x24/0x30
[   19.949805]  do_softirq_own_stack+0x24/0x38
[   19.950242]  __irq_exit_rcu+0x1fc/0x318
[   19.950761]  irq_exit_rcu+0x1c/0x80
[   19.951065]  el1_interrupt+0x38/0x58
[   19.951603]  el1h_64_irq_handler+0x18/0x28
[   19.951722]  el1h_64_irq+0x6c/0x70
[   19.952748]  finish_task_switch.isra.0+0x120/0x5e8 (P)
[   19.953554]  __schedule+0xab4/0x2840
[   19.953691]  schedule_idle+0x60/0xa8
[   19.953922]  do_idle+0x2c4/0x4e8
[   19.954168]  cpu_startup_entry+0x64/0x80
[   19.954713]  rest_init+0x160/0x188
[   19.955146]  start_kernel+0x30c/0x3d0
[   19.955297]  __primary_switched+0x8c/0xa0
[   19.955431] 
[   19.955856] Allocated by task 207:
[   19.956227]  kasan_save_stack+0x3c/0x68
[   19.956471]  kasan_save_track+0x20/0x40
[   19.956684]  kasan_save_alloc_info+0x40/0x58
[   19.957041]  __kasan_kmalloc+0xd4/0xd8
[   19.957263]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.957359]  rcu_uaf+0xb0/0x2d8
[   19.957442]  kunit_try_run_case+0x170/0x3f0
[   19.957538]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.957720]  kthread+0x328/0x630
[   19.957856]  ret_from_fork+0x10/0x20
[   19.957989] 
[   19.958060] Freed by task 0:
[   19.958140]  kasan_save_stack+0x3c/0x68
[   19.958233]  kasan_save_track+0x20/0x40
[   19.958332]  kasan_save_free_info+0x4c/0x78
[   19.958466]  __kasan_slab_free+0x6c/0x98
[   19.958555]  kfree+0x214/0x3c8
[   19.958688]  rcu_uaf_reclaim+0x28/0x70
[   19.958792]  rcu_core+0x9f4/0x1e20
[   19.958924]  rcu_core_si+0x18/0x30
[   19.959004]  handle_softirqs+0x374/0xb28
[   19.959085]  __do_softirq+0x1c/0x28
[   19.959170] 
[   19.959244] Last potentially related work creation:
[   19.959318]  kasan_save_stack+0x3c/0x68
[   19.959411]  kasan_record_aux_stack+0xb4/0xc8
[   19.959496]  __call_rcu_common.constprop.0+0x74/0x8c8
[   19.959593]  call_rcu+0x18/0x30
[   19.959671]  rcu_uaf+0x14c/0x2d8
[   19.959750]  kunit_try_run_case+0x170/0x3f0
[   19.959843]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.959936]  kthread+0x328/0x630
[   19.960006]  ret_from_fork+0x10/0x20
[   19.960376] 
[   19.960455] The buggy address belongs to the object at fff00000c6406880
[   19.960455]  which belongs to the cache kmalloc-32 of size 32
[   19.960674] The buggy address is located 0 bytes inside of
[   19.960674]  freed 32-byte region [fff00000c6406880, fff00000c64068a0)
[   19.960890] 
[   19.960942] The buggy address belongs to the physical page:
[   19.961024] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106406
[   19.961395] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.961632] page_type: f5(slab)
[   19.961727] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   19.961869] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   19.962017] page dumped because: kasan: bad access detected
[   19.962093] 
[   19.962142] Memory state around the buggy address:
[   19.962222]  fff00000c6406780: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   19.962591]  fff00000c6406800: 00 00 05 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   19.962722] >fff00000c6406880: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   19.962820]                    ^
[   19.962901]  fff00000c6406900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.963181]  fff00000c6406980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.963395] ==================================================================

[   12.045548] ==================================================================
[   12.046721] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x50/0x60
[   12.047550] Read of size 4 at addr ffff888102a265c0 by task swapper/0/0
[   12.048204] 
[   12.048387] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Tainted: G    B            N  6.16.0-rc2-next-20250616 #1 PREEMPT(voluntary) 
[   12.048436] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.048448] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.048467] Call Trace:
[   12.048498]  <IRQ>
[   12.048516]  dump_stack_lvl+0x73/0xb0
[   12.048549]  print_report+0xd1/0x650
[   12.048573]  ? __virt_addr_valid+0x1db/0x2d0
[   12.048597]  ? rcu_uaf_reclaim+0x50/0x60
[   12.048617]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.048638]  ? rcu_uaf_reclaim+0x50/0x60
[   12.048658]  kasan_report+0x141/0x180
[   12.048679]  ? rcu_uaf_reclaim+0x50/0x60
[   12.048702]  __asan_report_load4_noabort+0x18/0x20
[   12.048725]  rcu_uaf_reclaim+0x50/0x60
[   12.048744]  rcu_core+0x66f/0x1c40
[   12.048772]  ? __pfx_rcu_core+0x10/0x10
[   12.048793]  ? ktime_get+0x6b/0x150
[   12.048815]  ? handle_softirqs+0x18e/0x730
[   12.048839]  rcu_core_si+0x12/0x20
[   12.048859]  handle_softirqs+0x209/0x730
[   12.048877]  ? hrtimer_interrupt+0x2fe/0x780
[   12.048899]  ? __pfx_handle_softirqs+0x10/0x10
[   12.048923]  __irq_exit_rcu+0xc9/0x110
[   12.048955]  irq_exit_rcu+0x12/0x20
[   12.048973]  sysvec_apic_timer_interrupt+0x81/0x90
[   12.048997]  </IRQ>
[   12.049022]  <TASK>
[   12.049032]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   12.049120] RIP: 0010:pv_native_safe_halt+0xf/0x20
[   12.049325] 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 e8 1e 00 fb f4 <e9> 7c 1d 02 00 66 2e 0f 1f 84 00 00 00 00 00 66 90 90 90 90 90 90
[   12.049472] RSP: 0000:ffffffffb6a07dd8 EFLAGS: 00010202
[   12.049568] RAX: ffff88819ca67000 RBX: ffffffffb6a1cac0 RCX: ffffffffb589d225
[   12.049613] RDX: ffffed102a90618b RSI: 0000000000000004 RDI: 0000000000041244
[   12.049655] RBP: ffffffffb6a07de0 R08: 0000000000000001 R09: ffffed102a90618a
[   12.049713] R10: ffff888154830c53 R11: 000000000000f400 R12: 0000000000000000
[   12.049755] R13: fffffbfff6d43958 R14: ffffffffb75b8c90 R15: 0000000000000000
[   12.049811]  ? ct_kernel_exit.constprop.0+0xa5/0xd0
[   12.049865]  ? default_idle+0xd/0x20
[   12.049887]  arch_cpu_idle+0xd/0x20
[   12.049907]  default_idle_call+0x48/0x80
[   12.049928]  do_idle+0x379/0x4f0
[   12.049967]  ? __pfx_do_idle+0x10/0x10
[   12.049988]  ? trace_preempt_on+0x20/0xc0
[   12.050011]  ? schedule+0x86/0x2e0
[   12.050028]  ? preempt_count_sub+0x50/0x80
[   12.050054]  cpu_startup_entry+0x5c/0x70
[   12.050076]  rest_init+0x11a/0x140
[   12.050095]  ? acpi_subsystem_init+0x5d/0x150
[   12.050119]  start_kernel+0x330/0x410
[   12.050142]  x86_64_start_reservations+0x1c/0x30
[   12.050164]  x86_64_start_kernel+0x10d/0x120
[   12.050186]  common_startup_64+0x13e/0x148
[   12.050218]  </TASK>
[   12.050231] 
[   12.066266] Allocated by task 223:
[   12.066537]  kasan_save_stack+0x45/0x70
[   12.066710]  kasan_save_track+0x18/0x40
[   12.066875]  kasan_save_alloc_info+0x3b/0x50
[   12.067067]  __kasan_kmalloc+0xb7/0xc0
[   12.067224]  __kmalloc_cache_noprof+0x189/0x420
[   12.067452]  rcu_uaf+0xb0/0x330
[   12.067624]  kunit_try_run_case+0x1a5/0x480
[   12.068379]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.068617]  kthread+0x337/0x6f0
[   12.068750]  ret_from_fork+0x116/0x1d0
[   12.069086]  ret_from_fork_asm+0x1a/0x30
[   12.069379] 
[   12.069539] Freed by task 0:
[   12.069691]  kasan_save_stack+0x45/0x70
[   12.070035]  kasan_save_track+0x18/0x40
[   12.070235]  kasan_save_free_info+0x3f/0x60
[   12.070639]  __kasan_slab_free+0x56/0x70
[   12.070837]  kfree+0x222/0x3f0
[   12.071123]  rcu_uaf_reclaim+0x1f/0x60
[   12.071318]  rcu_core+0x66f/0x1c40
[   12.071469]  rcu_core_si+0x12/0x20
[   12.071780]  handle_softirqs+0x209/0x730
[   12.071948]  __irq_exit_rcu+0xc9/0x110
[   12.072124]  irq_exit_rcu+0x12/0x20
[   12.072280]  sysvec_apic_timer_interrupt+0x81/0x90
[   12.072780]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   12.072989] 
[   12.073093] Last potentially related work creation:
[   12.073700]  kasan_save_stack+0x45/0x70
[   12.073865]  kasan_record_aux_stack+0xb2/0xc0
[   12.074086]  __call_rcu_common.constprop.0+0x7b/0x9e0
[   12.074302]  call_rcu+0x12/0x20
[   12.074463]  rcu_uaf+0x168/0x330
[   12.074886]  kunit_try_run_case+0x1a5/0x480
[   12.075069]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.075433]  kthread+0x337/0x6f0
[   12.075664]  ret_from_fork+0x116/0x1d0
[   12.075799]  ret_from_fork_asm+0x1a/0x30
[   12.076025] 
[   12.076119] The buggy address belongs to the object at ffff888102a265c0
[   12.076119]  which belongs to the cache kmalloc-32 of size 32
[   12.076583] The buggy address is located 0 bytes inside of
[   12.076583]  freed 32-byte region [ffff888102a265c0, ffff888102a265e0)
[   12.077054] 
[   12.077153] The buggy address belongs to the physical page:
[   12.077374] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a26
[   12.077701] flags: 0x200000000000000(node=0|zone=2)
[   12.077911] page_type: f5(slab)
[   12.078653] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   12.078913] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   12.079356] page dumped because: kasan: bad access detected
[   12.079773] 
[   12.079877] Memory state around the buggy address:
[   12.080256]  ffff888102a26480: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   12.080484]  ffff888102a26500: 00 00 00 fc fc fc fc fc 00 00 05 fc fc fc fc fc
[   12.080973] >ffff888102a26580: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   12.081345]                                            ^
[   12.081763]  ffff888102a26600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.082170]  ffff888102a26680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.082606] ==================================================================