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

Environment
qemu-arm64
qemu-x86_64

[   19.902951] ==================================================================
[   19.903902] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x64/0x70
[   19.904262] Read of size 4 at addr fff00000c599ed80 by task swapper/0/0
[   19.904534] 
[   19.904815] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   19.905370] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.905435] Hardware name: linux,dummy-virt (DT)
[   19.905499] Call trace:
[   19.905541]  show_stack+0x20/0x38 (C)
[   19.905650]  dump_stack_lvl+0x8c/0xd0
[   19.905752]  print_report+0x118/0x608
[   19.906247]  kasan_report+0xdc/0x128
[   19.906547]  __asan_report_load4_noabort+0x20/0x30
[   19.907150]  rcu_uaf_reclaim+0x64/0x70
[   19.907480]  rcu_core+0x9f4/0x1e20
[   19.908127]  rcu_core_si+0x18/0x30
[   19.908877]  handle_softirqs+0x374/0xb28
[   19.909153]  __do_softirq+0x1c/0x28
[   19.909609]  ____do_softirq+0x18/0x30
[   19.909708]  call_on_irq_stack+0x24/0x30
[   19.910179]  do_softirq_own_stack+0x24/0x38
[   19.910396]  __irq_exit_rcu+0x1fc/0x318
[   19.910502]  irq_exit_rcu+0x1c/0x80
[   19.910617]  el1_interrupt+0x38/0x58
[   19.911200]  el1h_64_irq_handler+0x18/0x28
[   19.911961]  el1h_64_irq+0x6c/0x70
[   19.912595]  arch_local_irq_enable+0x4/0x8 (P)
[   19.912837]  do_idle+0x384/0x4e8
[   19.913409]  cpu_startup_entry+0x68/0x80
[   19.913519]  rest_init+0x160/0x188
[   19.914065]  start_kernel+0x30c/0x3d0
[   19.914467]  __primary_switched+0x8c/0xa0
[   19.914775] 
[   19.914848] Allocated by task 199:
[   19.915302]  kasan_save_stack+0x3c/0x68
[   19.915438]  kasan_save_track+0x20/0x40
[   19.915747]  kasan_save_alloc_info+0x40/0x58
[   19.916002]  __kasan_kmalloc+0xd4/0xd8
[   19.916262]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.916568]  rcu_uaf+0xb0/0x2d8
[   19.916701]  kunit_try_run_case+0x170/0x3f0
[   19.917008]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.917215]  kthread+0x328/0x630
[   19.917488]  ret_from_fork+0x10/0x20
[   19.917583] 
[   19.917625] Freed by task 0:
[   19.918070]  kasan_save_stack+0x3c/0x68
[   19.918172]  kasan_save_track+0x20/0x40
[   19.918275]  kasan_save_free_info+0x4c/0x78
[   19.918370]  __kasan_slab_free+0x6c/0x98
[   19.918451]  kfree+0x214/0x3c8
[   19.918536]  rcu_uaf_reclaim+0x28/0x70
[   19.918634]  rcu_core+0x9f4/0x1e20
[   19.918717]  rcu_core_si+0x18/0x30
[   19.919459]  handle_softirqs+0x374/0xb28
[   19.919912]  __do_softirq+0x1c/0x28
[   19.920116] 
[   19.920468] Last potentially related work creation:
[   19.920818]  kasan_save_stack+0x3c/0x68
[   19.921091]  kasan_record_aux_stack+0xb4/0xc8
[   19.921228]  __call_rcu_common.constprop.0+0x74/0x8c8
[   19.921475]  call_rcu+0x18/0x30
[   19.921579]  rcu_uaf+0x14c/0x2d8
[   19.921649]  kunit_try_run_case+0x170/0x3f0
[   19.921732]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.921841]  kthread+0x328/0x630
[   19.922260]  ret_from_fork+0x10/0x20
[   19.922845] 
[   19.922922] The buggy address belongs to the object at fff00000c599ed80
[   19.922922]  which belongs to the cache kmalloc-32 of size 32
[   19.923068] The buggy address is located 0 bytes inside of
[   19.923068]  freed 32-byte region [fff00000c599ed80, fff00000c599eda0)
[   19.923236] 
[   19.923309] The buggy address belongs to the physical page:
[   19.923426] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10599e
[   19.923617] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.923781] page_type: f5(slab)
[   19.923905] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   19.924023] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   19.924121] page dumped because: kasan: bad access detected
[   19.924200] 
[   19.924243] Memory state around the buggy address:
[   19.924320]  fff00000c599ec80: 00 00 00 fc fc fc fc fc 00 00 05 fc fc fc fc fc
[   19.924443]  fff00000c599ed00: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   19.924585] >fff00000c599ed80: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   19.924713]                    ^
[   19.924807]  fff00000c599ee00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.924923]  fff00000c599ee80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.925021] ==================================================================

