Hay
Date
July 6, 2025, 11:09 a.m.

Environment
qemu-arm64
qemu-x86_64

[   18.530602] ==================================================================
[   18.530779] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x64/0x70
[   18.530852] Read of size 4 at addr fff00000c56eb440 by task swapper/1/0
[   18.530908] 
[   18.530959] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   18.531040] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.531068] Hardware name: linux,dummy-virt (DT)
[   18.531099] Call trace:
[   18.531122]  show_stack+0x20/0x38 (C)
[   18.531172]  dump_stack_lvl+0x8c/0xd0
[   18.531252]  print_report+0x118/0x608
[   18.531303]  kasan_report+0xdc/0x128
[   18.531358]  __asan_report_load4_noabort+0x20/0x30
[   18.531407]  rcu_uaf_reclaim+0x64/0x70
[   18.531459]  rcu_core+0x9f4/0x1e20
[   18.531514]  rcu_core_si+0x18/0x30
[   18.531557]  handle_softirqs+0x374/0xb28
[   18.531603]  __do_softirq+0x1c/0x28
[   18.531645]  ____do_softirq+0x18/0x30
[   18.531688]  call_on_irq_stack+0x24/0x30
[   18.531733]  do_softirq_own_stack+0x24/0x38
[   18.531778]  __irq_exit_rcu+0x1fc/0x318
[   18.531822]  irq_exit_rcu+0x1c/0x80
[   18.531872]  el1_interrupt+0x38/0x58
[   18.531926]  el1h_64_irq_handler+0x18/0x28
[   18.531973]  el1h_64_irq+0x6c/0x70
[   18.532076]  arch_local_irq_enable+0x4/0x8 (P)
[   18.532126]  do_idle+0x384/0x4e8
[   18.532170]  cpu_startup_entry+0x64/0x80
[   18.532570]  secondary_start_kernel+0x288/0x340
[   18.532868]  __secondary_switched+0xc0/0xc8
[   18.532950] 
[   18.532998] Allocated by task 198:
[   18.533045]  kasan_save_stack+0x3c/0x68
[   18.533089]  kasan_save_track+0x20/0x40
[   18.533126]  kasan_save_alloc_info+0x40/0x58
[   18.533179]  __kasan_kmalloc+0xd4/0xd8
[   18.533255]  __kmalloc_cache_noprof+0x16c/0x3c0
[   18.533321]  rcu_uaf+0xb0/0x2d8
[   18.533366]  kunit_try_run_case+0x170/0x3f0
[   18.533406]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.533476]  kthread+0x328/0x630
[   18.533509]  ret_from_fork+0x10/0x20
[   18.533545] 
[   18.533565] Freed by task 0:
[   18.533592]  kasan_save_stack+0x3c/0x68
[   18.533735]  kasan_save_track+0x20/0x40
[   18.533873]  kasan_save_free_info+0x4c/0x78
[   18.533969]  __kasan_slab_free+0x6c/0x98
[   18.534066]  kfree+0x214/0x3c8
[   18.534230]  rcu_uaf_reclaim+0x28/0x70
[   18.534399]  rcu_core+0x9f4/0x1e20
[   18.534539]  rcu_core_si+0x18/0x30
[   18.534705]  handle_softirqs+0x374/0xb28
[   18.534806]  __do_softirq+0x1c/0x28
[   18.534841] 
[   18.534875] Last potentially related work creation:
[   18.534909]  kasan_save_stack+0x3c/0x68
[   18.534949]  kasan_record_aux_stack+0xb4/0xc8
[   18.535089]  __call_rcu_common.constprop.0+0x74/0x8c8
[   18.535134]  call_rcu+0x18/0x30
[   18.535167]  rcu_uaf+0x14c/0x2d8
[   18.535273]  kunit_try_run_case+0x170/0x3f0
[   18.535373]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.535434]  kthread+0x328/0x630
[   18.535513]  ret_from_fork+0x10/0x20
[   18.535580] 
[   18.535629] The buggy address belongs to the object at fff00000c56eb440
[   18.535629]  which belongs to the cache kmalloc-32 of size 32
[   18.535721] The buggy address is located 0 bytes inside of
[   18.535721]  freed 32-byte region [fff00000c56eb440, fff00000c56eb460)
[   18.535923] 
[   18.536026] The buggy address belongs to the physical page:
[   18.536060] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1056eb
[   18.536442] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.536510] page_type: f5(slab)
[   18.536559] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   18.536844] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   18.536914] page dumped because: kasan: bad access detected
[   18.537117] 
[   18.537189] Memory state around the buggy address:
[   18.537342]  fff00000c56eb300: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   18.537405]  fff00000c56eb380: fa fb fb fb fc fc fc fc 00 00 05 fc fc fc fc fc
[   18.537483] >fff00000c56eb400: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   18.537521]                                            ^
[   18.537556]  fff00000c56eb480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.537598]  fff00000c56eb500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.537744] ==================================================================

