Hay
Date
July 8, 2025, 7:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   19.774044] ==================================================================
[   19.774179] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x64/0x70
[   19.777502] Read of size 4 at addr fff00000c5707d00 by task rcu_preempt/16
[   19.777570] 
[   19.777613] CPU: 1 UID: 0 PID: 16 Comm: rcu_preempt Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   19.777699] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.777737] Hardware name: linux,dummy-virt (DT)
[   19.777769] Call trace:
[   19.777793]  show_stack+0x20/0x38 (C)
[   19.777857]  dump_stack_lvl+0x8c/0xd0
[   19.777917]  print_report+0x118/0x608
[   19.777962]  kasan_report+0xdc/0x128
[   19.778006]  __asan_report_load4_noabort+0x20/0x30
[   19.778204]  rcu_uaf_reclaim+0x64/0x70
[   19.778276]  rcu_core+0x9f4/0x1e20
[   19.778334]  rcu_core_si+0x18/0x30
[   19.778387]  handle_softirqs+0x374/0xb28
[   19.778443]  __do_softirq+0x1c/0x28
[   19.778486]  ____do_softirq+0x18/0x30
[   19.778557]  call_on_irq_stack+0x24/0x30
[   19.778603]  do_softirq_own_stack+0x24/0x38
[   19.778648]  __irq_exit_rcu+0x1fc/0x318
[   19.778692]  irq_exit_rcu+0x1c/0x80
[   19.778744]  el1_interrupt+0x38/0x58
[   19.778967]  el1h_64_irq_handler+0x18/0x28
[   19.779037]  el1h_64_irq+0x6c/0x70
[   19.779404]  preempt_count_sub+0x50/0x148 (P)
[   19.779525]  _raw_spin_unlock_irq+0x38/0x90
[   19.779598]  rcu_gp_cleanup+0x2a8/0xe28
[   19.779683]  rcu_gp_kthread+0x434/0x590
[   19.779874]  kthread+0x328/0x630
[   19.779926]  ret_from_fork+0x10/0x20
[   19.780014] 
[   19.780079] Allocated by task 198:
[   19.780208]  kasan_save_stack+0x3c/0x68
[   19.780274]  kasan_save_track+0x20/0x40
[   19.780388]  kasan_save_alloc_info+0x40/0x58
[   19.780469]  __kasan_kmalloc+0xd4/0xd8
[   19.780605]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.780664]  rcu_uaf+0xb0/0x2d8
[   19.780803]  kunit_try_run_case+0x170/0x3f0
[   19.780873]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.780937]  kthread+0x328/0x630
[   19.780971]  ret_from_fork+0x10/0x20
[   19.781269] 
[   19.781328] Freed by task 16:
[   19.781385]  kasan_save_stack+0x3c/0x68
[   19.781509]  kasan_save_track+0x20/0x40
[   19.781962]  kasan_save_free_info+0x4c/0x78
[   19.783222]  __kasan_slab_free+0x6c/0x98
[   19.783296]  kfree+0x214/0x3c8
[   19.783340]  rcu_uaf_reclaim+0x28/0x70
[   19.783396]  rcu_core+0x9f4/0x1e20
[   19.783431]  rcu_core_si+0x18/0x30
[   19.783493]  handle_softirqs+0x374/0xb28
[   19.783529]  __do_softirq+0x1c/0x28
[   19.783564] 
[   19.783600] Last potentially related work creation:
[   19.783880]  kasan_save_stack+0x3c/0x68
[   19.784003]  kasan_record_aux_stack+0xb4/0xc8
[   19.784062]  __call_rcu_common.constprop.0+0x74/0x8c8
[   19.784108]  call_rcu+0x18/0x30
[   19.784352]  rcu_uaf+0x14c/0x2d8
[   19.784410]  kunit_try_run_case+0x170/0x3f0
[   19.784483]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.784529]  kthread+0x328/0x630
[   19.784565]  ret_from_fork+0x10/0x20
[   19.784612] 
[   19.784641] The buggy address belongs to the object at fff00000c5707d00
[   19.784641]  which belongs to the cache kmalloc-32 of size 32
[   19.784702] The buggy address is located 0 bytes inside of
[   19.784702]  freed 32-byte region [fff00000c5707d00, fff00000c5707d20)
[   19.784777] 
[   19.784799] The buggy address belongs to the physical page:
[   19.784829] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105707
[   19.784890] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.784942] page_type: f5(slab)
[   19.784983] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   19.785033] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   19.785074] page dumped because: kasan: bad access detected
[   19.785110] 
[   19.785127] Memory state around the buggy address:
[   19.785163]  fff00000c5707c00: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   19.785206]  fff00000c5707c80: 00 00 05 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   19.785249] >fff00000c5707d00: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   19.785287]                    ^
[   19.785317]  fff00000c5707d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.785361]  fff00000c5707e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.785441] ==================================================================

