Hay
Date
July 18, 2025, 11:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.514090] ==================================================================
[   16.514205] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   16.514286] Read of size 1 at addr fff00000c3f28000 by task kunit_try_catch/213
[   16.514351] 
[   16.515694] CPU: 1 UID: 0 PID: 213 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   16.515860] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.516689] Hardware name: linux,dummy-virt (DT)
[   16.516851] Call trace:
[   16.517088]  show_stack+0x20/0x38 (C)
[   16.517743]  dump_stack_lvl+0x8c/0xd0
[   16.517896]  print_report+0x118/0x5d0
[   16.518371]  kasan_report+0xdc/0x128
[   16.518608]  __asan_report_load1_noabort+0x20/0x30
[   16.518663]  kmem_cache_rcu_uaf+0x388/0x468
[   16.518709]  kunit_try_run_case+0x170/0x3f0
[   16.519464]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.519533]  kthread+0x328/0x630
[   16.520117]  ret_from_fork+0x10/0x20
[   16.520548] 
[   16.521080] Allocated by task 213:
[   16.521119]  kasan_save_stack+0x3c/0x68
[   16.521169]  kasan_save_track+0x20/0x40
[   16.521208]  kasan_save_alloc_info+0x40/0x58
[   16.521247]  __kasan_slab_alloc+0xa8/0xb0
[   16.521981]  kmem_cache_alloc_noprof+0x10c/0x398
[   16.522226]  kmem_cache_rcu_uaf+0x12c/0x468
[   16.522796]  kunit_try_run_case+0x170/0x3f0
[   16.523158]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.523976]  kthread+0x328/0x630
[   16.524139]  ret_from_fork+0x10/0x20
[   16.524180] 
[   16.524570] Freed by task 0:
[   16.524607]  kasan_save_stack+0x3c/0x68
[   16.524952]  kasan_save_track+0x20/0x40
[   16.525158]  kasan_save_free_info+0x4c/0x78
[   16.525200]  __kasan_slab_free+0x6c/0x98
[   16.525765]  slab_free_after_rcu_debug+0xd4/0x2f8
[   16.525925]  rcu_core+0x9f4/0x1e20
[   16.526243]  rcu_core_si+0x18/0x30
[   16.527148]  handle_softirqs+0x374/0xb28
[   16.527302]  __do_softirq+0x1c/0x28
[   16.527450] 
[   16.527586] Last potentially related work creation:
[   16.527651]  kasan_save_stack+0x3c/0x68
[   16.527792]  kasan_record_aux_stack+0xb4/0xc8
[   16.528008]  kmem_cache_free+0x120/0x468
[   16.528050]  kmem_cache_rcu_uaf+0x16c/0x468
[   16.528134]  kunit_try_run_case+0x170/0x3f0
[   16.528232]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.528276]  kthread+0x328/0x630
[   16.528309]  ret_from_fork+0x10/0x20
[   16.528450] 
[   16.528471] The buggy address belongs to the object at fff00000c3f28000
[   16.528471]  which belongs to the cache test_cache of size 200
[   16.529525] The buggy address is located 0 bytes inside of
[   16.529525]  freed 200-byte region [fff00000c3f28000, fff00000c3f280c8)
[   16.530088] 
[   16.530850] The buggy address belongs to the physical page:
[   16.530975] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103f28
[   16.531050] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.531106] page_type: f5(slab)
[   16.531152] raw: 0bfffe0000000000 fff00000c3e97dc0 dead000000000122 0000000000000000
[   16.531558] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   16.532139] page dumped because: kasan: bad access detected
[   16.532688] 
[   16.532709] Memory state around the buggy address:
[   16.532750]  fff00000c3f27f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   16.533196]  fff00000c3f27f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   16.533368] >fff00000c3f28000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   16.533613]                    ^
[   16.533647]  fff00000c3f28080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   16.533709]  fff00000c3f28100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.534003] ==================================================================

