Hay
Date
July 4, 2025, 11:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   29.890834] ==================================================================
[   29.890975] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x64/0x70
[   29.891329] Read of size 4 at addr fff00000c9b3d900 by task swapper/0/0
[   29.891931] 
[   29.891974] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Tainted: G    B            N  6.16.0-rc4-next-20250704 #1 PREEMPT 
[   29.892065] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.892145] Hardware name: linux,dummy-virt (DT)
[   29.892179] Call trace:
[   29.892314]  show_stack+0x20/0x38 (C)
[   29.892401]  dump_stack_lvl+0x8c/0xd0
[   29.892450]  print_report+0x118/0x608
[   29.892733]  kasan_report+0xdc/0x128
[   29.892832]  __asan_report_load4_noabort+0x20/0x30
[   29.892886]  rcu_uaf_reclaim+0x64/0x70
[   29.892978]  rcu_core+0x9f4/0x1e20
[   29.893032]  rcu_core_si+0x18/0x30
[   29.893232]  handle_softirqs+0x374/0xb28
[   29.893304]  __do_softirq+0x1c/0x28
[   29.893364]  ____do_softirq+0x18/0x30
[   29.893641]  call_on_irq_stack+0x24/0x30
[   29.893766]  do_softirq_own_stack+0x24/0x38
[   29.893820]  __irq_exit_rcu+0x1fc/0x318
[   29.893868]  irq_exit_rcu+0x1c/0x80
[   29.894226]  el1_interrupt+0x38/0x58
[   29.894338]  el1h_64_irq_handler+0x18/0x28
[   29.894532]  el1h_64_irq+0x6c/0x70
[   29.894833]  arch_local_irq_enable+0x4/0x8 (P)
[   29.895076]  do_idle+0x384/0x4e8
[   29.895387]  cpu_startup_entry+0x68/0x80
[   29.895646]  rest_init+0x160/0x188
[   29.895826]  start_kernel+0x30c/0x3d0
[   29.896174]  __primary_switched+0x8c/0xa0
[   29.896324] 
[   29.896529] Allocated by task 231:
[   29.896708]  kasan_save_stack+0x3c/0x68
[   29.897360]  kasan_save_track+0x20/0x40
[   29.897537]  kasan_save_alloc_info+0x40/0x58
[   29.897588]  __kasan_kmalloc+0xd4/0xd8
[   29.897629]  __kmalloc_cache_noprof+0x16c/0x3c0
[   29.897671]  rcu_uaf+0xb0/0x2d8
[   29.897706]  kunit_try_run_case+0x170/0x3f0
[   29.897919]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.898135]  kthread+0x328/0x630
[   29.898345]  ret_from_fork+0x10/0x20
[   29.898533] 
[   29.898689] Freed by task 0:
[   29.898721]  kasan_save_stack+0x3c/0x68
[   29.898795]  kasan_save_track+0x20/0x40
[   29.899005]  kasan_save_free_info+0x4c/0x78
[   29.899156]  __kasan_slab_free+0x6c/0x98
[   29.899202]  kfree+0x214/0x3c8
[   29.899239]  rcu_uaf_reclaim+0x28/0x70
[   29.899275]  rcu_core+0x9f4/0x1e20
[   29.899330]  rcu_core_si+0x18/0x30
[   29.899409]  handle_softirqs+0x374/0xb28
[   29.899450]  __do_softirq+0x1c/0x28
[   29.899484] 
[   29.899540] Last potentially related work creation:
[   29.899601]  kasan_save_stack+0x3c/0x68
[   29.899655]  kasan_record_aux_stack+0xb4/0xc8
[   29.899692]  __call_rcu_common.constprop.0+0x74/0x8c8
[   29.899745]  call_rcu+0x18/0x30
[   29.899784]  rcu_uaf+0x14c/0x2d8
[   29.899818]  kunit_try_run_case+0x170/0x3f0
[   29.899859]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.900457]  kthread+0x328/0x630
[   29.900525]  ret_from_fork+0x10/0x20
[   29.900921] 
[   29.901399] The buggy address belongs to the object at fff00000c9b3d900
[   29.901399]  which belongs to the cache kmalloc-32 of size 32
[   29.901966] The buggy address is located 0 bytes inside of
[   29.901966]  freed 32-byte region [fff00000c9b3d900, fff00000c9b3d920)
[   29.902203] 
[   29.902260] The buggy address belongs to the physical page:
[   29.902335] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109b3d
[   29.902497] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   29.902551] page_type: f5(slab)
[   29.902593] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   29.902814] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   29.902984] page dumped because: kasan: bad access detected
[   29.903143] 
[   29.903343] Memory state around the buggy address:
[   29.903462]  fff00000c9b3d800: 00 00 05 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   29.903536]  fff00000c9b3d880: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   29.903759] >fff00000c9b3d900: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   29.903924]                    ^
[   29.904060]  fff00000c9b3d980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.904673]  fff00000c9b3da00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.904783] ==================================================================

