Hay
Date
June 25, 2025, 8:08 a.m.

Environment
qemu-arm64
qemu-x86_64

[   27.198597] ==================================================================
[   27.198746] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x64/0x70
[   27.198818] Read of size 4 at addr fff00000c7894c80 by task swapper/1/0
[   27.198865] 
[   27.198906] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G    B            N  6.16.0-rc3-next-20250625 #1 PREEMPT 
[   27.198992] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.199018] Hardware name: linux,dummy-virt (DT)
[   27.199052] Call trace:
[   27.199074]  show_stack+0x20/0x38 (C)
[   27.199124]  dump_stack_lvl+0x8c/0xd0
[   27.199172]  print_report+0x118/0x608
[   27.199218]  kasan_report+0xdc/0x128
[   27.199261]  __asan_report_load4_noabort+0x20/0x30
[   27.199308]  rcu_uaf_reclaim+0x64/0x70
[   27.199351]  rcu_core+0x9f4/0x1e20
[   27.199405]  rcu_core_si+0x18/0x30
[   27.199449]  handle_softirqs+0x374/0xb28
[   27.199495]  __do_softirq+0x1c/0x28
[   27.199537]  ____do_softirq+0x18/0x30
[   27.199579]  call_on_irq_stack+0x24/0x30
[   27.199624]  do_softirq_own_stack+0x24/0x38
[   27.199668]  __irq_exit_rcu+0x1fc/0x318
[   27.199711]  irq_exit_rcu+0x1c/0x80
[   27.199754]  el1_interrupt+0x38/0x58
[   27.199800]  el1h_64_irq_handler+0x18/0x28
[   27.199883]  el1h_64_irq+0x6c/0x70
[   27.200570]  arch_local_irq_enable+0x4/0x8 (P)
[   27.200664]  do_idle+0x384/0x4e8
[   27.200913]  cpu_startup_entry+0x68/0x80
[   27.201097]  secondary_start_kernel+0x288/0x340
[   27.201208]  __secondary_switched+0xc0/0xc8
[   27.201473] 
[   27.201689] Allocated by task 210:
[   27.201771]  kasan_save_stack+0x3c/0x68
[   27.201911]  kasan_save_track+0x20/0x40
[   27.201994]  kasan_save_alloc_info+0x40/0x58
[   27.202091]  __kasan_kmalloc+0xd4/0xd8
[   27.202184]  __kmalloc_cache_noprof+0x16c/0x3c0
[   27.202467]  rcu_uaf+0xb0/0x2d8
[   27.202652]  kunit_try_run_case+0x170/0x3f0
[   27.202744]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   27.202790]  kthread+0x328/0x630
[   27.203019]  ret_from_fork+0x10/0x20
[   27.203163] 
[   27.203239] Freed by task 0:
[   27.203276]  kasan_save_stack+0x3c/0x68
[   27.203327]  kasan_save_track+0x20/0x40
[   27.203363]  kasan_save_free_info+0x4c/0x78
[   27.203412]  __kasan_slab_free+0x6c/0x98
[   27.203460]  kfree+0x214/0x3c8
[   27.203509]  rcu_uaf_reclaim+0x28/0x70
[   27.203546]  rcu_core+0x9f4/0x1e20
[   27.203589]  rcu_core_si+0x18/0x30
[   27.203632]  handle_softirqs+0x374/0xb28
[   27.203673]  __do_softirq+0x1c/0x28
[   27.203713] 
[   27.203745] Last potentially related work creation:
[   27.203796]  kasan_save_stack+0x3c/0x68
[   27.203837]  kasan_record_aux_stack+0xb4/0xc8
[   27.203902]  __call_rcu_common.constprop.0+0x74/0x8c8
[   27.203945]  call_rcu+0x18/0x30
[   27.203977]  rcu_uaf+0x14c/0x2d8
[   27.204012]  kunit_try_run_case+0x170/0x3f0
[   27.204185]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   27.204239]  kthread+0x328/0x630
[   27.204270]  ret_from_fork+0x10/0x20
[   27.204315] 
[   27.204345] The buggy address belongs to the object at fff00000c7894c80
[   27.204345]  which belongs to the cache kmalloc-32 of size 32
[   27.204416] The buggy address is located 0 bytes inside of
[   27.204416]  freed 32-byte region [fff00000c7894c80, fff00000c7894ca0)
[   27.204478] 
[   27.204848] The buggy address belongs to the physical page:
[   27.204932] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107894
[   27.205042] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   27.205095] page_type: f5(slab)
[   27.205160] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   27.205503] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   27.205580] page dumped because: kasan: bad access detected
[   27.205823] 
[   27.206013] Memory state around the buggy address:
[   27.206052]  fff00000c7894b80: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   27.206405]  fff00000c7894c00: 00 00 05 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   27.206656] >fff00000c7894c80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   27.206720]                    ^
[   27.206750]  fff00000c7894d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.206979]  fff00000c7894d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.207217] ==================================================================

