Hay
Date
July 23, 2025, 3:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   31.885314] ==================================================================
[   31.885419] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   31.885506] Read of size 1 at addr fff00000c9a5a000 by task kunit_try_catch/246
[   31.885557] 
[   31.885602] CPU: 0 UID: 0 PID: 246 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250723 #1 PREEMPT 
[   31.885697] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   31.885730] Hardware name: linux,dummy-virt (DT)
[   31.885765] Call trace:
[   31.885791]  show_stack+0x20/0x38 (C)
[   31.885844]  dump_stack_lvl+0x8c/0xd0
[   31.885893]  print_report+0x118/0x5e8
[   31.885955]  kasan_report+0xdc/0x128
[   31.885998]  __asan_report_load1_noabort+0x20/0x30
[   31.886047]  kmem_cache_rcu_uaf+0x388/0x468
[   31.886095]  kunit_try_run_case+0x170/0x3f0
[   31.886146]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.886199]  kthread+0x328/0x630
[   31.886243]  ret_from_fork+0x10/0x20
[   31.886293] 
[   31.886311] Allocated by task 246:
[   31.886342]  kasan_save_stack+0x3c/0x68
[   31.886400]  kasan_save_track+0x20/0x40
[   31.886436]  kasan_save_alloc_info+0x40/0x58
[   31.886473]  __kasan_slab_alloc+0xa8/0xb0
[   31.886509]  kmem_cache_alloc_noprof+0x10c/0x398
[   31.886555]  kmem_cache_rcu_uaf+0x12c/0x468
[   31.886594]  kunit_try_run_case+0x170/0x3f0
[   31.886631]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.886676]  kthread+0x328/0x630
[   31.886709]  ret_from_fork+0x10/0x20
[   31.886747] 
[   31.886764] Freed by task 0:
[   31.886789]  kasan_save_stack+0x3c/0x68
[   31.886823]  kasan_save_track+0x20/0x40
[   31.886858]  kasan_save_free_info+0x4c/0x78
[   31.886894]  __kasan_slab_free+0x6c/0x98
[   31.886939]  slab_free_after_rcu_debug+0xd4/0x2f8
[   31.886981]  rcu_core+0x9f4/0x1e58
[   31.887019]  rcu_core_si+0x18/0x30
[   31.887054]  handle_softirqs+0x374/0xb28
[   31.887091]  __do_softirq+0x1c/0x28
[   31.887125] 
[   31.887144] Last potentially related work creation:
[   31.887169]  kasan_save_stack+0x3c/0x68
[   31.887205]  kasan_record_aux_stack+0xb4/0xc8
[   31.887243]  kmem_cache_free+0x120/0x468
[   31.887282]  kmem_cache_rcu_uaf+0x16c/0x468
[   31.887320]  kunit_try_run_case+0x170/0x3f0
[   31.887359]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.887402]  kthread+0x328/0x630
[   31.887435]  ret_from_fork+0x10/0x20
[   31.887469] 
[   31.887487] The buggy address belongs to the object at fff00000c9a5a000
[   31.887487]  which belongs to the cache test_cache of size 200
[   31.887546] The buggy address is located 0 bytes inside of
[   31.887546]  freed 200-byte region [fff00000c9a5a000, fff00000c9a5a0c8)
[   31.887607] 
[   31.887629] The buggy address belongs to the physical page:
[   31.887669] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109a5a
[   31.887727] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.887777] page_type: f5(slab)
[   31.887819] raw: 0bfffe0000000000 fff00000c5c248c0 dead000000000122 0000000000000000
[   31.887868] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   31.887917] page dumped because: kasan: bad access detected
[   31.887948] 
[   31.887965] Memory state around the buggy address:
[   31.887998]  fff00000c9a59f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   31.888042]  fff00000c9a59f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   31.888085] >fff00000c9a5a000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   31.888123]                    ^
[   31.888151]  fff00000c9a5a080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   31.888193]  fff00000c9a5a100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.888233] ==================================================================

