Hay
Date
July 3, 2025, 6:13 p.m.

Environment
qemu-arm64
qemu-x86_64

[   17.209894] ==================================================================
[   17.210553] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x64/0x70
[   17.210705] Read of size 4 at addr fff00000c78c4b80 by task swapper/0/0
[   17.210843] 
[   17.210886] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   17.211038] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.211097] Hardware name: linux,dummy-virt (DT)
[   17.211131] Call trace:
[   17.211317]  show_stack+0x20/0x38 (C)
[   17.211506]  dump_stack_lvl+0x8c/0xd0
[   17.211595]  print_report+0x118/0x608
[   17.211647]  kasan_report+0xdc/0x128
[   17.211938]  __asan_report_load4_noabort+0x20/0x30
[   17.212013]  rcu_uaf_reclaim+0x64/0x70
[   17.212627]  rcu_core+0x9f4/0x1e20
[   17.212705]  rcu_core_si+0x18/0x30
[   17.212752]  handle_softirqs+0x374/0xb28
[   17.212798]  __do_softirq+0x1c/0x28
[   17.212841]  ____do_softirq+0x18/0x30
[   17.212885]  call_on_irq_stack+0x24/0x30
[   17.213484]  do_softirq_own_stack+0x24/0x38
[   17.213598]  __irq_exit_rcu+0x1fc/0x318
[   17.213923]  irq_exit_rcu+0x1c/0x80
[   17.214392]  el1_interrupt+0x38/0x58
[   17.214471]  el1h_64_irq_handler+0x18/0x28
[   17.214524]  el1h_64_irq+0x6c/0x70
[   17.214690]  arch_local_irq_enable+0x4/0x8 (P)
[   17.214760]  do_idle+0x384/0x4e8
[   17.214804]  cpu_startup_entry+0x64/0x80
[   17.214861]  rest_init+0x160/0x188
[   17.214913]  start_kernel+0x30c/0x3d0
[   17.214963]  __primary_switched+0x8c/0xa0
[   17.215020] 
[   17.215058] Allocated by task 198:
[   17.215095]  kasan_save_stack+0x3c/0x68
[   17.215151]  kasan_save_track+0x20/0x40
[   17.215199]  kasan_save_alloc_info+0x40/0x58
[   17.215259]  __kasan_kmalloc+0xd4/0xd8
[   17.215303]  __kmalloc_cache_noprof+0x16c/0x3c0
[   17.215349]  rcu_uaf+0xb0/0x2d8
[   17.215409]  kunit_try_run_case+0x170/0x3f0
[   17.215456]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.215510]  kthread+0x328/0x630
[   17.215550]  ret_from_fork+0x10/0x20
[   17.215586] 
[   17.215603] Freed by task 0:
[   17.215629]  kasan_save_stack+0x3c/0x68
[   17.215666]  kasan_save_track+0x20/0x40
[   17.215703]  kasan_save_free_info+0x4c/0x78
[   17.215751]  __kasan_slab_free+0x6c/0x98
[   17.215787]  kfree+0x214/0x3c8
[   17.215820]  rcu_uaf_reclaim+0x28/0x70
[   17.215855]  rcu_core+0x9f4/0x1e20
[   17.215891]  rcu_core_si+0x18/0x30
[   17.215924]  handle_softirqs+0x374/0xb28
[   17.215961]  __do_softirq+0x1c/0x28
[   17.216004] 
[   17.216176] Last potentially related work creation:
[   17.216656]  kasan_save_stack+0x3c/0x68
[   17.216721]  kasan_record_aux_stack+0xb4/0xc8
[   17.216777]  __call_rcu_common.constprop.0+0x74/0x8c8
[   17.217099]  call_rcu+0x18/0x30
[   17.217420]  rcu_uaf+0x14c/0x2d8
[   17.217777]  kunit_try_run_case+0x170/0x3f0
[   17.218108]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.218330]  kthread+0x328/0x630
[   17.218457]  ret_from_fork+0x10/0x20
[   17.218525] 
[   17.218966] The buggy address belongs to the object at fff00000c78c4b80
[   17.218966]  which belongs to the cache kmalloc-32 of size 32
[   17.219093] The buggy address is located 0 bytes inside of
[   17.219093]  freed 32-byte region [fff00000c78c4b80, fff00000c78c4ba0)
[   17.219221] 
[   17.219429] The buggy address belongs to the physical page:
[   17.219659] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1078c4
[   17.220040] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.220290] page_type: f5(slab)
[   17.220379] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   17.220613] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   17.220699] page dumped because: kasan: bad access detected
[   17.220828] 
[   17.220850] Memory state around the buggy address:
[   17.220885]  fff00000c78c4a80: 00 00 05 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   17.221169]  fff00000c78c4b00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   17.221395] >fff00000c78c4b80: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   17.221472]                    ^
[   17.221640]  fff00000c78c4c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.221694]  fff00000c78c4c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.221866] ==================================================================