[   12.957193] ==================================================================
[   12.957723] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   12.958206] Read of size 1 at addr ffff8881029dc000 by task kunit_try_catch/232
[   12.958602] 
[   12.958712] CPU: 0 UID: 0 PID: 232 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   12.958789] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.958802] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.958823] Call Trace:
[   12.958837]  <TASK>
[   12.958886]  dump_stack_lvl+0x73/0xb0
[   12.958918]  print_report+0xd1/0x610
[   12.958940]  ? __virt_addr_valid+0x1db/0x2d0
[   12.958975]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.958998]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.959020]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.959043]  kasan_report+0x141/0x180
[   12.959064]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.959187]  __asan_report_load1_noabort+0x18/0x20
[   12.959213]  kmem_cache_rcu_uaf+0x3e3/0x510
[   12.959236]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   12.959258]  ? finish_task_switch.isra.0+0x153/0x700
[   12.959293]  ? __switch_to+0x47/0xf50
[   12.959321]  ? __pfx_read_tsc+0x10/0x10
[   12.959342]  ? ktime_get_ts64+0x86/0x230
[   12.959397]  kunit_try_run_case+0x1a5/0x480
[   12.959423]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.959737]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.959766]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.959790]  ? __kthread_parkme+0x82/0x180
[   12.959811]  ? preempt_count_sub+0x50/0x80
[   12.959834]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.959857]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.959882]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.959906]  kthread+0x337/0x6f0
[   12.959925]  ? trace_preempt_on+0x20/0xc0
[   12.959948]  ? __pfx_kthread+0x10/0x10
[   12.959968]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.959990]  ? calculate_sigpending+0x7b/0xa0
[   12.960014]  ? __pfx_kthread+0x10/0x10
[   12.960109]  ret_from_fork+0x116/0x1d0
[   12.960129]  ? __pfx_kthread+0x10/0x10
[   12.960149]  ret_from_fork_asm+0x1a/0x30
[   12.960179]  </TASK>
[   12.960189] 
[   12.969092] Allocated by task 232:
[   12.969257]  kasan_save_stack+0x45/0x70
[   12.969586]  kasan_save_track+0x18/0x40
[   12.969852]  kasan_save_alloc_info+0x3b/0x50
[   12.970223]  __kasan_slab_alloc+0x91/0xa0
[   12.970377]  kmem_cache_alloc_noprof+0x123/0x3f0
[   12.970766]  kmem_cache_rcu_uaf+0x155/0x510
[   12.971104]  kunit_try_run_case+0x1a5/0x480
[   12.971313]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.971689]  kthread+0x337/0x6f0
[   12.971904]  ret_from_fork+0x116/0x1d0
[   12.972072]  ret_from_fork_asm+0x1a/0x30
[   12.972244] 
[   12.972447] Freed by task 0:
[   12.972647]  kasan_save_stack+0x45/0x70
[   12.972840]  kasan_save_track+0x18/0x40
[   12.973047]  kasan_save_free_info+0x3f/0x60
[   12.973261]  __kasan_slab_free+0x56/0x70
[   12.973479]  slab_free_after_rcu_debug+0xe4/0x310
[   12.973810]  rcu_core+0x66f/0x1c40
[   12.973991]  rcu_core_si+0x12/0x20
[   12.974162]  handle_softirqs+0x209/0x730
[   12.974541]  __irq_exit_rcu+0xc9/0x110
[   12.974727]  irq_exit_rcu+0x12/0x20
[   12.974849]  sysvec_apic_timer_interrupt+0x81/0x90
[   12.975110]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   12.975364] 
[   12.975461] Last potentially related work creation:
[   12.975632]  kasan_save_stack+0x45/0x70
[   12.975764]  kasan_record_aux_stack+0xb2/0xc0
[   12.975910]  kmem_cache_free+0x131/0x420
[   12.976074]  kmem_cache_rcu_uaf+0x194/0x510
[   12.976293]  kunit_try_run_case+0x1a5/0x480
[   12.976636]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.976954]  kthread+0x337/0x6f0
[   12.977323]  ret_from_fork+0x116/0x1d0
[   12.977620]  ret_from_fork_asm+0x1a/0x30
[   12.977795] 
[   12.977864] The buggy address belongs to the object at ffff8881029dc000
[   12.977864]  which belongs to the cache test_cache of size 200
[   12.978247] The buggy address is located 0 bytes inside of
[   12.978247]  freed 200-byte region [ffff8881029dc000, ffff8881029dc0c8)
[   12.979010] 
[   12.979146] The buggy address belongs to the physical page:
[   12.979464] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1029dc
[   12.980006] flags: 0x200000000000000(node=0|zone=2)
[   12.980221] page_type: f5(slab)
[   12.980505] raw: 0200000000000000 ffff888100a74280 dead000000000122 0000000000000000
[   12.980877] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   12.981394] page dumped because: kasan: bad access detected
[   12.981725] 
[   12.981797] Memory state around the buggy address:
[   12.981950]  ffff8881029dbf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.982640]  ffff8881029dbf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.982988] >ffff8881029dc000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   12.983489]                    ^
[   12.983672]  ffff8881029dc080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   12.984024]  ffff8881029dc100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.984433] ==================================================================