Hay
Date
July 9, 2025, 2:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   18.446020] ==================================================================
[   18.446158] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   18.446244] Read of size 1 at addr fff00000c779e000 by task kunit_try_catch/213
[   18.446301] 
[   18.446347] CPU: 1 UID: 0 PID: 213 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc5 #1 PREEMPT 
[   18.446442] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   18.446472] Hardware name: linux,dummy-virt (DT)
[   18.446508] Call trace:
[   18.446532]  show_stack+0x20/0x38 (C)
[   18.446589]  dump_stack_lvl+0x8c/0xd0
[   18.446642]  print_report+0x118/0x608
[   18.446693]  kasan_report+0xdc/0x128
[   18.446739]  __asan_report_load1_noabort+0x20/0x30
[   18.446792]  kmem_cache_rcu_uaf+0x388/0x468
[   18.446841]  kunit_try_run_case+0x170/0x3f0
[   18.446892]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.446947]  kthread+0x328/0x630
[   18.446993]  ret_from_fork+0x10/0x20
[   18.447045] 
[   18.447063] Allocated by task 213:
[   18.447104]  kasan_save_stack+0x3c/0x68
[   18.447147]  kasan_save_track+0x20/0x40
[   18.447186]  kasan_save_alloc_info+0x40/0x58
[   18.447227]  __kasan_slab_alloc+0xa8/0xb0
[   18.447264]  kmem_cache_alloc_noprof+0x10c/0x398
[   18.447307]  kmem_cache_rcu_uaf+0x12c/0x468
[   18.447346]  kunit_try_run_case+0x170/0x3f0
[   18.447384]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.447429]  kthread+0x328/0x630
[   18.447462]  ret_from_fork+0x10/0x20
[   18.447500] 
[   18.447521] Freed by task 0:
[   18.447550]  kasan_save_stack+0x3c/0x68
[   18.447586]  kasan_save_track+0x20/0x40
[   18.447624]  kasan_save_free_info+0x4c/0x78
[   18.447664]  __kasan_slab_free+0x6c/0x98
[   18.447702]  slab_free_after_rcu_debug+0xd4/0x2f8
[   18.447743]  rcu_core+0x9f4/0x1e20
[   18.447780]  rcu_core_si+0x18/0x30
[   18.447816]  handle_softirqs+0x374/0xb28
[   18.447855]  __do_softirq+0x1c/0x28
[   18.447890] 
[   18.447909] Last potentially related work creation:
[   18.447937]  kasan_save_stack+0x3c/0x68
[   18.447976]  kasan_record_aux_stack+0xb4/0xc8
[   18.448018]  kmem_cache_free+0x120/0x468
[   18.448061]  kmem_cache_rcu_uaf+0x16c/0x468
[   18.448111]  kunit_try_run_case+0x170/0x3f0
[   18.448150]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.448195]  kthread+0x328/0x630
[   18.448229]  ret_from_fork+0x10/0x20
[   18.448265] 
[   18.448284] The buggy address belongs to the object at fff00000c779e000
[   18.448284]  which belongs to the cache test_cache of size 200
[   18.448345] The buggy address is located 0 bytes inside of
[   18.448345]  freed 200-byte region [fff00000c779e000, fff00000c779e0c8)
[   18.448409] 
[   18.448431] The buggy address belongs to the physical page:
[   18.448464] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10779e
[   18.448525] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.448579] page_type: f5(slab)
[   18.448629] raw: 0bfffe0000000000 fff00000c582b780 dead000000000122 0000000000000000
[   18.448685] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   18.448730] page dumped because: kasan: bad access detected
[   18.448760] 
[   18.448777] Memory state around the buggy address:
[   18.448813]  fff00000c779df00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   18.448860]  fff00000c779df80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   18.448907] >fff00000c779e000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   18.448947]                    ^
[   18.448976]  fff00000c779e080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   18.449021]  fff00000c779e100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.449062] ==================================================================