[   26.015538] ==================================================================
[   26.016038] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   26.016614] Read of size 1 at addr ffff8881060a0000 by task kunit_try_catch/262
[   26.016881] 
[   26.016971] CPU: 1 UID: 0 PID: 262 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250723 #1 PREEMPT(voluntary) 
[   26.017026] Tainted: [B]=BAD_PAGE, [N]=TEST
[   26.017038] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   26.017062] Call Trace:
[   26.017076]  <TASK>
[   26.017096]  dump_stack_lvl+0x73/0xb0
[   26.017128]  print_report+0xd1/0x640
[   26.017162]  ? __virt_addr_valid+0x1db/0x2d0
[   26.017213]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   26.017237]  ? kasan_complete_mode_report_info+0x64/0x200
[   26.017264]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   26.017303]  kasan_report+0x141/0x180
[   26.017325]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   26.017367]  __asan_report_load1_noabort+0x18/0x20
[   26.017417]  kmem_cache_rcu_uaf+0x3e3/0x510
[   26.017441]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   26.017464]  ? finish_task_switch.isra.0+0x153/0x700
[   26.017488]  ? __switch_to+0x47/0xf80
[   26.017519]  ? __pfx_read_tsc+0x10/0x10
[   26.017541]  ? ktime_get_ts64+0x86/0x230
[   26.017569]  kunit_try_run_case+0x1a5/0x480
[   26.017596]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.017619]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   26.017646]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   26.017670]  ? __kthread_parkme+0x82/0x180
[   26.017692]  ? preempt_count_sub+0x50/0x80
[   26.017715]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.017739]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.017763]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   26.017786]  kthread+0x337/0x6f0
[   26.017807]  ? trace_preempt_on+0x20/0xc0
[   26.017832]  ? __pfx_kthread+0x10/0x10
[   26.017853]  ? _raw_spin_unlock_irq+0x47/0x80
[   26.017876]  ? calculate_sigpending+0x7b/0xa0
[   26.017901]  ? __pfx_kthread+0x10/0x10
[   26.017924]  ret_from_fork+0x116/0x1d0
[   26.017944]  ? __pfx_kthread+0x10/0x10
[   26.017983]  ret_from_fork_asm+0x1a/0x30
[   26.018016]  </TASK>
[   26.018028] 
[   26.027866] Allocated by task 262:
[   26.027995]  kasan_save_stack+0x45/0x70
[   26.028323]  kasan_save_track+0x18/0x40
[   26.028609]  kasan_save_alloc_info+0x3b/0x50
[   26.028778]  __kasan_slab_alloc+0x91/0xa0
[   26.028913]  kmem_cache_alloc_noprof+0x123/0x3f0
[   26.029267]  kmem_cache_rcu_uaf+0x155/0x510
[   26.029503]  kunit_try_run_case+0x1a5/0x480
[   26.029849]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.030557]  kthread+0x337/0x6f0
[   26.030749]  ret_from_fork+0x116/0x1d0
[   26.030917]  ret_from_fork_asm+0x1a/0x30
[   26.031594] 
[   26.031689] Freed by task 0:
[   26.031798]  kasan_save_stack+0x45/0x70
[   26.031954]  kasan_save_track+0x18/0x40
[   26.032275]  kasan_save_free_info+0x3f/0x60
[   26.032856]  __kasan_slab_free+0x56/0x70
[   26.033031]  slab_free_after_rcu_debug+0xe4/0x310
[   26.033344]  rcu_core+0x66f/0x1c40
[   26.033611]  rcu_core_si+0x12/0x20
[   26.033774]  handle_softirqs+0x209/0x730
[   26.033939]  __irq_exit_rcu+0xc9/0x110
[   26.034354]  irq_exit_rcu+0x12/0x20
[   26.034746]  sysvec_apic_timer_interrupt+0x81/0x90
[   26.034924]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   26.035335] 
[   26.035695] Last potentially related work creation:
[   26.035918]  kasan_save_stack+0x45/0x70
[   26.036088]  kasan_record_aux_stack+0xb2/0xc0
[   26.036293]  kmem_cache_free+0x131/0x420
[   26.036507]  kmem_cache_rcu_uaf+0x194/0x510
[   26.036719]  kunit_try_run_case+0x1a5/0x480
[   26.036912]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.037630]  kthread+0x337/0x6f0
[   26.037773]  ret_from_fork+0x116/0x1d0
[   26.038114]  ret_from_fork_asm+0x1a/0x30
[   26.038585] 
[   26.038681] The buggy address belongs to the object at ffff8881060a0000
[   26.038681]  which belongs to the cache test_cache of size 200
[   26.039474] The buggy address is located 0 bytes inside of
[   26.039474]  freed 200-byte region [ffff8881060a0000, ffff8881060a00c8)
[   26.039991] 
[   26.040077] The buggy address belongs to the physical page:
[   26.040326] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1060a0
[   26.040678] flags: 0x200000000000000(node=0|zone=2)
[   26.040896] page_type: f5(slab)
[   26.041524] raw: 0200000000000000 ffff888101242a00 dead000000000122 0000000000000000
[   26.041808] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   26.042394] page dumped because: kasan: bad access detected
[   26.042735] 
[   26.042834] Memory state around the buggy address:
[   26.043027]  ffff88810609ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.043542]  ffff88810609ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.043854] >ffff8881060a0000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   26.044357]                    ^
[   26.044547]  ffff8881060a0080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   26.045056]  ffff8881060a0100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.045569] ==================================================================