Hay
Date
June 7, 2025, 10:40 a.m.

Environment
qemu-arm64
qemu-x86_64

[   24.189296] ==================================================================
[   24.189443] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   24.189553] Read of size 1 at addr fff00000c7774000 by task kunit_try_catch/217
[   24.189616] 
[   24.189672] CPU: 1 UID: 0 PID: 217 Comm: kunit_try_catch Tainted: G    B            N  6.15.2-rc1 #1 PREEMPT 
[   24.189778] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.189810] Hardware name: linux,dummy-virt (DT)
[   24.189849] Call trace:
[   24.189883]  show_stack+0x20/0x38 (C)
[   24.189948]  dump_stack_lvl+0x8c/0xd0
[   24.190011]  print_report+0x118/0x608
[   24.190063]  kasan_report+0xdc/0x128
[   24.190113]  __asan_report_load1_noabort+0x20/0x30
[   24.190171]  kmem_cache_rcu_uaf+0x388/0x468
[   24.190227]  kunit_try_run_case+0x170/0x3f0
[   24.190286]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.190382]  kthread+0x328/0x630
[   24.191651]  ret_from_fork+0x10/0x20
[   24.191885] 
[   24.191936] Allocated by task 217:
[   24.192035]  kasan_save_stack+0x3c/0x68
[   24.192159]  kasan_save_track+0x20/0x40
[   24.192315]  kasan_save_alloc_info+0x40/0x58
[   24.192424]  __kasan_slab_alloc+0xa8/0xb0
[   24.192759]  kmem_cache_alloc_noprof+0x10c/0x398
[   24.192939]  kmem_cache_rcu_uaf+0x12c/0x468
[   24.193036]  kunit_try_run_case+0x170/0x3f0
[   24.193462]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.193587]  kthread+0x328/0x630
[   24.193687]  ret_from_fork+0x10/0x20
[   24.193879] 
[   24.193958] Freed by task 0:
[   24.194344]  kasan_save_stack+0x3c/0x68
[   24.194470]  kasan_save_track+0x20/0x40
[   24.194685]  kasan_save_free_info+0x4c/0x78
[   24.195012]  __kasan_slab_free+0x6c/0x98
[   24.195115]  slab_free_after_rcu_debug+0xd4/0x2f8
[   24.195196]  rcu_core+0x9f4/0x1e20
[   24.195271]  rcu_core_si+0x18/0x30
[   24.195340]  handle_softirqs+0x374/0xb28
[   24.195436]  __do_softirq+0x1c/0x28
[   24.195520] 
[   24.195564] Last potentially related work creation:
[   24.195618]  kasan_save_stack+0x3c/0x68
[   24.195700]  kasan_record_aux_stack+0xb4/0xc8
[   24.195778]  kmem_cache_free+0x120/0x468
[   24.195856]  kmem_cache_rcu_uaf+0x16c/0x468
[   24.195943]  kunit_try_run_case+0x170/0x3f0
[   24.196035]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.196134]  kthread+0x328/0x630
[   24.196210]  ret_from_fork+0x10/0x20
[   24.196290] 
[   24.196336] The buggy address belongs to the object at fff00000c7774000
[   24.196336]  which belongs to the cache test_cache of size 200
[   24.196536] The buggy address is located 0 bytes inside of
[   24.196536]  freed 200-byte region [fff00000c7774000, fff00000c77740c8)
[   24.196777] 
[   24.196829] The buggy address belongs to the physical page:
[   24.196908] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107774
[   24.197043] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   24.197161] page_type: f5(slab)
[   24.197259] raw: 0bfffe0000000000 fff00000c56b5500 dead000000000122 0000000000000000
[   24.197359] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   24.197491] page dumped because: kasan: bad access detected
[   24.197573] 
[   24.197616] Memory state around the buggy address:
[   24.197741]  fff00000c7773f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.197885]  fff00000c7773f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.198042] >fff00000c7774000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   24.198142]                    ^
[   24.198691]  fff00000c7774080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   24.198945]  fff00000c7774100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.199071] ==================================================================