[   13.569172] ==================================================================
[   13.569765] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   13.570294] Read of size 1 at addr ffff888103961000 by task kunit_try_catch/230
[   13.570589] 
[   13.570700] CPU: 1 UID: 0 PID: 230 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   13.570751] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.570763] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.570814] Call Trace:
[   13.570832]  <TASK>
[   13.570852]  dump_stack_lvl+0x73/0xb0
[   13.570902]  print_report+0xd1/0x650
[   13.570926]  ? __virt_addr_valid+0x1db/0x2d0
[   13.570951]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   13.571033]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.571057]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   13.571080]  kasan_report+0x141/0x180
[   13.571144]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   13.571175]  __asan_report_load1_noabort+0x18/0x20
[   13.571200]  kmem_cache_rcu_uaf+0x3e3/0x510
[   13.571226]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   13.571250]  ? finish_task_switch.isra.0+0x153/0x700
[   13.571275]  ? __switch_to+0x47/0xf50
[   13.571305]  ? __pfx_read_tsc+0x10/0x10
[   13.571327]  ? ktime_get_ts64+0x86/0x230
[   13.571353]  kunit_try_run_case+0x1a5/0x480
[   13.571379]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.571428]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.571454]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.571478]  ? __kthread_parkme+0x82/0x180
[   13.571510]  ? preempt_count_sub+0x50/0x80
[   13.571533]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.571585]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.571625]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.571650]  kthread+0x337/0x6f0
[   13.571668]  ? trace_preempt_on+0x20/0xc0
[   13.571693]  ? __pfx_kthread+0x10/0x10
[   13.571713]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.571734]  ? calculate_sigpending+0x7b/0xa0
[   13.571758]  ? __pfx_kthread+0x10/0x10
[   13.572224]  ret_from_fork+0x116/0x1d0
[   13.572248]  ? __pfx_kthread+0x10/0x10
[   13.572268]  ret_from_fork_asm+0x1a/0x30
[   13.572301]  </TASK>
[   13.572312] 
[   13.580864] Allocated by task 230:
[   13.581060]  kasan_save_stack+0x45/0x70
[   13.581581]  kasan_save_track+0x18/0x40
[   13.581758]  kasan_save_alloc_info+0x3b/0x50
[   13.582113]  __kasan_slab_alloc+0x91/0xa0
[   13.582269]  kmem_cache_alloc_noprof+0x123/0x3f0
[   13.582476]  kmem_cache_rcu_uaf+0x155/0x510
[   13.582696]  kunit_try_run_case+0x1a5/0x480
[   13.582962]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.583189]  kthread+0x337/0x6f0
[   13.583457]  ret_from_fork+0x116/0x1d0
[   13.583617]  ret_from_fork_asm+0x1a/0x30
[   13.583902] 
[   13.584060] Freed by task 0:
[   13.584190]  kasan_save_stack+0x45/0x70
[   13.584330]  kasan_save_track+0x18/0x40
[   13.584528]  kasan_save_free_info+0x3f/0x60
[   13.584756]  __kasan_slab_free+0x56/0x70
[   13.585039]  slab_free_after_rcu_debug+0xe4/0x310
[   13.585515]  rcu_core+0x66f/0x1c40
[   13.585710]  rcu_core_si+0x12/0x20
[   13.586107]  handle_softirqs+0x209/0x730
[   13.586255]  __irq_exit_rcu+0xc9/0x110
[   13.586452]  irq_exit_rcu+0x12/0x20
[   13.586661]  sysvec_apic_timer_interrupt+0x81/0x90
[   13.586908]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   13.587283] 
[   13.587399] Last potentially related work creation:
[   13.587561]  kasan_save_stack+0x45/0x70
[   13.587731]  kasan_record_aux_stack+0xb2/0xc0
[   13.588178]  kmem_cache_free+0x131/0x420
[   13.589041]  kmem_cache_rcu_uaf+0x194/0x510
[   13.589378]  kunit_try_run_case+0x1a5/0x480
[   13.589824]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.590132]  kthread+0x337/0x6f0
[   13.590268]  ret_from_fork+0x116/0x1d0
[   13.590460]  ret_from_fork_asm+0x1a/0x30
[   13.590660] 
[   13.590746] The buggy address belongs to the object at ffff888103961000
[   13.590746]  which belongs to the cache test_cache of size 200
[   13.591921] The buggy address is located 0 bytes inside of
[   13.591921]  freed 200-byte region [ffff888103961000, ffff8881039610c8)
[   13.592605] 
[   13.592718] The buggy address belongs to the physical page:
[   13.593007] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103961
[   13.593584] flags: 0x200000000000000(node=0|zone=2)
[   13.594024] page_type: f5(slab)
[   13.594201] raw: 0200000000000000 ffff88810395f000 dead000000000122 0000000000000000
[   13.594532] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   13.594953] page dumped because: kasan: bad access detected
[   13.595425] 
[   13.595507] Memory state around the buggy address:
[   13.596046]  ffff888103960f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.596554]  ffff888103960f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.597232] >ffff888103961000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   13.597737]                    ^
[   13.597956]  ffff888103961080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   13.598277]  ffff888103961100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.598585] ==================================================================