[   13.520195] ==================================================================
[   13.520672] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x50/0x60
[   13.521915] Read of size 4 at addr ffff88810260e680 by task swapper/1/0
[   13.523158] 
[   13.523620] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   13.523671] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.523684] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.523706] Call Trace:
[   13.523737]  <IRQ>
[   13.523756]  dump_stack_lvl+0x73/0xb0
[   13.523790]  print_report+0xd1/0x650
[   13.523813]  ? __virt_addr_valid+0x1db/0x2d0
[   13.523836]  ? rcu_uaf_reclaim+0x50/0x60
[   13.523854]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.523879]  ? rcu_uaf_reclaim+0x50/0x60
[   13.523898]  kasan_report+0x141/0x180
[   13.523919]  ? rcu_uaf_reclaim+0x50/0x60
[   13.523943]  __asan_report_load4_noabort+0x18/0x20
[   13.523965]  rcu_uaf_reclaim+0x50/0x60
[   13.523984]  rcu_core+0x66f/0x1c40
[   13.524013]  ? __pfx_rcu_core+0x10/0x10
[   13.524033]  ? ktime_get+0x6b/0x150
[   13.524068]  ? handle_softirqs+0x18e/0x730
[   13.524093]  rcu_core_si+0x12/0x20
[   13.524114]  handle_softirqs+0x209/0x730
[   13.524132]  ? hrtimer_interrupt+0x2fe/0x780
[   13.524158]  ? __pfx_handle_softirqs+0x10/0x10
[   13.524182]  __irq_exit_rcu+0xc9/0x110
[   13.524201]  irq_exit_rcu+0x12/0x20
[   13.524220]  sysvec_apic_timer_interrupt+0x81/0x90
[   13.524242]  </IRQ>
[   13.524270]  <TASK>
[   13.524281]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   13.524377] RIP: 0010:pv_native_safe_halt+0xf/0x20
[   13.524635] 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 83 8a 21 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
[   13.524722] RSP: 0000:ffff888100877dc8 EFLAGS: 00010212
[   13.524810] RAX: ffff8881c8172000 RBX: ffff888100853000 RCX: ffffffff90a730e5
[   13.524855] RDX: ffffed102b62618b RSI: 0000000000000004 RDI: 000000000001334c
[   13.524898] RBP: ffff888100877dd0 R08: 0000000000000001 R09: ffffed102b62618a
[   13.524940] R10: ffff88815b130c53 R11: 000000000000b400 R12: 0000000000000001
[   13.524980] R13: ffffed102010a600 R14: ffffffff927b0f90 R15: 0000000000000000
[   13.525038]  ? ct_kernel_exit.constprop.0+0xa5/0xd0
[   13.525107]  ? default_idle+0xd/0x20
[   13.525128]  arch_cpu_idle+0xd/0x20
[   13.525148]  default_idle_call+0x48/0x80
[   13.525166]  do_idle+0x379/0x4f0
[   13.525191]  ? __pfx_do_idle+0x10/0x10
[   13.525218]  cpu_startup_entry+0x5c/0x70
[   13.525240]  start_secondary+0x211/0x290
[   13.525261]  ? __pfx_start_secondary+0x10/0x10
[   13.525285]  common_startup_64+0x13e/0x148
[   13.525317]  </TASK>
[   13.525329] 
[   13.543825] Allocated by task 215:
[   13.544099]  kasan_save_stack+0x45/0x70
[   13.544500]  kasan_save_track+0x18/0x40
[   13.544637]  kasan_save_alloc_info+0x3b/0x50
[   13.544781]  __kasan_kmalloc+0xb7/0xc0
[   13.544908]  __kmalloc_cache_noprof+0x189/0x420
[   13.545136]  rcu_uaf+0xb0/0x330
[   13.545468]  kunit_try_run_case+0x1a5/0x480
[   13.545890]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.546509]  kthread+0x337/0x6f0
[   13.546878]  ret_from_fork+0x116/0x1d0
[   13.547371]  ret_from_fork_asm+0x1a/0x30
[   13.547768] 
[   13.547946] Freed by task 0:
[   13.548275]  kasan_save_stack+0x45/0x70
[   13.548700]  kasan_save_track+0x18/0x40
[   13.549109]  kasan_save_free_info+0x3f/0x60
[   13.549468]  __kasan_slab_free+0x56/0x70
[   13.549642]  kfree+0x222/0x3f0
[   13.549967]  rcu_uaf_reclaim+0x1f/0x60
[   13.550386]  rcu_core+0x66f/0x1c40
[   13.550785]  rcu_core_si+0x12/0x20
[   13.551070]  handle_softirqs+0x209/0x730
[   13.551489]  __irq_exit_rcu+0xc9/0x110
[   13.551675]  irq_exit_rcu+0x12/0x20
[   13.551799]  sysvec_apic_timer_interrupt+0x81/0x90
[   13.551955]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   13.552206] 
[   13.552395] Last potentially related work creation:
[   13.552820]  kasan_save_stack+0x45/0x70
[   13.553240]  kasan_record_aux_stack+0xb2/0xc0
[   13.553672]  __call_rcu_common.constprop.0+0x7b/0x9e0
[   13.554193]  call_rcu+0x12/0x20
[   13.554497]  rcu_uaf+0x168/0x330
[   13.554857]  kunit_try_run_case+0x1a5/0x480
[   13.555310]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.555745]  kthread+0x337/0x6f0
[   13.555862]  ret_from_fork+0x116/0x1d0
[   13.555989]  ret_from_fork_asm+0x1a/0x30
[   13.556375] 
[   13.556548] The buggy address belongs to the object at ffff88810260e680
[   13.556548]  which belongs to the cache kmalloc-32 of size 32
[   13.557831] The buggy address is located 0 bytes inside of
[   13.557831]  freed 32-byte region [ffff88810260e680, ffff88810260e6a0)
[   13.558680] 
[   13.558760] The buggy address belongs to the physical page:
[   13.558929] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10260e
[   13.559446] flags: 0x200000000000000(node=0|zone=2)
[   13.559887] page_type: f5(slab)
[   13.560214] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.560997] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   13.561776] page dumped because: kasan: bad access detected
[   13.562348] 
[   13.562421] Memory state around the buggy address:
[   13.562691]  ffff88810260e580: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   13.563431]  ffff88810260e600: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   13.563987] >ffff88810260e680: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   13.564583]                    ^
[   13.564876]  ffff88810260e700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.565343]  ffff88810260e780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.565627] ==================================================================