Hay
Date
June 23, 2025, 7:07 a.m.

Environment
qemu-arm64
qemu-x86_64

[   33.593901] ==================================================================
[   33.595404] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x64/0x70
[   33.595654] Read of size 4 at addr fff00000c57bf400 by task swapper/1/0
[   33.596826] 
[   33.596957] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G    B            N  6.16.0-rc3-next-20250623 #1 PREEMPT 
[   33.597177] Tainted: [B]=BAD_PAGE, [N]=TEST
[   33.597240] Hardware name: linux,dummy-virt (DT)
[   33.599406] Call trace:
[   33.599721]  show_stack+0x20/0x38 (C)
[   33.599968]  dump_stack_lvl+0x8c/0xd0
[   33.601254]  print_report+0x118/0x608
[   33.601386]  kasan_report+0xdc/0x128
[   33.601500]  __asan_report_load4_noabort+0x20/0x30
[   33.601617]  rcu_uaf_reclaim+0x64/0x70
[   33.601733]  rcu_core+0x9f4/0x1e20
[   33.601844]  rcu_core_si+0x18/0x30
[   33.601951]  handle_softirqs+0x374/0xb28
[   33.605128]  __do_softirq+0x1c/0x28
[   33.605264]  ____do_softirq+0x18/0x30
[   33.605392]  call_on_irq_stack+0x24/0x30
[   33.605522]  do_softirq_own_stack+0x24/0x38
[   33.605658]  __irq_exit_rcu+0x1fc/0x318
[   33.605784]  irq_exit_rcu+0x1c/0x80
[   33.605911]  el1_interrupt+0x38/0x58
[   33.605977]  el1h_64_irq_handler+0x18/0x28
[   33.606067]  el1h_64_irq+0x6c/0x70
[   33.606191]  tick_nohz_idle_enter+0x12c/0x1a8 (P)
[   33.606263]  do_idle+0xac/0x4e8
[   33.606319]  cpu_startup_entry+0x64/0x80
[   33.606373]  secondary_start_kernel+0x288/0x340
[   33.606429]  __secondary_switched+0xc0/0xc8
[   33.606496] 
[   33.606519] Allocated by task 210:
[   33.606585]  kasan_save_stack+0x3c/0x68
[   33.606762]  kasan_save_track+0x20/0x40
[   33.606903]  kasan_save_alloc_info+0x40/0x58
[   33.607000]  __kasan_kmalloc+0xd4/0xd8
[   33.607139]  __kmalloc_cache_noprof+0x16c/0x3c0
[   33.607247]  rcu_uaf+0xb0/0x2d8
[   33.607330]  kunit_try_run_case+0x170/0x3f0
[   33.607429]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.607545]  kthread+0x328/0x630
[   33.607650]  ret_from_fork+0x10/0x20
[   33.607747] 
[   33.607792] Freed by task 0:
[   33.607878]  kasan_save_stack+0x3c/0x68
[   33.608007]  kasan_save_track+0x20/0x40
[   33.608129]  kasan_save_free_info+0x4c/0x78
[   33.608224]  __kasan_slab_free+0x6c/0x98
[   33.608317]  kfree+0x214/0x3c8
[   33.608424]  rcu_uaf_reclaim+0x28/0x70
[   33.608513]  rcu_core+0x9f4/0x1e20
[   33.608603]  rcu_core_si+0x18/0x30
[   33.608688]  handle_softirqs+0x374/0xb28
[   33.608779]  __do_softirq+0x1c/0x28
[   33.608882] 
[   33.608979] Last potentially related work creation:
[   33.609078]  kasan_save_stack+0x3c/0x68
[   33.609198]  kasan_record_aux_stack+0xb4/0xc8
[   33.609316]  __call_rcu_common.constprop.0+0x74/0x8c8
[   33.609478]  call_rcu+0x18/0x30
[   33.609579]  rcu_uaf+0x14c/0x2d8
[   33.609684]  kunit_try_run_case+0x170/0x3f0
[   33.609841]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.610059]  kthread+0x328/0x630
[   33.610289]  ret_from_fork+0x10/0x20
[   33.610536] 
[   33.610895] The buggy address belongs to the object at fff00000c57bf400
[   33.610895]  which belongs to the cache kmalloc-32 of size 32
[   33.611070] The buggy address is located 0 bytes inside of
[   33.611070]  freed 32-byte region [fff00000c57bf400, fff00000c57bf420)
[   33.611330] 
[   33.611402] The buggy address belongs to the physical page:
[   33.611586] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1057bf
[   33.611759] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   33.612143] page_type: f5(slab)
[   33.612278] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   33.612399] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   33.612526] page dumped because: kasan: bad access detected
[   33.612613] 
[   33.612691] Memory state around the buggy address:
[   33.612910]  fff00000c57bf300: 00 00 00 fc fc fc fc fc 00 00 05 fc fc fc fc fc
[   33.613175]  fff00000c57bf380: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   33.613422] >fff00000c57bf400: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   33.613537]                    ^
[   33.613696]  fff00000c57bf480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   33.613935]  fff00000c57bf500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   33.614420] ==================================================================

