Hay
Date
July 19, 2025, 11:11 a.m.

Environment
qemu-arm64
qemu-x86_64

[   16.574280] ==================================================================
[   16.574393] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   16.574477] Read of size 1 at addr fff00000c63c2000 by task kunit_try_catch/214
[   16.574544] 
[   16.574589] CPU: 0 UID: 0 PID: 214 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   16.574674] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.574702] Hardware name: linux,dummy-virt (DT)
[   16.574736] Call trace:
[   16.574762]  show_stack+0x20/0x38 (C)
[   16.574816]  dump_stack_lvl+0x8c/0xd0
[   16.574867]  print_report+0x118/0x5d0
[   16.574914]  kasan_report+0xdc/0x128
[   16.574960]  __asan_report_load1_noabort+0x20/0x30
[   16.575012]  kmem_cache_rcu_uaf+0x388/0x468
[   16.575058]  kunit_try_run_case+0x170/0x3f0
[   16.575110]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.575163]  kthread+0x328/0x630
[   16.575207]  ret_from_fork+0x10/0x20
[   16.575256] 
[   16.575274] Allocated by task 214:
[   16.575306]  kasan_save_stack+0x3c/0x68
[   16.575349]  kasan_save_track+0x20/0x40
[   16.575386]  kasan_save_alloc_info+0x40/0x58
[   16.575426]  __kasan_slab_alloc+0xa8/0xb0
[   16.575464]  kmem_cache_alloc_noprof+0x10c/0x398
[   16.575505]  kmem_cache_rcu_uaf+0x12c/0x468
[   16.575558]  kunit_try_run_case+0x170/0x3f0
[   16.575594]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.575638]  kthread+0x328/0x630
[   16.575669]  ret_from_fork+0x10/0x20
[   16.575705] 
[   16.575724] Freed by task 0:
[   16.575752]  kasan_save_stack+0x3c/0x68
[   16.575789]  kasan_save_track+0x20/0x40
[   16.575828]  kasan_save_free_info+0x4c/0x78
[   16.575867]  __kasan_slab_free+0x6c/0x98
[   16.575906]  slab_free_after_rcu_debug+0xd4/0x2f8
[   16.575945]  rcu_core+0x9f4/0x1e20
[   16.575984]  rcu_core_si+0x18/0x30
[   16.576018]  handle_softirqs+0x374/0xb28
[   16.576057]  __do_softirq+0x1c/0x28
[   16.576091] 
[   16.576111] Last potentially related work creation:
[   16.576138]  kasan_save_stack+0x3c/0x68
[   16.576175]  kasan_record_aux_stack+0xb4/0xc8
[   16.576216]  kmem_cache_free+0x120/0x468
[   16.576251]  kmem_cache_rcu_uaf+0x16c/0x468
[   16.576290]  kunit_try_run_case+0x170/0x3f0
[   16.576328]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.576369]  kthread+0x328/0x630
[   16.576402]  ret_from_fork+0x10/0x20
[   16.576436] 
[   16.576457] The buggy address belongs to the object at fff00000c63c2000
[   16.576457]  which belongs to the cache test_cache of size 200
[   16.576517] The buggy address is located 0 bytes inside of
[   16.576517]  freed 200-byte region [fff00000c63c2000, fff00000c63c20c8)
[   16.576586] 
[   16.576608] The buggy address belongs to the physical page:
[   16.576642] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1063c2
[   16.576697] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.576750] page_type: f5(slab)
[   16.576793] raw: 0bfffe0000000000 fff00000c1b47500 dead000000000122 0000000000000000
[   16.576845] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   16.576887] page dumped because: kasan: bad access detected
[   16.576917] 
[   16.576936] Memory state around the buggy address:
[   16.576970]  fff00000c63c1f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.577015]  fff00000c63c1f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.577059] >fff00000c63c2000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   16.577099]                    ^
[   16.577128]  fff00000c63c2080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   16.577170]  fff00000c63c2100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.577209] ==================================================================