[   13.178777] ==================================================================
[   13.179374] BUG: KASAN: slab-use-after-free in rcu_uaf_reclaim+0x50/0x60
[   13.179598] Read of size 4 at addr ffff888103abf140 by task swapper/0/0
[   13.179852] 
[   13.180081] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   13.180125] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.180136] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.180156] Call Trace:
[   13.180185]  <IRQ>
[   13.180200]  dump_stack_lvl+0x73/0xb0
[   13.180230]  print_report+0xd1/0x650
[   13.180253]  ? __virt_addr_valid+0x1db/0x2d0
[   13.180276]  ? rcu_uaf_reclaim+0x50/0x60
[   13.180297]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.180321]  ? rcu_uaf_reclaim+0x50/0x60
[   13.180341]  kasan_report+0x141/0x180
[   13.180363]  ? rcu_uaf_reclaim+0x50/0x60
[   13.180388]  __asan_report_load4_noabort+0x18/0x20
[   13.180413]  rcu_uaf_reclaim+0x50/0x60
[   13.180434]  rcu_core+0x66f/0x1c40
[   13.180462]  ? __pfx_rcu_core+0x10/0x10
[   13.180483]  ? ktime_get+0x6b/0x150
[   13.180504]  ? handle_softirqs+0x18e/0x730
[   13.180529]  rcu_core_si+0x12/0x20
[   13.180548]  handle_softirqs+0x209/0x730
[   13.180568]  ? hrtimer_interrupt+0x2fe/0x780
[   13.180618]  ? __pfx_handle_softirqs+0x10/0x10
[   13.180644]  __irq_exit_rcu+0xc9/0x110
[   13.180664]  irq_exit_rcu+0x12/0x20
[   13.180683]  sysvec_apic_timer_interrupt+0x81/0x90
[   13.180709]  </IRQ>
[   13.180734]  <TASK>
[   13.180756]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   13.180848] RIP: 0010:pv_native_safe_halt+0xf/0x20
[   13.181086] 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 e3 71 21 00 fb f4 <c3> cc cc cc cc 66 2e 0f 1f 84 00 00 00 00 00 66 90 90 90 90 90 90
[   13.181167] RSP: 0000:ffffffff88607dd8 EFLAGS: 00010202
[   13.181258] RAX: ffff8881d1672000 RBX: ffffffff8861cac0 RCX: ffffffff87475105
[   13.181303] RDX: ffffed102b60618b RSI: 0000000000000004 RDI: 0000000000005ed4
[   13.181344] RBP: ffffffff88607de0 R08: 0000000000000001 R09: ffffed102b60618a
[   13.181384] R10: ffff88815b030c53 R11: 000000000001a800 R12: 0000000000000000
[   13.181426] R13: fffffbfff10c3958 R14: ffffffff891b1490 R15: 0000000000000000
[   13.181481]  ? ct_kernel_exit.constprop.0+0xa5/0xd0
[   13.181536]  ? default_idle+0xd/0x20
[   13.181558]  arch_cpu_idle+0xd/0x20
[   13.181579]  default_idle_call+0x48/0x80
[   13.181599]  do_idle+0x379/0x4f0
[   13.181625]  ? __pfx_do_idle+0x10/0x10
[   13.181656]  ? trace_preempt_on+0x20/0xc0
[   13.181680]  ? schedule+0x86/0x2e0
[   13.181699]  ? preempt_count_sub+0x50/0x80
[   13.181723]  cpu_startup_entry+0x5c/0x70
[   13.181742]  rest_init+0x11a/0x140
[   13.181769]  ? acpi_subsystem_init+0x5d/0x150
[   13.181794]  start_kernel+0x330/0x410
[   13.181819]  x86_64_start_reservations+0x1c/0x30
[   13.181845]  x86_64_start_kernel+0x10d/0x120
[   13.181869]  common_startup_64+0x13e/0x148
[   13.181900]  </TASK>
[   13.181911] 
[   13.197741] Allocated by task 216:
[   13.198006]  kasan_save_stack+0x45/0x70
[   13.198327]  kasan_save_track+0x18/0x40
[   13.198500]  kasan_save_alloc_info+0x3b/0x50
[   13.198721]  __kasan_kmalloc+0xb7/0xc0
[   13.199094]  __kmalloc_cache_noprof+0x189/0x420
[   13.199372]  rcu_uaf+0xb0/0x330
[   13.199503]  kunit_try_run_case+0x1a5/0x480
[   13.199882]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.200201]  kthread+0x337/0x6f0
[   13.200335]  ret_from_fork+0x116/0x1d0
[   13.200531]  ret_from_fork_asm+0x1a/0x30
[   13.200860] 
[   13.200948] Freed by task 0:
[   13.201075]  kasan_save_stack+0x45/0x70
[   13.201267]  kasan_save_track+0x18/0x40
[   13.201443]  kasan_save_free_info+0x3f/0x60
[   13.201639]  __kasan_slab_free+0x56/0x70
[   13.202159]  kfree+0x222/0x3f0
[   13.202281]  rcu_uaf_reclaim+0x1f/0x60
[   13.202550]  rcu_core+0x66f/0x1c40
[   13.202869]  rcu_core_si+0x12/0x20
[   13.203006]  handle_softirqs+0x209/0x730
[   13.203304]  __irq_exit_rcu+0xc9/0x110
[   13.203555]  irq_exit_rcu+0x12/0x20
[   13.203806]  sysvec_apic_timer_interrupt+0x81/0x90
[   13.204040]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   13.204264] 
[   13.204370] Last potentially related work creation:
[   13.204598]  kasan_save_stack+0x45/0x70
[   13.205053]  kasan_record_aux_stack+0xb2/0xc0
[   13.205242]  __call_rcu_common.constprop.0+0x7b/0x9e0
[   13.205479]  call_rcu+0x12/0x20
[   13.205822]  rcu_uaf+0x168/0x330
[   13.205997]  kunit_try_run_case+0x1a5/0x480
[   13.206292]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.206584]  kthread+0x337/0x6f0
[   13.206784]  ret_from_fork+0x116/0x1d0
[   13.207070]  ret_from_fork_asm+0x1a/0x30
[   13.207275] 
[   13.207384] The buggy address belongs to the object at ffff888103abf140
[   13.207384]  which belongs to the cache kmalloc-32 of size 32
[   13.208102] The buggy address is located 0 bytes inside of
[   13.208102]  freed 32-byte region [ffff888103abf140, ffff888103abf160)
[   13.208602] 
[   13.208702] The buggy address belongs to the physical page:
[   13.209131] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103abf
[   13.209509] flags: 0x200000000000000(node=0|zone=2)
[   13.209729] page_type: f5(slab)
[   13.209995] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.210432] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   13.210840] page dumped because: kasan: bad access detected
[   13.211078] 
[   13.211168] Memory state around the buggy address:
[   13.211362]  ffff888103abf000: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   13.211643]  ffff888103abf080: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.212249] >ffff888103abf100: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.212546]                                            ^
[   13.212939]  ffff888103abf180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.213200]  ffff888103abf200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.213584] ==================================================================