[   12.178590] ==================================================================
[   12.179523] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x50/0x60
[   12.179759] Read of size 4 at addr ffff888102b1b840 by task swapper/0/0
[   12.179976] 
[   12.180071] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   12.180118] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.180130] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.180152] Call Trace:
[   12.180182]  <IRQ>
[   12.180202]  dump_stack_lvl+0x73/0xb0
[   12.180303]  print_report+0xd1/0x650
[   12.180492]  ? __virt_addr_valid+0x1db/0x2d0
[   12.180775]  ? rcu_uaf_reclaim+0x50/0x60
[   12.180801]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.180824]  ? rcu_uaf_reclaim+0x50/0x60
[   12.180844]  kasan_report+0x141/0x180
[   12.180866]  ? rcu_uaf_reclaim+0x50/0x60
[   12.180891]  __asan_report_load4_noabort+0x18/0x20
[   12.180914]  rcu_uaf_reclaim+0x50/0x60
[   12.180945]  rcu_core+0x66f/0x1c40
[   12.180975]  ? __pfx_rcu_core+0x10/0x10
[   12.180996]  ? ktime_get+0x6b/0x150
[   12.181017]  ? handle_softirqs+0x18e/0x730
[   12.181042]  rcu_core_si+0x12/0x20
[   12.181062]  handle_softirqs+0x209/0x730
[   12.181081]  ? hrtimer_interrupt+0x2fe/0x780
[   12.181103]  ? __pfx_handle_softirqs+0x10/0x10
[   12.181127]  __irq_exit_rcu+0xc9/0x110
[   12.181147]  irq_exit_rcu+0x12/0x20
[   12.181166]  sysvec_apic_timer_interrupt+0x81/0x90
[   12.181190]  </IRQ>
[   12.181222]  <TASK>
[   12.181234]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   12.181328] RIP: 0010:pv_native_safe_halt+0xf/0x20
[   12.181543] 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 03 9a 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
[   12.181623] RSP: 0000:ffffffffaf807dd8 EFLAGS: 00010216
[   12.181710] RAX: ffff8881aa474000 RBX: ffffffffaf81cac0 RCX: ffffffffae6720e5
[   12.181754] RDX: ffffed102b60618b RSI: 0000000000000004 RDI: 0000000000004f6c
[   12.181796] RBP: ffffffffaf807de0 R08: 0000000000000001 R09: ffffed102b60618a
[   12.181838] R10: ffff88815b030c53 R11: 0000000000070800 R12: 0000000000000000
[   12.181879] R13: fffffbfff5f03958 R14: ffffffffb03b0e90 R15: 0000000000000000
[   12.181948]  ? ct_kernel_exit.constprop.0+0xa5/0xd0
[   12.182000]  ? default_idle+0xd/0x20
[   12.182022]  arch_cpu_idle+0xd/0x20
[   12.182044]  default_idle_call+0x48/0x80
[   12.182062]  do_idle+0x379/0x4f0
[   12.182087]  ? __pfx_do_idle+0x10/0x10
[   12.182114]  cpu_startup_entry+0x5c/0x70
[   12.182137]  rest_init+0x11a/0x140
[   12.182153]  ? acpi_subsystem_init+0x5d/0x150
[   12.182178]  start_kernel+0x330/0x410
[   12.182203]  x86_64_start_reservations+0x1c/0x30
[   12.182226]  x86_64_start_kernel+0x10d/0x120
[   12.182249]  common_startup_64+0x13e/0x148
[   12.182281]  </TASK>
[   12.182293] 
[   12.198789] Allocated by task 215:
[   12.199142]  kasan_save_stack+0x45/0x70
[   12.199477]  kasan_save_track+0x18/0x40
[   12.199876]  kasan_save_alloc_info+0x3b/0x50
[   12.200248]  __kasan_kmalloc+0xb7/0xc0
[   12.200440]  __kmalloc_cache_noprof+0x189/0x420
[   12.200838]  rcu_uaf+0xb0/0x330
[   12.201020]  kunit_try_run_case+0x1a5/0x480
[   12.201539]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.201790]  kthread+0x337/0x6f0
[   12.201955]  ret_from_fork+0x116/0x1d0
[   12.202155]  ret_from_fork_asm+0x1a/0x30
[   12.202353] 
[   12.202451] Freed by task 0:
[   12.203124]  kasan_save_stack+0x45/0x70
[   12.203428]  kasan_save_track+0x18/0x40
[   12.203846]  kasan_save_free_info+0x3f/0x60
[   12.204288]  __kasan_slab_free+0x56/0x70
[   12.204855]  kfree+0x222/0x3f0
[   12.205055]  rcu_uaf_reclaim+0x1f/0x60
[   12.205350]  rcu_core+0x66f/0x1c40
[   12.205709]  rcu_core_si+0x12/0x20
[   12.205900]  handle_softirqs+0x209/0x730
[   12.206581]  __irq_exit_rcu+0xc9/0x110
[   12.206778]  irq_exit_rcu+0x12/0x20
[   12.207158]  sysvec_apic_timer_interrupt+0x81/0x90
[   12.207387]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   12.207808] 
[   12.208164] Last potentially related work creation:
[   12.208389]  kasan_save_stack+0x45/0x70
[   12.208621]  kasan_record_aux_stack+0xb2/0xc0
[   12.209160]  __call_rcu_common.constprop.0+0x7b/0x9e0
[   12.209655]  call_rcu+0x12/0x20
[   12.209948]  rcu_uaf+0x168/0x330
[   12.210235]  kunit_try_run_case+0x1a5/0x480
[   12.210740]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.211023]  kthread+0x337/0x6f0
[   12.211519]  ret_from_fork+0x116/0x1d0
[   12.211837]  ret_from_fork_asm+0x1a/0x30
[   12.212221] 
[   12.212453] The buggy address belongs to the object at ffff888102b1b840
[   12.212453]  which belongs to the cache kmalloc-32 of size 32
[   12.213236] The buggy address is located 0 bytes inside of
[   12.213236]  freed 32-byte region [ffff888102b1b840, ffff888102b1b860)
[   12.214299] 
[   12.214399] The buggy address belongs to the physical page:
[   12.214907] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b1b
[   12.215745] flags: 0x200000000000000(node=0|zone=2)
[   12.216133] page_type: f5(slab)
[   12.216299] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   12.216955] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   12.217517] page dumped because: kasan: bad access detected
[   12.217768] 
[   12.217883] Memory state around the buggy address:
[   12.218105]  ffff888102b1b700: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   12.218921]  ffff888102b1b780: 00 00 00 fc fc fc fc fc 00 00 05 fc fc fc fc fc
[   12.219414] >ffff888102b1b800: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   12.219953]                                            ^
[   12.220416]  ffff888102b1b880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.221093]  ffff888102b1b900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.221525] ==================================================================