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

Environment
qemu-arm64
qemu-x86_64

[   17.772905] ==================================================================
[   17.773058] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   17.773156] Read of size 1 at addr fff00000c6cd9000 by task kunit_try_catch/213
[   17.773571] 
[   17.773674] CPU: 1 UID: 0 PID: 213 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   17.773825] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.773857] Hardware name: linux,dummy-virt (DT)
[   17.773897] Call trace:
[   17.773923]  show_stack+0x20/0x38 (C)
[   17.773992]  dump_stack_lvl+0x8c/0xd0
[   17.774053]  print_report+0x118/0x608
[   17.774101]  kasan_report+0xdc/0x128
[   17.774158]  __asan_report_load1_noabort+0x20/0x30
[   17.774209]  kmem_cache_rcu_uaf+0x388/0x468
[   17.774254]  kunit_try_run_case+0x170/0x3f0
[   17.774304]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.774358]  kthread+0x328/0x630
[   17.774410]  ret_from_fork+0x10/0x20
[   17.774460] 
[   17.774478] Allocated by task 213:
[   17.774509]  kasan_save_stack+0x3c/0x68
[   17.774552]  kasan_save_track+0x20/0x40
[   17.774590]  kasan_save_alloc_info+0x40/0x58
[   17.774636]  __kasan_slab_alloc+0xa8/0xb0
[   17.774675]  kmem_cache_alloc_noprof+0x10c/0x398
[   17.774717]  kmem_cache_rcu_uaf+0x12c/0x468
[   17.774755]  kunit_try_run_case+0x170/0x3f0
[   17.774790]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.774838]  kthread+0x328/0x630
[   17.774869]  ret_from_fork+0x10/0x20
[   17.774905] 
[   17.774931] Freed by task 0:
[   17.774958]  kasan_save_stack+0x3c/0x68
[   17.774996]  kasan_save_track+0x20/0x40
[   17.775039]  kasan_save_free_info+0x4c/0x78
[   17.775091]  __kasan_slab_free+0x6c/0x98
[   17.775434]  slab_free_after_rcu_debug+0xd4/0x2f8
[   17.775813]  rcu_core+0x9f4/0x1e20
[   17.775884]  rcu_core_si+0x18/0x30
[   17.775943]  handle_softirqs+0x374/0xb28
[   17.776008]  __do_softirq+0x1c/0x28
[   17.776069] 
[   17.776273] Last potentially related work creation:
[   17.776307]  kasan_save_stack+0x3c/0x68
[   17.776350]  kasan_record_aux_stack+0xb4/0xc8
[   17.776399]  kmem_cache_free+0x120/0x468
[   17.776435]  kmem_cache_rcu_uaf+0x16c/0x468
[   17.776690]  kunit_try_run_case+0x170/0x3f0
[   17.776775]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.776831]  kthread+0x328/0x630
[   17.777029]  ret_from_fork+0x10/0x20
[   17.777202] 
[   17.777309] The buggy address belongs to the object at fff00000c6cd9000
[   17.777309]  which belongs to the cache test_cache of size 200
[   17.777372] The buggy address is located 0 bytes inside of
[   17.777372]  freed 200-byte region [fff00000c6cd9000, fff00000c6cd90c8)
[   17.777879] 
[   17.778069] The buggy address belongs to the physical page:
[   17.778256] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106cd9
[   17.778344] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.778531] page_type: f5(slab)
[   17.778719] raw: 0bfffe0000000000 fff00000c56b2c80 dead000000000122 0000000000000000
[   17.778852] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   17.778954] page dumped because: kasan: bad access detected
[   17.779135] 
[   17.779158] Memory state around the buggy address:
[   17.779343]  fff00000c6cd8f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.779582]  fff00000c6cd8f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.779652] >fff00000c6cd9000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   17.779733]                    ^
[   17.779849]  fff00000c6cd9080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   17.780051]  fff00000c6cd9100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.780092] ==================================================================