[   22.436924] ==================================================================
[   22.437355] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x50/0x60
[   22.437689] Read of size 4 at addr ffff88810258c800 by task swapper/0/0
[   22.438039] 
[   22.438128] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Tainted: G    B            N  6.16.0-rc3-next-20250625 #1 PREEMPT(voluntary) 
[   22.438175] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.438187] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   22.438207] Call Trace:
[   22.438234]  <IRQ>
[   22.438251]  dump_stack_lvl+0x73/0xb0
[   22.438280]  print_report+0xd1/0x650
[   22.438300]  ? __virt_addr_valid+0x1db/0x2d0
[   22.438324]  ? rcu_uaf_reclaim+0x50/0x60
[   22.438343]  ? kasan_complete_mode_report_info+0x64/0x200
[   22.438367]  ? rcu_uaf_reclaim+0x50/0x60
[   22.438386]  kasan_report+0x141/0x180
[   22.438406]  ? rcu_uaf_reclaim+0x50/0x60
[   22.438429]  __asan_report_load4_noabort+0x18/0x20
[   22.438452]  rcu_uaf_reclaim+0x50/0x60
[   22.438519]  rcu_core+0x66f/0x1c40
[   22.438548]  ? __pfx_rcu_core+0x10/0x10
[   22.438569]  ? ktime_get+0x6b/0x150
[   22.438602]  ? handle_softirqs+0x18e/0x730
[   22.438627]  rcu_core_si+0x12/0x20
[   22.438646]  handle_softirqs+0x209/0x730
[   22.438666]  ? hrtimer_interrupt+0x2fe/0x780
[   22.438687]  ? __pfx_handle_softirqs+0x10/0x10
[   22.438710]  __irq_exit_rcu+0xc9/0x110
[   22.438729]  irq_exit_rcu+0x12/0x20
[   22.438748]  sysvec_apic_timer_interrupt+0x81/0x90
[   22.438769]  </IRQ>
[   22.438795]  <TASK>
[   22.438806]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   22.438946] RIP: 0010:pv_native_safe_halt+0xf/0x20
[   22.439153] 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 bf 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
[   22.439231] RSP: 0000:ffffffffb1e07dd8 EFLAGS: 00010216
[   22.439318] RAX: ffff8881a7e2e000 RBX: ffffffffb1e1cac0 RCX: ffffffffb0cef165
[   22.439362] RDX: ffffed102b606193 RSI: 0000000000000004 RDI: 00000000000d84cc
[   22.439404] RBP: ffffffffb1e07de0 R08: 0000000000000001 R09: ffffed102b606192
[   22.439446] R10: ffff88815b030c93 R11: 000000000000d400 R12: 0000000000000000
[   22.439488] R13: fffffbfff63c3958 R14: ffffffffb29eacd0 R15: 0000000000000000
[   22.439542]  ? ct_kernel_exit.constprop.0+0xa5/0xd0
[   22.439590]  ? default_idle+0xd/0x20
[   22.439609]  arch_cpu_idle+0xd/0x20
[   22.439628]  default_idle_call+0x48/0x80
[   22.439647]  do_idle+0x379/0x4f0
[   22.439672]  ? __pfx_do_idle+0x10/0x10
[   22.439698]  cpu_startup_entry+0x5c/0x70
[   22.439720]  rest_init+0x11a/0x140
[   22.439739]  ? acpi_subsystem_init+0x5d/0x150
[   22.439763]  start_kernel+0x352/0x400
[   22.439785]  x86_64_start_reservations+0x1c/0x30
[   22.439869]  x86_64_start_kernel+0x10d/0x120
[   22.439899]  common_startup_64+0x13e/0x148
[   22.439932]  </TASK>
[   22.439956] 
[   22.453196] Allocated by task 227:
[   22.453514]  kasan_save_stack+0x45/0x70
[   22.453715]  kasan_save_track+0x18/0x40
[   22.453978]  kasan_save_alloc_info+0x3b/0x50
[   22.454167]  __kasan_kmalloc+0xb7/0xc0
[   22.454597]  __kmalloc_cache_noprof+0x189/0x420
[   22.454772]  rcu_uaf+0xb0/0x330
[   22.455156]  kunit_try_run_case+0x1a5/0x480
[   22.455499]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.455689]  kthread+0x337/0x6f0
[   22.455935]  ret_from_fork+0x116/0x1d0
[   22.456292]  ret_from_fork_asm+0x1a/0x30
[   22.456531] 
[   22.456617] Freed by task 0:
[   22.456755]  kasan_save_stack+0x45/0x70
[   22.457211]  kasan_save_track+0x18/0x40
[   22.457395]  kasan_save_free_info+0x3f/0x60
[   22.457672]  __kasan_slab_free+0x56/0x70
[   22.457960]  kfree+0x222/0x3f0
[   22.458098]  rcu_uaf_reclaim+0x1f/0x60
[   22.458249]  rcu_core+0x66f/0x1c40
[   22.458403]  rcu_core_si+0x12/0x20
[   22.458554]  handle_softirqs+0x209/0x730
[   22.458711]  __irq_exit_rcu+0xc9/0x110
[   22.459211]  irq_exit_rcu+0x12/0x20
[   22.459427]  sysvec_apic_timer_interrupt+0x81/0x90
[   22.459770]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   22.460140] 
[   22.460268] Last potentially related work creation:
[   22.460479]  kasan_save_stack+0x45/0x70
[   22.460648]  kasan_record_aux_stack+0xb2/0xc0
[   22.460918]  __call_rcu_common.constprop.0+0x7b/0x9e0
[   22.461171]  call_rcu+0x12/0x20
[   22.461308]  rcu_uaf+0x168/0x330
[   22.461460]  kunit_try_run_case+0x1a5/0x480
[   22.461673]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.462014]  kthread+0x337/0x6f0
[   22.462546]  ret_from_fork+0x116/0x1d0
[   22.462726]  ret_from_fork_asm+0x1a/0x30
[   22.463068] 
[   22.463149] The buggy address belongs to the object at ffff88810258c800
[   22.463149]  which belongs to the cache kmalloc-32 of size 32
[   22.463660] The buggy address is located 0 bytes inside of
[   22.463660]  freed 32-byte region [ffff88810258c800, ffff88810258c820)
[   22.464227] 
[   22.464376] The buggy address belongs to the physical page:
[   22.464665] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10258c
[   22.465107] flags: 0x200000000000000(node=0|zone=2)
[   22.465359] page_type: f5(slab)
[   22.465543] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   22.465972] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   22.466416] page dumped because: kasan: bad access detected
[   22.466671] 
[   22.466751] Memory state around the buggy address:
[   22.466973]  ffff88810258c700: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   22.467281]  ffff88810258c780: 00 00 05 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   22.467851] >ffff88810258c800: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   22.468497]                    ^
[   22.468644]  ffff88810258c880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.469403]  ffff88810258c900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.469797] ==================================================================