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

Environment
qemu-x86_64

[   14.525032] ==================================================================
[   14.525697] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   14.526217] Read of size 1 at addr ffff88810333f000 by task kunit_try_catch/230
[   14.527153] 
[   14.527298] CPU: 1 UID: 0 PID: 230 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   14.527373] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.527389] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.527431] Call Trace:
[   14.527447]  <TASK>
[   14.527483]  dump_stack_lvl+0x73/0xb0
[   14.527523]  print_report+0xd1/0x650
[   14.527563]  ? __virt_addr_valid+0x1db/0x2d0
[   14.527593]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   14.527620]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.527658]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   14.527686]  kasan_report+0x141/0x180
[   14.527711]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   14.527744]  __asan_report_load1_noabort+0x18/0x20
[   14.527771]  kmem_cache_rcu_uaf+0x3e3/0x510
[   14.527908]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   14.527936]  ? finish_task_switch.isra.0+0x153/0x700
[   14.528120]  ? __switch_to+0x47/0xf50
[   14.528158]  ? __pfx_read_tsc+0x10/0x10
[   14.528197]  ? ktime_get_ts64+0x86/0x230
[   14.528227]  kunit_try_run_case+0x1a5/0x480
[   14.528259]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.528285]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.528314]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.528341]  ? __kthread_parkme+0x82/0x180
[   14.528365]  ? preempt_count_sub+0x50/0x80
[   14.528392]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.528419]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.528467]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.528494]  kthread+0x337/0x6f0
[   14.528529]  ? trace_preempt_on+0x20/0xc0
[   14.528557]  ? __pfx_kthread+0x10/0x10
[   14.528581]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.528619]  ? calculate_sigpending+0x7b/0xa0
[   14.528659]  ? __pfx_kthread+0x10/0x10
[   14.528685]  ret_from_fork+0x116/0x1d0
[   14.528706]  ? __pfx_kthread+0x10/0x10
[   14.528731]  ret_from_fork_asm+0x1a/0x30
[   14.528779]  </TASK>
[   14.528793] 
[   14.542085] Allocated by task 230:
[   14.542585]  kasan_save_stack+0x45/0x70
[   14.543277]  kasan_save_track+0x18/0x40
[   14.543508]  kasan_save_alloc_info+0x3b/0x50
[   14.543755]  __kasan_slab_alloc+0x91/0xa0
[   14.544283]  kmem_cache_alloc_noprof+0x123/0x3f0
[   14.544677]  kmem_cache_rcu_uaf+0x155/0x510
[   14.545088]  kunit_try_run_case+0x1a5/0x480
[   14.545548]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.546112]  kthread+0x337/0x6f0
[   14.546390]  ret_from_fork+0x116/0x1d0
[   14.547016]  ret_from_fork_asm+0x1a/0x30
[   14.547278] 
[   14.547386] Freed by task 0:
[   14.547538]  kasan_save_stack+0x45/0x70
[   14.547765]  kasan_save_track+0x18/0x40
[   14.547975]  kasan_save_free_info+0x3f/0x60
[   14.548198]  __kasan_slab_free+0x56/0x70
[   14.548410]  slab_free_after_rcu_debug+0xe4/0x310
[   14.548875]  rcu_core+0x66f/0x1c40
[   14.549203]  rcu_core_si+0x12/0x20
[   14.549372]  handle_softirqs+0x209/0x730
[   14.549595]  __irq_exit_rcu+0xc9/0x110
[   14.549872]  irq_exit_rcu+0x12/0x20
[   14.550095]  sysvec_apic_timer_interrupt+0x81/0x90
[   14.550354]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   14.550676] 
[   14.550856] Last potentially related work creation:
[   14.551135]  kasan_save_stack+0x45/0x70
[   14.551348]  kasan_record_aux_stack+0xb2/0xc0
[   14.551587]  kmem_cache_free+0x131/0x420
[   14.551996]  kmem_cache_rcu_uaf+0x194/0x510
[   14.552206]  kunit_try_run_case+0x1a5/0x480
[   14.552379]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.552585]  kthread+0x337/0x6f0
[   14.552740]  ret_from_fork+0x116/0x1d0
[   14.552899]  ret_from_fork_asm+0x1a/0x30
[   14.553093] 
[   14.553211] The buggy address belongs to the object at ffff88810333f000
[   14.553211]  which belongs to the cache test_cache of size 200
[   14.553857] The buggy address is located 0 bytes inside of
[   14.553857]  freed 200-byte region [ffff88810333f000, ffff88810333f0c8)
[   14.554517] 
[   14.554640] The buggy address belongs to the physical page:
[   14.555211] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10333f
[   14.556558] flags: 0x200000000000000(node=0|zone=2)
[   14.557127] page_type: f5(slab)
[   14.557428] raw: 0200000000000000 ffff88810333c000 dead000000000122 0000000000000000
[   14.558119] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   14.558671] page dumped because: kasan: bad access detected
[   14.559164] 
[   14.559401] Memory state around the buggy address:
[   14.559755]  ffff88810333ef00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.560194]  ffff88810333ef80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.560532] >ffff88810333f000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   14.561293]                    ^
[   14.561448]  ffff88810333f080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   14.562131]  ffff88810333f100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.562639] ==================================================================