[   12.000261] ==================================================================
[   12.000736] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x50/0x60
[   12.001019] Read of size 4 at addr ffff88810333d040 by task swapper/1/0
[   12.001369] 
[   12.001458] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   12.001555] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.001569] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.001590] Call Trace:
[   12.001616]  <IRQ>
[   12.001632]  dump_stack_lvl+0x73/0xb0
[   12.001661]  print_report+0xd1/0x650
[   12.001682]  ? __virt_addr_valid+0x1db/0x2d0
[   12.001705]  ? rcu_uaf_reclaim+0x50/0x60
[   12.001725]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.001746]  ? rcu_uaf_reclaim+0x50/0x60
[   12.001767]  kasan_report+0x141/0x180
[   12.001788]  ? rcu_uaf_reclaim+0x50/0x60
[   12.001812]  __asan_report_load4_noabort+0x18/0x20
[   12.001835]  rcu_uaf_reclaim+0x50/0x60
[   12.001855]  rcu_core+0x66f/0x1c40
[   12.001882]  ? __pfx_rcu_core+0x10/0x10
[   12.001902]  ? ktime_get+0x6b/0x150
[   12.001922]  ? handle_softirqs+0x18e/0x730
[   12.001947]  rcu_core_si+0x12/0x20
[   12.001965]  handle_softirqs+0x209/0x730
[   12.001984]  ? hrtimer_interrupt+0x2fe/0x780
[   12.002005]  ? __pfx_handle_softirqs+0x10/0x10
[   12.002029]  __irq_exit_rcu+0xc9/0x110
[   12.002049]  irq_exit_rcu+0x12/0x20
[   12.002067]  sysvec_apic_timer_interrupt+0x81/0x90
[   12.002090]  </IRQ>
[   12.002128]  <TASK>
[   12.002140]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   12.002300] RIP: 0010:pv_native_safe_halt+0xf/0x20
[   12.002535] 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 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
[   12.002615] RSP: 0000:ffff888100877dc8 EFLAGS: 00010202
[   12.002703] RAX: ffff8881a5d74000 RBX: ffff88810085a000 RCX: ffffffffb2e730e5
[   12.002748] RDX: ffffed102b62618b RSI: 0000000000000004 RDI: 000000000000fe74
[   12.002790] RBP: ffff888100877dd0 R08: 0000000000000001 R09: ffffed102b62618a
[   12.002832] R10: ffff88815b130c53 R11: 00000000000c9c00 R12: 0000000000000001
[   12.002874] R13: ffffed102010b400 R14: ffffffffb4bb0690 R15: 0000000000000000
[   12.002930]  ? ct_kernel_exit.constprop.0+0xa5/0xd0
[   12.002982]  ? default_idle+0xd/0x20
[   12.003004]  arch_cpu_idle+0xd/0x20
[   12.003024]  default_idle_call+0x48/0x80
[   12.003046]  do_idle+0x379/0x4f0
[   12.003068]  ? complete+0x15b/0x1d0
[   12.003085]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.003124]  ? __pfx_do_idle+0x10/0x10
[   12.003144]  ? _raw_spin_unlock_irqrestore+0x49/0x90
[   12.003315]  ? complete+0x15b/0x1d0
[   12.003341]  cpu_startup_entry+0x5c/0x70
[   12.003364]  start_secondary+0x211/0x290
[   12.003386]  ? __pfx_start_secondary+0x10/0x10
[   12.003411]  common_startup_64+0x13e/0x148
[   12.003443]  </TASK>
[   12.003454] 
[   12.013352] Allocated by task 216:
[   12.013489]  kasan_save_stack+0x45/0x70
[   12.013688]  kasan_save_track+0x18/0x40
[   12.013884]  kasan_save_alloc_info+0x3b/0x50
[   12.014365]  __kasan_kmalloc+0xb7/0xc0
[   12.015322]  __kmalloc_cache_noprof+0x189/0x420
[   12.015530]  rcu_uaf+0xb0/0x330
[   12.015653]  kunit_try_run_case+0x1a5/0x480
[   12.015830]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.016034]  kthread+0x337/0x6f0
[   12.016235]  ret_from_fork+0x116/0x1d0
[   12.016522]  ret_from_fork_asm+0x1a/0x30
[   12.016719] 
[   12.016808] Freed by task 0:
[   12.016928]  kasan_save_stack+0x45/0x70
[   12.017097]  kasan_save_track+0x18/0x40
[   12.017456]  kasan_save_free_info+0x3f/0x60
[   12.017651]  __kasan_slab_free+0x56/0x70
[   12.017851]  kfree+0x222/0x3f0
[   12.017990]  rcu_uaf_reclaim+0x1f/0x60
[   12.018201]  rcu_core+0x66f/0x1c40
[   12.018351]  rcu_core_si+0x12/0x20
[   12.018527]  handle_softirqs+0x209/0x730
[   12.018666]  __irq_exit_rcu+0xc9/0x110
[   12.018798]  irq_exit_rcu+0x12/0x20
[   12.018926]  sysvec_apic_timer_interrupt+0x81/0x90
[   12.019116]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   12.019361] 
[   12.019476] Last potentially related work creation:
[   12.019714]  kasan_save_stack+0x45/0x70
[   12.019909]  kasan_record_aux_stack+0xb2/0xc0
[   12.020077]  __call_rcu_common.constprop.0+0x7b/0x9e0
[   12.020423]  call_rcu+0x12/0x20
[   12.020620]  rcu_uaf+0x168/0x330
[   12.020792]  kunit_try_run_case+0x1a5/0x480
[   12.021009]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.021509]  kthread+0x337/0x6f0
[   12.021675]  ret_from_fork+0x116/0x1d0
[   12.021808]  ret_from_fork_asm+0x1a/0x30
[   12.021963] 
[   12.022068] The buggy address belongs to the object at ffff88810333d040
[   12.022068]  which belongs to the cache kmalloc-32 of size 32
[   12.023229] The buggy address is located 0 bytes inside of
[   12.023229]  freed 32-byte region [ffff88810333d040, ffff88810333d060)
[   12.023576] 
[   12.023649] The buggy address belongs to the physical page:
[   12.023821] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10333d
[   12.024189] flags: 0x200000000000000(node=0|zone=2)
[   12.024735] page_type: f5(slab)
[   12.024940] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   12.026042] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   12.026379] page dumped because: kasan: bad access detected
[   12.026631] 
[   12.026716] Memory state around the buggy address:
[   12.026908]  ffff88810333cf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.027559]  ffff88810333cf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.027852] >ffff88810333d000: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   12.028180]                                            ^
[   12.028800]  ffff88810333d080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.029127]  ffff88810333d100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.029725] ==================================================================