[   25.525429] ==================================================================
[   25.525954] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x50/0x60
[   25.526555] Read of size 4 at addr ffff888105ab0480 by task swapper/0/0
[   25.526895] 
[   25.527029] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Tainted: G    B            N  6.16.0-rc4-next-20250704 #1 PREEMPT(voluntary) 
[   25.527090] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.527104] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.527130] Call Trace:
[   25.527163]  <IRQ>
[   25.527186]  dump_stack_lvl+0x73/0xb0
[   25.527221]  print_report+0xd1/0x650
[   25.527277]  ? __virt_addr_valid+0x1db/0x2d0
[   25.527384]  ? rcu_uaf_reclaim+0x50/0x60
[   25.527422]  ? kasan_complete_mode_report_info+0x64/0x200
[   25.527450]  ? rcu_uaf_reclaim+0x50/0x60
[   25.527473]  kasan_report+0x141/0x180
[   25.527497]  ? rcu_uaf_reclaim+0x50/0x60
[   25.527524]  __asan_report_load4_noabort+0x18/0x20
[   25.527550]  rcu_uaf_reclaim+0x50/0x60
[   25.527572]  rcu_core+0x66f/0x1c40
[   25.527605]  ? __pfx_rcu_core+0x10/0x10
[   25.527629]  ? ktime_get+0x6b/0x150
[   25.527659]  rcu_core_si+0x12/0x20
[   25.527683]  handle_softirqs+0x209/0x730
[   25.527707]  ? hrtimer_interrupt+0x2fe/0x780
[   25.527738]  ? __pfx_handle_softirqs+0x10/0x10
[   25.527766]  __irq_exit_rcu+0xc9/0x110
[   25.527789]  irq_exit_rcu+0x12/0x20
[   25.527811]  sysvec_apic_timer_interrupt+0x81/0x90
[   25.527841]  </IRQ>
[   25.527875]  <TASK>
[   25.527890]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   25.527991] RIP: 0010:pv_native_safe_halt+0xf/0x20
[   25.528454] 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 1f 19 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
[   25.528556] RSP: 0000:fffffffface07dd8 EFLAGS: 00010212
[   25.528658] RAX: ffff8881ace24000 RBX: fffffffface1cac0 RCX: ffffffffabcf9225
[   25.528726] RDX: ffffed102b606193 RSI: 0000000000000004 RDI: 000000000011d25c
[   25.528773] RBP: fffffffface07de0 R08: 0000000000000001 R09: ffffed102b606192
[   25.528819] R10: ffff88815b030c93 R11: 000000000004e000 R12: 0000000000000000
[   25.528867] R13: fffffbfff59c3958 R14: ffffffffad9efad0 R15: 0000000000000000
[   25.528931]  ? ct_kernel_exit.constprop.0+0xa5/0xd0
[   25.528991]  ? default_idle+0xd/0x20
[   25.529014]  arch_cpu_idle+0xd/0x20
[   25.529036]  default_idle_call+0x48/0x80
[   25.529060]  do_idle+0x379/0x4f0
[   25.529089]  ? __pfx_do_idle+0x10/0x10
[   25.529120]  cpu_startup_entry+0x5c/0x70
[   25.529147]  rest_init+0x11a/0x140
[   25.529181]  ? acpi_subsystem_init+0x5d/0x150
[   25.529211]  start_kernel+0x352/0x400
[   25.529236]  x86_64_start_reservations+0x1c/0x30
[   25.529260]  x86_64_start_kernel+0x10d/0x120
[   25.529283]  common_startup_64+0x13e/0x148
[   25.529319]  </TASK>
[   25.529334] 
[   25.545417] Allocated by task 247:
[   25.545586]  kasan_save_stack+0x45/0x70
[   25.545821]  kasan_save_track+0x18/0x40
[   25.546201]  kasan_save_alloc_info+0x3b/0x50
[   25.546490]  __kasan_kmalloc+0xb7/0xc0
[   25.546635]  __kmalloc_cache_noprof+0x189/0x420
[   25.546918]  rcu_uaf+0xb0/0x330
[   25.547149]  kunit_try_run_case+0x1a5/0x480
[   25.547430]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.547739]  kthread+0x337/0x6f0
[   25.547972]  ret_from_fork+0x116/0x1d0
[   25.548202]  ret_from_fork_asm+0x1a/0x30
[   25.548766] 
[   25.548901] Freed by task 0:
[   25.549101]  kasan_save_stack+0x45/0x70
[   25.549448]  kasan_save_track+0x18/0x40
[   25.549662]  kasan_save_free_info+0x3f/0x60
[   25.549915]  __kasan_slab_free+0x56/0x70
[   25.550152]  kfree+0x222/0x3f0
[   25.550327]  rcu_uaf_reclaim+0x1f/0x60
[   25.550722]  rcu_core+0x66f/0x1c40
[   25.550927]  rcu_core_si+0x12/0x20
[   25.551147]  handle_softirqs+0x209/0x730
[   25.551444]  __irq_exit_rcu+0xc9/0x110
[   25.551639]  irq_exit_rcu+0x12/0x20
[   25.551907]  sysvec_apic_timer_interrupt+0x81/0x90
[   25.552076]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   25.552791] 
[   25.552946] Last potentially related work creation:
[   25.553160]  kasan_save_stack+0x45/0x70
[   25.553312]  kasan_record_aux_stack+0xb2/0xc0
[   25.554565]  __call_rcu_common.constprop.0+0x7b/0x9e0
[   25.555029]  call_rcu+0x12/0x20
[   25.555182]  rcu_uaf+0x168/0x330
[   25.555310]  kunit_try_run_case+0x1a5/0x480
[   25.556490]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.556691]  kthread+0x337/0x6f0
[   25.557691]  ret_from_fork+0x116/0x1d0
[   25.558062]  ret_from_fork_asm+0x1a/0x30
[   25.558888] 
[   25.559023] The buggy address belongs to the object at ffff888105ab0480
[   25.559023]  which belongs to the cache kmalloc-32 of size 32
[   25.560453] The buggy address is located 0 bytes inside of
[   25.560453]  freed 32-byte region [ffff888105ab0480, ffff888105ab04a0)
[   25.561775] 
[   25.561892] The buggy address belongs to the physical page:
[   25.562084] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105ab0
[   25.562828] flags: 0x200000000000000(node=0|zone=2)
[   25.563761] page_type: f5(slab)
[   25.564341] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   25.564698] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   25.565467] page dumped because: kasan: bad access detected
[   25.565740] 
[   25.565834] Memory state around the buggy address:
[   25.566626]  ffff888105ab0380: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   25.567354]  ffff888105ab0400: 00 00 05 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   25.567973] >ffff888105ab0480: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   25.568560]                    ^
[   25.568735]  ffff888105ab0500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.569823]  ffff888105ab0580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.570418] ==================================================================