Hay
Date
June 7, 2025, 10:40 a.m.

Environment
qemu-arm64
qemu-x86_64

[   23.183996] ==================================================================
[   23.184281] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x64/0x70
[   23.184457] Read of size 4 at addr fff00000c7765900 by task swapper/1/0
[   23.184580] 
[   23.184674] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G    B            N  6.15.2-rc1 #1 PREEMPT 
[   23.184891] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.184960] Hardware name: linux,dummy-virt (DT)
[   23.185039] Call trace:
[   23.185098]  show_stack+0x20/0x38 (C)
[   23.186731]  dump_stack_lvl+0x8c/0xd0
[   23.187385]  print_report+0x118/0x608
[   23.187538]  kasan_report+0xdc/0x128
[   23.187653]  __asan_report_load4_noabort+0x20/0x30
[   23.187780]  rcu_uaf_reclaim+0x64/0x70
[   23.187870]  rcu_core+0x9f4/0x1e20
[   23.187958]  rcu_core_si+0x18/0x30
[   23.188077]  handle_softirqs+0x374/0xb28
[   23.188191]  __do_softirq+0x1c/0x28
[   23.188286]  ____do_softirq+0x18/0x30
[   23.188389]  call_on_irq_stack+0x24/0x58
[   23.188582]  do_softirq_own_stack+0x24/0x38
[   23.188713]  __irq_exit_rcu+0x1fc/0x318
[   23.188827]  irq_exit_rcu+0x1c/0x80
[   23.188947]  el1_interrupt+0x38/0x58
[   23.189142]  el1h_64_irq_handler+0x18/0x28
[   23.189257]  el1h_64_irq+0x6c/0x70
[   23.189794]  arch_local_irq_enable+0x4/0x8 (P)
[   23.190038]  do_idle+0x384/0x4e8
[   23.190238]  cpu_startup_entry+0x64/0x80
[   23.190373]  secondary_start_kernel+0x288/0x340
[   23.190876]  __secondary_switched+0xc0/0xc8
[   23.191248] 
[   23.191300] Allocated by task 202:
[   23.191486]  kasan_save_stack+0x3c/0x68
[   23.191600]  kasan_save_track+0x20/0x40
[   23.191680]  kasan_save_alloc_info+0x40/0x58
[   23.191754]  __kasan_kmalloc+0xd4/0xd8
[   23.191822]  __kmalloc_cache_noprof+0x16c/0x3c0
[   23.191913]  rcu_uaf+0xb0/0x2d8
[   23.191987]  kunit_try_run_case+0x170/0x3f0
[   23.192389]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.192852]  kthread+0x328/0x630
[   23.193058]  ret_from_fork+0x10/0x20
[   23.193561] 
[   23.193709] Freed by task 0:
[   23.193809]  kasan_save_stack+0x3c/0x68
[   23.193923]  kasan_save_track+0x20/0x40
[   23.194088]  kasan_save_free_info+0x4c/0x78
[   23.194196]  __kasan_slab_free+0x6c/0x98
[   23.194520]  kfree+0x214/0x3c8
[   23.194626]  rcu_uaf_reclaim+0x28/0x70
[   23.194735]  rcu_core+0x9f4/0x1e20
[   23.195202]  rcu_core_si+0x18/0x30
[   23.195365]  handle_softirqs+0x374/0xb28
[   23.195464]  __do_softirq+0x1c/0x28
[   23.195547] 
[   23.195648] Last potentially related work creation:
[   23.196069]  kasan_save_stack+0x3c/0x68
[   23.196271]  kasan_record_aux_stack+0xb4/0xc8
[   23.196458]  __call_rcu_common.constprop.0+0x70/0x8b0
[   23.196585]  call_rcu+0x18/0x30
[   23.196664]  rcu_uaf+0x14c/0x2d8
[   23.196753]  kunit_try_run_case+0x170/0x3f0
[   23.196854]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.197483]  kthread+0x328/0x630
[   23.197750]  ret_from_fork+0x10/0x20
[   23.198044] 
[   23.198150] The buggy address belongs to the object at fff00000c7765900
[   23.198150]  which belongs to the cache kmalloc-32 of size 32
[   23.198487] The buggy address is located 0 bytes inside of
[   23.198487]  freed 32-byte region [fff00000c7765900, fff00000c7765920)
[   23.199070] 
[   23.199123] The buggy address belongs to the physical page:
[   23.199196] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107765
[   23.199468] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   23.199812] page_type: f5(slab)
[   23.200074] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   23.200384] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   23.200530] page dumped because: kasan: bad access detected
[   23.200729] 
[   23.200773] Memory state around the buggy address:
[   23.200964]  fff00000c7765800: 00 00 00 fc fc fc fc fc 00 00 05 fc fc fc fc fc
[   23.201330]  fff00000c7765880: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   23.201718] >fff00000c7765900: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   23.201827]                    ^
[   23.201901]  fff00000c7765980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.202012]  fff00000c7765a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.202100] ==================================================================

