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

Environment
qemu-x86_64

[   13.401964] ==================================================================
[   13.402447] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   13.402865] Read of size 1 at addr ffff888103ac6000 by task kunit_try_catch/231
[   13.403121] 
[   13.403240] CPU: 0 UID: 0 PID: 231 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   13.403286] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.403298] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.403319] Call Trace:
[   13.403331]  <TASK>
[   13.403348]  dump_stack_lvl+0x73/0xb0
[   13.403498]  print_report+0xd1/0x650
[   13.403520]  ? __virt_addr_valid+0x1db/0x2d0
[   13.403544]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   13.403567]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.403590]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   13.403613]  kasan_report+0x141/0x180
[   13.403642]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   13.403669]  __asan_report_load1_noabort+0x18/0x20
[   13.403694]  kmem_cache_rcu_uaf+0x3e3/0x510
[   13.403717]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   13.403739]  ? finish_task_switch.isra.0+0x153/0x700
[   13.403773]  ? __switch_to+0x47/0xf50
[   13.403801]  ? __pfx_read_tsc+0x10/0x10
[   13.403823]  ? ktime_get_ts64+0x86/0x230
[   13.403847]  kunit_try_run_case+0x1a5/0x480
[   13.403872]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.403895]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.403921]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.403944]  ? __kthread_parkme+0x82/0x180
[   13.403965]  ? preempt_count_sub+0x50/0x80
[   13.403988]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.404042]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.404077]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.404102]  kthread+0x337/0x6f0
[   13.404121]  ? trace_preempt_on+0x20/0xc0
[   13.404145]  ? __pfx_kthread+0x10/0x10
[   13.404165]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.404186]  ? calculate_sigpending+0x7b/0xa0
[   13.404210]  ? __pfx_kthread+0x10/0x10
[   13.404231]  ret_from_fork+0x116/0x1d0
[   13.404249]  ? __pfx_kthread+0x10/0x10
[   13.404269]  ret_from_fork_asm+0x1a/0x30
[   13.404300]  </TASK>
[   13.404311] 
[   13.412988] Allocated by task 231:
[   13.413164]  kasan_save_stack+0x45/0x70
[   13.413356]  kasan_save_track+0x18/0x40
[   13.413537]  kasan_save_alloc_info+0x3b/0x50
[   13.413806]  __kasan_slab_alloc+0x91/0xa0
[   13.413994]  kmem_cache_alloc_noprof+0x123/0x3f0
[   13.414205]  kmem_cache_rcu_uaf+0x155/0x510
[   13.414410]  kunit_try_run_case+0x1a5/0x480
[   13.414599]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.414890]  kthread+0x337/0x6f0
[   13.415047]  ret_from_fork+0x116/0x1d0
[   13.415217]  ret_from_fork_asm+0x1a/0x30
[   13.415396] 
[   13.415481] Freed by task 0:
[   13.415617]  kasan_save_stack+0x45/0x70
[   13.416732]  kasan_save_track+0x18/0x40
[   13.416897]  kasan_save_free_info+0x3f/0x60
[   13.417044]  __kasan_slab_free+0x56/0x70
[   13.417182]  slab_free_after_rcu_debug+0xe4/0x310
[   13.417338]  rcu_core+0x66f/0x1c40
[   13.417733]  rcu_core_si+0x12/0x20
[   13.417919]  handle_softirqs+0x209/0x730
[   13.418102]  __irq_exit_rcu+0xc9/0x110
[   13.418275]  irq_exit_rcu+0x12/0x20
[   13.418445]  sysvec_apic_timer_interrupt+0x81/0x90
[   13.418706]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   13.418942] 
[   13.419029] Last potentially related work creation:
[   13.419231]  kasan_save_stack+0x45/0x70
[   13.419404]  kasan_record_aux_stack+0xb2/0xc0
[   13.419593]  kmem_cache_free+0x131/0x420
[   13.419897]  kmem_cache_rcu_uaf+0x194/0x510
[   13.420093]  kunit_try_run_case+0x1a5/0x480
[   13.420280]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.420510]  kthread+0x337/0x6f0
[   13.420847]  ret_from_fork+0x116/0x1d0
[   13.421035]  ret_from_fork_asm+0x1a/0x30
[   13.421225] 
[   13.421319] The buggy address belongs to the object at ffff888103ac6000
[   13.421319]  which belongs to the cache test_cache of size 200
[   13.421899] The buggy address is located 0 bytes inside of
[   13.421899]  freed 200-byte region [ffff888103ac6000, ffff888103ac60c8)
[   13.422374] 
[   13.422464] The buggy address belongs to the physical page:
[   13.422754] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103ac6
[   13.423089] flags: 0x200000000000000(node=0|zone=2)
[   13.423313] page_type: f5(slab)
[   13.423471] raw: 0200000000000000 ffff8881013423c0 dead000000000122 0000000000000000
[   13.423885] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   13.424202] page dumped because: kasan: bad access detected
[   13.424428] 
[   13.424512] Memory state around the buggy address:
[   13.424922]  ffff888103ac5f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.425220]  ffff888103ac5f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.425510] >ffff888103ac6000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   13.425924]                    ^
[   13.426075]  ffff888103ac6080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   13.426368]  ffff888103ac6100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.426684] ==================================================================