[   12.830419] ==================================================================
[   12.831878] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   12.833081] Read of size 1 at addr ffff8881027f3000 by task kunit_try_catch/231
[   12.833959] 
[   12.834245] CPU: 0 UID: 0 PID: 231 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   12.834317] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.834329] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.834353] Call Trace:
[   12.834373]  <TASK>
[   12.834392]  dump_stack_lvl+0x73/0xb0
[   12.834430]  print_report+0xd1/0x610
[   12.834452]  ? __virt_addr_valid+0x1db/0x2d0
[   12.834477]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.834509]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.834533]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.834557]  kasan_report+0x141/0x180
[   12.834578]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.834605]  __asan_report_load1_noabort+0x18/0x20
[   12.834628]  kmem_cache_rcu_uaf+0x3e3/0x510
[   12.834652]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   12.834675]  ? finish_task_switch.isra.0+0x153/0x700
[   12.834699]  ? __switch_to+0x47/0xf50
[   12.834728]  ? __pfx_read_tsc+0x10/0x10
[   12.834748]  ? ktime_get_ts64+0x86/0x230
[   12.834773]  kunit_try_run_case+0x1a5/0x480
[   12.834800]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.834821]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.834847]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.834870]  ? __kthread_parkme+0x82/0x180
[   12.834890]  ? preempt_count_sub+0x50/0x80
[   12.834913]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.834936]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.834980]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.835004]  kthread+0x337/0x6f0
[   12.835022]  ? trace_preempt_on+0x20/0xc0
[   12.835089]  ? __pfx_kthread+0x10/0x10
[   12.835109]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.835130]  ? calculate_sigpending+0x7b/0xa0
[   12.835154]  ? __pfx_kthread+0x10/0x10
[   12.835175]  ret_from_fork+0x116/0x1d0
[   12.835194]  ? __pfx_kthread+0x10/0x10
[   12.835213]  ret_from_fork_asm+0x1a/0x30
[   12.835245]  </TASK>
[   12.835256] 
[   12.846099] Allocated by task 231:
[   12.846811]  kasan_save_stack+0x45/0x70
[   12.847188]  kasan_save_track+0x18/0x40
[   12.847354]  kasan_save_alloc_info+0x3b/0x50
[   12.847588]  __kasan_slab_alloc+0x91/0xa0
[   12.847760]  kmem_cache_alloc_noprof+0x123/0x3f0
[   12.847981]  kmem_cache_rcu_uaf+0x155/0x510
[   12.848200]  kunit_try_run_case+0x1a5/0x480
[   12.848363]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.848974]  kthread+0x337/0x6f0
[   12.849406]  ret_from_fork+0x116/0x1d0
[   12.849609]  ret_from_fork_asm+0x1a/0x30
[   12.849792] 
[   12.849866] Freed by task 0:
[   12.850020]  kasan_save_stack+0x45/0x70
[   12.850594]  kasan_save_track+0x18/0x40
[   12.850850]  kasan_save_free_info+0x3f/0x60
[   12.851217]  __kasan_slab_free+0x56/0x70
[   12.851383]  slab_free_after_rcu_debug+0xe4/0x310
[   12.851775]  rcu_core+0x66f/0x1c40
[   12.851927]  rcu_core_si+0x12/0x20
[   12.852262]  handle_softirqs+0x209/0x730
[   12.852590]  __irq_exit_rcu+0xc9/0x110
[   12.852772]  irq_exit_rcu+0x12/0x20
[   12.852936]  sysvec_apic_timer_interrupt+0x81/0x90
[   12.853154]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   12.853396] 
[   12.853486] Last potentially related work creation:
[   12.853721]  kasan_save_stack+0x45/0x70
[   12.853904]  kasan_record_aux_stack+0xb2/0xc0
[   12.854101]  kmem_cache_free+0x131/0x420
[   12.854557]  kmem_cache_rcu_uaf+0x194/0x510
[   12.854715]  kunit_try_run_case+0x1a5/0x480
[   12.854862]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.855058]  kthread+0x337/0x6f0
[   12.855360]  ret_from_fork+0x116/0x1d0
[   12.855693]  ret_from_fork_asm+0x1a/0x30
[   12.855953] 
[   12.856026] The buggy address belongs to the object at ffff8881027f3000
[   12.856026]  which belongs to the cache test_cache of size 200
[   12.856691] The buggy address is located 0 bytes inside of
[   12.856691]  freed 200-byte region [ffff8881027f3000, ffff8881027f30c8)
[   12.857233] 
[   12.857331] The buggy address belongs to the physical page:
[   12.857525] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1027f3
[   12.857883] flags: 0x200000000000000(node=0|zone=2)
[   12.858234] page_type: f5(slab)
[   12.858408] raw: 0200000000000000 ffff888101640500 dead000000000122 0000000000000000
[   12.858659] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   12.858993] page dumped because: kasan: bad access detected
[   12.859248] 
[   12.859408] Memory state around the buggy address:
[   12.859614]  ffff8881027f2f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.859846]  ffff8881027f2f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.860341] >ffff8881027f3000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   12.860643]                    ^
[   12.860807]  ffff8881027f3080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   12.861055]  ffff8881027f3100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.861443] ==================================================================