Hay
Date
July 20, 2025, 11:12 a.m.

Environment
qemu-x86_64

[   12.872471] ==================================================================
[   12.872930] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x50/0x60
[   12.873265] Read of size 4 at addr ffff8881027371c0 by task swapper/1/0
[   12.873757] 
[   12.873856] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   12.874020] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.874034] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.874123] Call Trace:
[   12.874151]  <IRQ>
[   12.874168]  dump_stack_lvl+0x73/0xb0
[   12.874200]  print_report+0xd1/0x610
[   12.874222]  ? __virt_addr_valid+0x1db/0x2d0
[   12.874244]  ? rcu_uaf_reclaim+0x50/0x60
[   12.874262]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.874283]  ? rcu_uaf_reclaim+0x50/0x60
[   12.874302]  kasan_report+0x141/0x180
[   12.874322]  ? rcu_uaf_reclaim+0x50/0x60
[   12.874346]  __asan_report_load4_noabort+0x18/0x20
[   12.874437]  rcu_uaf_reclaim+0x50/0x60
[   12.874456]  rcu_core+0x66f/0x1c40
[   12.874484]  ? __pfx_rcu_core+0x10/0x10
[   12.874503]  ? ktime_get+0x6b/0x150
[   12.874524]  ? handle_softirqs+0x18e/0x730
[   12.874547]  rcu_core_si+0x12/0x20
[   12.874565]  handle_softirqs+0x209/0x730
[   12.874584]  ? hrtimer_interrupt+0x2fe/0x780
[   12.874605]  ? __pfx_handle_softirqs+0x10/0x10
[   12.874628]  __irq_exit_rcu+0xc9/0x110
[   12.874647]  irq_exit_rcu+0x12/0x20
[   12.874665]  sysvec_apic_timer_interrupt+0x81/0x90
[   12.874689]  </IRQ>
[   12.874715]  <TASK>
[   12.874725]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   12.874813] RIP: 0010:pv_native_safe_halt+0xf/0x20
[   12.875039] 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 23 52 21 00 fb f4 <e9> 3c 1d 02 00 66 2e 0f 1f 84 00 00 00 00 00 66 90 90 90 90 90 90
[   12.875124] RSP: 0000:ffff888100877dc8 EFLAGS: 00010212
[   12.875207] RAX: ffff8881c4172000 RBX: ffff888100853000 RCX: ffffffff94a77125
[   12.875262] RDX: ffffed102b62618b RSI: 0000000000000004 RDI: 000000000000f3bc
[   12.875304] RBP: ffff888100877dd0 R08: 0000000000000001 R09: ffffed102b62618a
[   12.875359] R10: ffff88815b130c53 R11: 0000000000016400 R12: 0000000000000001
[   12.875401] R13: ffffed102010a600 R14: ffffffff967b1a90 R15: 0000000000000000
[   12.875460]  ? ct_kernel_exit.constprop.0+0xa5/0xd0
[   12.875513]  ? default_idle+0xd/0x20
[   12.875530]  arch_cpu_idle+0xd/0x20
[   12.875547]  default_idle_call+0x48/0x80
[   12.875564]  do_idle+0x379/0x4f0
[   12.875588]  ? __pfx_do_idle+0x10/0x10
[   12.875614]  cpu_startup_entry+0x5c/0x70
[   12.875632]  start_secondary+0x211/0x290
[   12.875653]  ? __pfx_start_secondary+0x10/0x10
[   12.875677]  common_startup_64+0x13e/0x148
[   12.875707]  </TASK>
[   12.875717] 
[   12.890252] Allocated by task 215:
[   12.890653]  kasan_save_stack+0x45/0x70
[   12.891116]  kasan_save_track+0x18/0x40
[   12.891317]  kasan_save_alloc_info+0x3b/0x50
[   12.891678]  __kasan_kmalloc+0xb7/0xc0
[   12.891821]  __kmalloc_cache_noprof+0x189/0x420
[   12.892139]  rcu_uaf+0xb0/0x330
[   12.892278]  kunit_try_run_case+0x1a5/0x480
[   12.892490]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.892823]  kthread+0x337/0x6f0
[   12.893175]  ret_from_fork+0x116/0x1d0
[   12.893764]  ret_from_fork_asm+0x1a/0x30
[   12.893957] 
[   12.894036] Freed by task 0:
[   12.894172]  kasan_save_stack+0x45/0x70
[   12.894350]  kasan_save_track+0x18/0x40
[   12.894521]  kasan_save_free_info+0x3f/0x60
[   12.895063]  __kasan_slab_free+0x56/0x70
[   12.895525]  kfree+0x222/0x3f0
[   12.895866]  rcu_uaf_reclaim+0x1f/0x60
[   12.896076]  rcu_core+0x66f/0x1c40
[   12.896238]  rcu_core_si+0x12/0x20
[   12.896746]  handle_softirqs+0x209/0x730
[   12.897013]  __irq_exit_rcu+0xc9/0x110
[   12.897331]  irq_exit_rcu+0x12/0x20
[   12.897579]  sysvec_apic_timer_interrupt+0x81/0x90
[   12.898023]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   12.898277] 
[   12.898467] Last potentially related work creation:
[   12.899005]  kasan_save_stack+0x45/0x70
[   12.899197]  kasan_record_aux_stack+0xb2/0xc0
[   12.899789]  __call_rcu_common.constprop.0+0x7b/0x9e0
[   12.900121]  call_rcu+0x12/0x20
[   12.900285]  rcu_uaf+0x168/0x330
[   12.900715]  kunit_try_run_case+0x1a5/0x480
[   12.900930]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.901156]  kthread+0x337/0x6f0
[   12.901309]  ret_from_fork+0x116/0x1d0
[   12.901978]  ret_from_fork_asm+0x1a/0x30
[   12.902556] 
[   12.902687] The buggy address belongs to the object at ffff8881027371c0
[   12.902687]  which belongs to the cache kmalloc-32 of size 32
[   12.903690] The buggy address is located 0 bytes inside of
[   12.903690]  freed 32-byte region [ffff8881027371c0, ffff8881027371e0)
[   12.904204] 
[   12.904300] The buggy address belongs to the physical page:
[   12.905121] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102737
[   12.905758] flags: 0x200000000000000(node=0|zone=2)
[   12.906138] page_type: f5(slab)
[   12.906303] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   12.907216] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   12.908135] page dumped because: kasan: bad access detected
[   12.908560] 
[   12.908653] Memory state around the buggy address:
[   12.909083]  ffff888102737080: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   12.909652]  ffff888102737100: 00 00 00 fc fc fc fc fc 00 00 05 fc fc fc fc fc
[   12.910084] >ffff888102737180: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   12.910593]                                            ^
[   12.911072]  ffff888102737200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.911728]  ffff888102737280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.912116] ==================================================================