[   14.420835] ==================================================================
[   14.421398] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x50/0x60
[   14.421867] Read of size 4 at addr ffff888102d9fc40 by task swapper/1/0
[   14.422097] 
[   14.422396] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G    B            N  6.15.2-rc1 #1 PREEMPT(voluntary) 
[   14.422494] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.422510] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.422533] Call Trace:
[   14.422595]  <IRQ>
[   14.422632]  dump_stack_lvl+0x73/0xb0
[   14.422693]  print_report+0xd1/0x650
[   14.422735]  ? __virt_addr_valid+0x1db/0x2d0
[   14.422805]  ? rcu_uaf_reclaim+0x50/0x60
[   14.422839]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.422878]  ? rcu_uaf_reclaim+0x50/0x60
[   14.422916]  kasan_report+0x141/0x180
[   14.422960]  ? rcu_uaf_reclaim+0x50/0x60
[   14.423001]  __asan_report_load4_noabort+0x18/0x20
[   14.423040]  rcu_uaf_reclaim+0x50/0x60
[   14.423099]  rcu_core+0x66c/0x1c30
[   14.423157]  ? enqueue_hrtimer+0xfe/0x210
[   14.423207]  ? __pfx_rcu_core+0x10/0x10
[   14.423254]  ? ktime_get+0x6b/0x150
[   14.423299]  ? handle_softirqs+0x18e/0x730
[   14.423349]  rcu_core_si+0x12/0x20
[   14.423407]  handle_softirqs+0x209/0x730
[   14.423447]  ? hrtimer_interrupt+0x2fe/0x780
[   14.423489]  ? __pfx_handle_softirqs+0x10/0x10
[   14.423539]  __irq_exit_rcu+0xc9/0x110
[   14.423579]  irq_exit_rcu+0x12/0x20
[   14.423599]  sysvec_apic_timer_interrupt+0x81/0x90
[   14.423633]  </IRQ>
[   14.423689]  <TASK>
[   14.423708]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   14.423896] RIP: 0010:pv_native_safe_halt+0xf/0x20
[   14.424296] 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 2d 28 00 fb f4 <e9> fc 1f 02 00 66 2e 0f 1f 84 00 00 00 00 00 66 90 90 90 90 90 90
[   14.424420] RSP: 0000:ffff88810086fdc8 EFLAGS: 00010206
[   14.424538] RAX: ffff8881bf393000 RBX: ffff8881008353c0 RCX: ffffffff99807015
[   14.424599] RDX: ffffed102b626103 RSI: 0000000000000004 RDI: 00000000000103f4
[   14.424644] RBP: ffff88810086fdd0 R08: 0000000000000001 R09: ffffed102b626102
[   14.424722] R10: ffff88815b130813 R11: 000000000001ec00 R12: 0000000000000001
[   14.424772] R13: ffffed1020106a78 R14: ffffffff9b59bc10 R15: 0000000000000000
[   14.424838]  ? ct_kernel_exit.constprop.0+0xa5/0xd0
[   14.424905]  ? default_idle+0xd/0x20
[   14.424925]  arch_cpu_idle+0xd/0x20
[   14.424944]  default_idle_call+0x48/0x80
[   14.424963]  do_idle+0x379/0x4f0
[   14.424989]  ? __pfx_do_idle+0x10/0x10
[   14.425008]  ? _raw_spin_unlock_irqrestore+0x49/0x90
[   14.425032]  ? complete+0x15b/0x1d0
[   14.425056]  cpu_startup_entry+0x5c/0x70
[   14.425076]  start_secondary+0x211/0x290
[   14.425097]  ? __pfx_start_secondary+0x10/0x10
[   14.425121]  common_startup_64+0x13e/0x148
[   14.425153]  </TASK>
[   14.425166] 
[   14.439237] Allocated by task 218:
[   14.440396]  kasan_save_stack+0x45/0x70
[   14.440681]  kasan_save_track+0x18/0x40
[   14.440840]  kasan_save_alloc_info+0x3b/0x50
[   14.441117]  __kasan_kmalloc+0xb7/0xc0
[   14.441405]  __kmalloc_cache_noprof+0x189/0x420
[   14.442117]  rcu_uaf+0xb0/0x330
[   14.442273]  kunit_try_run_case+0x1a5/0x480
[   14.442524]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.443271]  kthread+0x337/0x6f0
[   14.443605]  ret_from_fork+0x41/0x80
[   14.444087]  ret_from_fork_asm+0x1a/0x30
[   14.444257] 
[   14.444364] Freed by task 0:
[   14.444600]  kasan_save_stack+0x45/0x70
[   14.445183]  kasan_save_track+0x18/0x40
[   14.445353]  kasan_save_free_info+0x3f/0x60
[   14.445684]  __kasan_slab_free+0x56/0x70
[   14.445986]  kfree+0x222/0x3f0
[   14.446233]  rcu_uaf_reclaim+0x1f/0x60
[   14.446486]  rcu_core+0x66c/0x1c30
[   14.447165]  rcu_core_si+0x12/0x20
[   14.447346]  handle_softirqs+0x209/0x730
[   14.447834]  __irq_exit_rcu+0xc9/0x110
[   14.448066]  irq_exit_rcu+0x12/0x20
[   14.448329]  sysvec_apic_timer_interrupt+0x81/0x90
[   14.448665]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   14.448938] 
[   14.449163] Last potentially related work creation:
[   14.449404]  kasan_save_stack+0x45/0x70
[   14.450191]  kasan_record_aux_stack+0xb2/0xc0
[   14.450366]  __call_rcu_common.constprop.0+0x72/0x9c0
[   14.450697]  call_rcu+0x12/0x20
[   14.451224]  rcu_uaf+0x168/0x330
[   14.451580]  kunit_try_run_case+0x1a5/0x480
[   14.451991]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.452341]  kthread+0x337/0x6f0
[   14.452585]  ret_from_fork+0x41/0x80
[   14.453099]  ret_from_fork_asm+0x1a/0x30
[   14.453306] 
[   14.453459] The buggy address belongs to the object at ffff888102d9fc40
[   14.453459]  which belongs to the cache kmalloc-32 of size 32
[   14.454380] The buggy address is located 0 bytes inside of
[   14.454380]  freed 32-byte region [ffff888102d9fc40, ffff888102d9fc60)
[   14.455164] 
[   14.455502] The buggy address belongs to the physical page:
[   14.456090] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102d9f
[   14.456922] flags: 0x200000000000000(node=0|zone=2)
[   14.457280] page_type: f5(slab)
[   14.457492] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   14.458057] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   14.458220] page dumped because: kasan: bad access detected
[   14.458330] 
[   14.458386] Memory state around the buggy address:
[   14.458495]  ffff888102d9fb00: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.458665]  ffff888102d9fb80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.459219] >ffff888102d9fc00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.459718]                                            ^
[   14.460100]  ffff888102d9fc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.461439]  ffff888102d9fd00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.461791] ==================================================================