[   13.333400] ==================================================================
[   13.333883] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   13.334233] Read of size 1 at addr ffff8881031f9000 by task kunit_try_catch/230
[   13.334579] 
[   13.334730] CPU: 0 UID: 0 PID: 230 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   13.334775] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.334787] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.334808] Call Trace:
[   13.334821]  <TASK>
[   13.334838]  dump_stack_lvl+0x73/0xb0
[   13.334870]  print_report+0xd1/0x650
[   13.334891]  ? __virt_addr_valid+0x1db/0x2d0
[   13.334916]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   13.334939]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.334961]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   13.334984]  kasan_report+0x141/0x180
[   13.335006]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   13.335033]  __asan_report_load1_noabort+0x18/0x20
[   13.335070]  kmem_cache_rcu_uaf+0x3e3/0x510
[   13.335094]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   13.335117]  ? finish_task_switch.isra.0+0x153/0x700
[   13.335140]  ? __switch_to+0x47/0xf50
[   13.335168]  ? __pfx_read_tsc+0x10/0x10
[   13.335190]  ? ktime_get_ts64+0x86/0x230
[   13.335215]  kunit_try_run_case+0x1a5/0x480
[   13.335239]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.335262]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.335286]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.335309]  ? __kthread_parkme+0x82/0x180
[   13.335330]  ? preempt_count_sub+0x50/0x80
[   13.335352]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.335376]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.335400]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.335424]  kthread+0x337/0x6f0
[   13.335443]  ? trace_preempt_on+0x20/0xc0
[   13.335467]  ? __pfx_kthread+0x10/0x10
[   13.335487]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.335508]  ? calculate_sigpending+0x7b/0xa0
[   13.335532]  ? __pfx_kthread+0x10/0x10
[   13.335552]  ret_from_fork+0x116/0x1d0
[   13.335570]  ? __pfx_kthread+0x10/0x10
[   13.335590]  ret_from_fork_asm+0x1a/0x30
[   13.335621]  </TASK>
[   13.335631] 
[   13.343922] Allocated by task 230:
[   13.344179]  kasan_save_stack+0x45/0x70
[   13.344377]  kasan_save_track+0x18/0x40
[   13.344556]  kasan_save_alloc_info+0x3b/0x50
[   13.344760]  __kasan_slab_alloc+0x91/0xa0
[   13.344945]  kmem_cache_alloc_noprof+0x123/0x3f0
[   13.345231]  kmem_cache_rcu_uaf+0x155/0x510
[   13.345432]  kunit_try_run_case+0x1a5/0x480
[   13.345622]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.345865]  kthread+0x337/0x6f0
[   13.346020]  ret_from_fork+0x116/0x1d0
[   13.347076]  ret_from_fork_asm+0x1a/0x30
[   13.347266] 
[   13.347445] Freed by task 0:
[   13.347597]  kasan_save_stack+0x45/0x70
[   13.347802]  kasan_save_track+0x18/0x40
[   13.347970]  kasan_save_free_info+0x3f/0x60
[   13.348198]  __kasan_slab_free+0x56/0x70
[   13.348400]  slab_free_after_rcu_debug+0xe4/0x310
[   13.348600]  rcu_core+0x66f/0x1c40
[   13.348785]  rcu_core_si+0x12/0x20
[   13.348957]  handle_softirqs+0x209/0x730
[   13.349241]  __irq_exit_rcu+0xc9/0x110
[   13.349390]  irq_exit_rcu+0x12/0x20
[   13.349515]  sysvec_apic_timer_interrupt+0x81/0x90
[   13.349690]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   13.349944] 
[   13.350062] Last potentially related work creation:
[   13.350285]  kasan_save_stack+0x45/0x70
[   13.350422]  kasan_record_aux_stack+0xb2/0xc0
[   13.350570]  kmem_cache_free+0x131/0x420
[   13.350771]  kmem_cache_rcu_uaf+0x194/0x510
[   13.350983]  kunit_try_run_case+0x1a5/0x480
[   13.351334]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.351767]  kthread+0x337/0x6f0
[   13.351971]  ret_from_fork+0x116/0x1d0
[   13.352146]  ret_from_fork_asm+0x1a/0x30
[   13.352453] 
[   13.352547] The buggy address belongs to the object at ffff8881031f9000
[   13.352547]  which belongs to the cache test_cache of size 200
[   13.353057] The buggy address is located 0 bytes inside of
[   13.353057]  freed 200-byte region [ffff8881031f9000, ffff8881031f90c8)
[   13.353731] 
[   13.353808] The buggy address belongs to the physical page:
[   13.354057] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1031f9
[   13.354423] flags: 0x200000000000000(node=0|zone=2)
[   13.355072] page_type: f5(slab)
[   13.355599] raw: 0200000000000000 ffff8881031f2280 dead000000000122 0000000000000000
[   13.356024] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   13.356459] page dumped because: kasan: bad access detected
[   13.356863] 
[   13.356967] Memory state around the buggy address:
[   13.357416]  ffff8881031f8f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.357821]  ffff8881031f8f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.358067] >ffff8881031f9000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   13.358677]                    ^
[   13.358868]  ffff8881031f9080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   13.359336]  ffff8881031f9100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.359648] ==================================================================