[   14.722289] ==================================================================
[   14.723116] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   14.723362] Read of size 1 at addr ffff8881033ad000 by task kunit_try_catch/233
[   14.723842] 
[   14.724000] CPU: 0 UID: 0 PID: 233 Comm: kunit_try_catch Tainted: G    B            N  6.15.2-rc1 #1 PREEMPT(voluntary) 
[   14.724063] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.724077] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.724100] Call Trace:
[   14.724117]  <TASK>
[   14.724139]  dump_stack_lvl+0x73/0xb0
[   14.724174]  print_report+0xd1/0x650
[   14.724199]  ? __virt_addr_valid+0x1db/0x2d0
[   14.724225]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   14.724245]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.724268]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   14.724288]  kasan_report+0x141/0x180
[   14.724312]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   14.724336]  __asan_report_load1_noabort+0x18/0x20
[   14.724702]  kmem_cache_rcu_uaf+0x3e3/0x510
[   14.724730]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   14.724751]  ? finish_task_switch.isra.0+0x153/0x700
[   14.724780]  ? __switch_to+0x5d9/0xf60
[   14.724804]  ? dequeue_task_fair+0x166/0x4e0
[   14.724832]  ? __pfx_read_tsc+0x10/0x10
[   14.724871]  ? ktime_get_ts64+0x86/0x230
[   14.724896]  ? irqentry_exit+0x2a/0x60
[   14.724923]  kunit_try_run_case+0x1a5/0x480
[   14.724952]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.724975]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.725001]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.725025]  ? __kthread_parkme+0x82/0x180
[   14.725049]  ? preempt_count_sub+0x50/0x80
[   14.725074]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.725099]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.725124]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.725147]  kthread+0x337/0x6f0
[   14.725164]  ? trace_preempt_on+0x20/0xc0
[   14.725190]  ? __pfx_kthread+0x10/0x10
[   14.725210]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.725231]  ? calculate_sigpending+0x7b/0xa0
[   14.725255]  ? __pfx_kthread+0x10/0x10
[   14.725274]  ret_from_fork+0x41/0x80
[   14.725297]  ? __pfx_kthread+0x10/0x10
[   14.725316]  ret_from_fork_asm+0x1a/0x30
[   14.725348]  </TASK>
[   14.725362] 
[   14.733208] Allocated by task 233:
[   14.733484]  kasan_save_stack+0x45/0x70
[   14.733935]  kasan_save_track+0x18/0x40
[   14.734141]  kasan_save_alloc_info+0x3b/0x50
[   14.734329]  __kasan_slab_alloc+0x91/0xa0
[   14.734493]  kmem_cache_alloc_noprof+0x123/0x3f0
[   14.734742]  kmem_cache_rcu_uaf+0x155/0x510
[   14.735004]  kunit_try_run_case+0x1a5/0x480
[   14.735277]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.735471]  kthread+0x337/0x6f0
[   14.735739]  ret_from_fork+0x41/0x80
[   14.735850]  ret_from_fork_asm+0x1a/0x30
[   14.735962] 
[   14.736020] Freed by task 0:
[   14.736236]  kasan_save_stack+0x45/0x70
[   14.736513]  kasan_save_track+0x18/0x40
[   14.736862]  kasan_save_free_info+0x3f/0x60
[   14.736979]  __kasan_slab_free+0x56/0x70
[   14.737237]  slab_free_after_rcu_debug+0xe4/0x310
[   14.737524]  rcu_core+0x66c/0x1c30
[   14.737979]  rcu_core_si+0x12/0x20
[   14.738221]  handle_softirqs+0x209/0x730
[   14.738340]  __irq_exit_rcu+0xc9/0x110
[   14.738585]  irq_exit_rcu+0x12/0x20
[   14.738973]  sysvec_apic_timer_interrupt+0x81/0x90
[   14.739195]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   14.739423] 
[   14.739556] Last potentially related work creation:
[   14.739797]  kasan_save_stack+0x45/0x70
[   14.739916]  kasan_record_aux_stack+0xb2/0xc0
[   14.740035]  kmem_cache_free+0x131/0x420
[   14.740325]  kmem_cache_rcu_uaf+0x194/0x510
[   14.740740]  kunit_try_run_case+0x1a5/0x480
[   14.740982]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.741182]  kthread+0x337/0x6f0
[   14.741340]  ret_from_fork+0x41/0x80
[   14.741510]  ret_from_fork_asm+0x1a/0x30
[   14.742101] 
[   14.742259] The buggy address belongs to the object at ffff8881033ad000
[   14.742259]  which belongs to the cache test_cache of size 200
[   14.743037] The buggy address is located 0 bytes inside of
[   14.743037]  freed 200-byte region [ffff8881033ad000, ffff8881033ad0c8)
[   14.743829] 
[   14.743902] The buggy address belongs to the physical page:
[   14.744300] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1033ad
[   14.744683] flags: 0x200000000000000(node=0|zone=2)
[   14.744968] page_type: f5(slab)
[   14.745199] raw: 0200000000000000 ffff8881033a9140 dead000000000122 0000000000000000
[   14.745577] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   14.746145] page dumped because: kasan: bad access detected
[   14.746464] 
[   14.746555] Memory state around the buggy address:
[   14.746809]  ffff8881033acf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.747075]  ffff8881033acf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.747267] >ffff8881033ad000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   14.747731]                    ^
[   14.747899]  ffff8881033ad080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   14.748204]  ffff8881033ad100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.748543] ==================================================================