[   22.397302] ==================================================================
[   22.397757] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x50/0x60
[   22.398327] Read of size 4 at addr ffff888102c09480 by task swapper/1/0
[   22.398937] 
[   22.399319] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G    B            N  6.16.0-rc3-next-20250623 #1 PREEMPT(voluntary) 
[   22.399446] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.399472] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   22.399508] Call Trace:
[   22.399557]  <IRQ>
[   22.399578]  dump_stack_lvl+0x73/0xb0
[   22.399614]  print_report+0xd1/0x650
[   22.399633]  ? __virt_addr_valid+0x1db/0x2d0
[   22.399653]  ? rcu_uaf_reclaim+0x50/0x60
[   22.399669]  ? kasan_complete_mode_report_info+0x64/0x200
[   22.399690]  ? rcu_uaf_reclaim+0x50/0x60
[   22.399706]  kasan_report+0x141/0x180
[   22.399724]  ? rcu_uaf_reclaim+0x50/0x60
[   22.399744]  __asan_report_load4_noabort+0x18/0x20
[   22.399764]  rcu_uaf_reclaim+0x50/0x60
[   22.399780]  rcu_core+0x66f/0x1c40
[   22.399805]  ? __pfx_rcu_core+0x10/0x10
[   22.399823]  ? ktime_get+0x6b/0x150
[   22.399851]  ? handle_softirqs+0x18e/0x730
[   22.399874]  rcu_core_si+0x12/0x20
[   22.399891]  handle_softirqs+0x209/0x730
[   22.399906]  ? hrtimer_interrupt+0x2fe/0x780
[   22.399925]  ? __pfx_handle_softirqs+0x10/0x10
[   22.399945]  __irq_exit_rcu+0xc9/0x110
[   22.399962]  irq_exit_rcu+0x12/0x20
[   22.399978]  sysvec_apic_timer_interrupt+0x81/0x90
[   22.399998]  </IRQ>
[   22.400028]  <TASK>
[   22.400043]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   22.400176] RIP: 0010:pv_native_safe_halt+0xf/0x20
[   22.400671] 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 f9 1d 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.400790] RSP: 0000:ffff888100877dc8 EFLAGS: 00010216
[   22.400900] RAX: ffff88819f555000 RBX: ffff888100853000 RCX: ffffffffb96ac165
[   22.400944] RDX: ffffed102b626193 RSI: 0000000000000004 RDI: 000000000000c21c
[   22.400984] RBP: ffff888100877dd0 R08: 0000000000000001 R09: ffffed102b626192
[   22.401023] R10: ffff88815b130c93 R11: 0000000000013800 R12: 0000000000000001
[   22.401075] R13: ffffed102010a600 R14: ffffffffbb3c8a90 R15: 0000000000000000
[   22.401162]  ? ct_kernel_exit.constprop.0+0xa5/0xd0
[   22.401233]  ? default_idle+0xd/0x20
[   22.401254]  arch_cpu_idle+0xd/0x20
[   22.401273]  default_idle_call+0x48/0x80
[   22.401305]  do_idle+0x379/0x4f0
[   22.401329]  ? __pfx_do_idle+0x10/0x10
[   22.401347]  ? _raw_spin_unlock_irqrestore+0x49/0x90
[   22.401367]  ? complete+0x15b/0x1d0
[   22.401407]  cpu_startup_entry+0x5c/0x70
[   22.401428]  start_secondary+0x211/0x290
[   22.401447]  ? __pfx_start_secondary+0x10/0x10
[   22.401469]  common_startup_64+0x13e/0x148
[   22.401497]  </TASK>
[   22.401508] 
[   22.419620] Allocated by task 227:
[   22.419763]  kasan_save_stack+0x45/0x70
[   22.419928]  kasan_save_track+0x18/0x40
[   22.420097]  kasan_save_alloc_info+0x3b/0x50
[   22.420244]  __kasan_kmalloc+0xb7/0xc0
[   22.420542]  __kmalloc_cache_noprof+0x189/0x420
[   22.420720]  rcu_uaf+0xb0/0x330
[   22.420882]  kunit_try_run_case+0x1a5/0x480
[   22.421304]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.421708]  kthread+0x337/0x6f0
[   22.422021]  ret_from_fork+0x116/0x1d0
[   22.422436]  ret_from_fork_asm+0x1a/0x30
[   22.422736] 
[   22.422916] Freed by task 0:
[   22.423318]  kasan_save_stack+0x45/0x70
[   22.423661]  kasan_save_track+0x18/0x40
[   22.423963]  kasan_save_free_info+0x3f/0x60
[   22.424406]  __kasan_slab_free+0x56/0x70
[   22.424607]  kfree+0x222/0x3f0
[   22.424751]  rcu_uaf_reclaim+0x1f/0x60
[   22.425025]  rcu_core+0x66f/0x1c40
[   22.425329]  rcu_core_si+0x12/0x20
[   22.425494]  handle_softirqs+0x209/0x730
[   22.425757]  __irq_exit_rcu+0xc9/0x110
[   22.425955]  irq_exit_rcu+0x12/0x20
[   22.426111]  sysvec_apic_timer_interrupt+0x81/0x90
[   22.426457]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   22.426771] 
[   22.426949] Last potentially related work creation:
[   22.427161]  kasan_save_stack+0x45/0x70
[   22.427369]  kasan_record_aux_stack+0xb2/0xc0
[   22.427620]  __call_rcu_common.constprop.0+0x7b/0x9e0
[   22.427946]  call_rcu+0x12/0x20
[   22.428247]  rcu_uaf+0x168/0x330
[   22.428461]  kunit_try_run_case+0x1a5/0x480
[   22.428613]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.428792]  kthread+0x337/0x6f0
[   22.429049]  ret_from_fork+0x116/0x1d0
[   22.429437]  ret_from_fork_asm+0x1a/0x30
[   22.429739] 
[   22.429925] The buggy address belongs to the object at ffff888102c09480
[   22.429925]  which belongs to the cache kmalloc-32 of size 32
[   22.430732] The buggy address is located 0 bytes inside of
[   22.430732]  freed 32-byte region [ffff888102c09480, ffff888102c094a0)
[   22.431487] 
[   22.431630] The buggy address belongs to the physical page:
[   22.431897] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102c09
[   22.432434] flags: 0x200000000000000(node=0|zone=2)
[   22.432760] page_type: f5(slab)
[   22.433029] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   22.433394] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   22.433619] page dumped because: kasan: bad access detected
[   22.433903] 
[   22.434198] Memory state around the buggy address:
[   22.434543]  ffff888102c09380: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   22.435046]  ffff888102c09400: 00 00 05 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   22.435578] >ffff888102c09480: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   22.435912]                    ^
[   22.436056]  ffff888102c09500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.436343]  ffff888102c09580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.436713] ==================================================================