Hay
Date
July 22, 2025, 5:13 a.m.

Environment
qemu-arm64
qemu-x86_64

[   31.366773] ==================================================================
[   31.366887] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   31.366975] Read of size 1 at addr fff00000c9234000 by task kunit_try_catch/244
[   31.367037] 
[   31.367091] CPU: 1 UID: 0 PID: 244 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250722 #1 PREEMPT 
[   31.367185] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   31.367214] Hardware name: linux,dummy-virt (DT)
[   31.367258] Call trace:
[   31.367285]  show_stack+0x20/0x38 (C)
[   31.367339]  dump_stack_lvl+0x8c/0xd0
[   31.367390]  print_report+0x118/0x5e8
[   31.367434]  kasan_report+0xdc/0x128
[   31.367718]  __asan_report_load1_noabort+0x20/0x30
[   31.368158]  kmem_cache_rcu_uaf+0x388/0x468
[   31.368247]  kunit_try_run_case+0x170/0x3f0
[   31.369107]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.369169]  kthread+0x328/0x630
[   31.369215]  ret_from_fork+0x10/0x20
[   31.371840] 
[   31.371869] Allocated by task 244:
[   31.371903]  kasan_save_stack+0x3c/0x68
[   31.371952]  kasan_save_track+0x20/0x40
[   31.371987]  kasan_save_alloc_info+0x40/0x58
[   31.372026]  __kasan_slab_alloc+0xa8/0xb0
[   31.372060]  kmem_cache_alloc_noprof+0x10c/0x398
[   31.372102]  kmem_cache_rcu_uaf+0x12c/0x468
[   31.372141]  kunit_try_run_case+0x170/0x3f0
[   31.372178]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.372221]  kthread+0x328/0x630
[   31.372254]  ret_from_fork+0x10/0x20
[   31.372291] 
[   31.372309] Freed by task 0:
[   31.372337]  kasan_save_stack+0x3c/0x68
[   31.372373]  kasan_save_track+0x20/0x40
[   31.372407]  kasan_save_free_info+0x4c/0x78
[   31.372445]  __kasan_slab_free+0x6c/0x98
[   31.372478]  slab_free_after_rcu_debug+0xd4/0x2f8
[   31.372520]  rcu_core+0x9f4/0x1e58
[   31.372558]  rcu_core_si+0x18/0x30
[   31.372593]  handle_softirqs+0x374/0xb28
[   31.372633]  __do_softirq+0x1c/0x28
[   31.372667] 
[   31.372686] Last potentially related work creation:
[   31.372712]  kasan_save_stack+0x3c/0x68
[   31.372748]  kasan_record_aux_stack+0xb4/0xc8
[   31.372786]  kmem_cache_free+0x120/0x468
[   31.372834]  kmem_cache_rcu_uaf+0x16c/0x468
[   31.372883]  kunit_try_run_case+0x170/0x3f0
[   31.372996]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.373040]  kthread+0x328/0x630
[   31.373072]  ret_from_fork+0x10/0x20
[   31.373301] 
[   31.373322] The buggy address belongs to the object at fff00000c9234000
[   31.373322]  which belongs to the cache test_cache of size 200
[   31.373384] The buggy address is located 0 bytes inside of
[   31.373384]  freed 200-byte region [fff00000c9234000, fff00000c92340c8)
[   31.373444] 
[   31.373466] The buggy address belongs to the physical page:
[   31.373595] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109234
[   31.373750] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.373903] page_type: f5(slab)
[   31.374003] raw: 0bfffe0000000000 fff00000c3f36b40 dead000000000122 0000000000000000
[   31.374055] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   31.374141] page dumped because: kasan: bad access detected
[   31.374295] 
[   31.374319] Memory state around the buggy address:
[   31.374353]  fff00000c9233f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   31.374690]  fff00000c9233f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   31.374735] >fff00000c9234000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   31.374773]                    ^
[   31.374801]  fff00000c9234080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   31.374852]  fff00000c9234100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.374931] ==================================================================

[   25.891809] ==================================================================
[   25.892313] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   25.892661] Read of size 1 at addr ffff8881058a0000 by task kunit_try_catch/261
[   25.892964] 
[   25.893057] CPU: 1 UID: 0 PID: 261 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250722 #1 PREEMPT(voluntary) 
[   25.893109] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.893122] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.893146] Call Trace:
[   25.893160]  <TASK>
[   25.893177]  dump_stack_lvl+0x73/0xb0
[   25.893209]  print_report+0xd1/0x640
[   25.893232]  ? __virt_addr_valid+0x1db/0x2d0
[   25.893258]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   25.893281]  ? kasan_complete_mode_report_info+0x64/0x200
[   25.893307]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   25.893331]  kasan_report+0x141/0x180
[   25.893353]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   25.893381]  __asan_report_load1_noabort+0x18/0x20
[   25.893406]  kmem_cache_rcu_uaf+0x3e3/0x510
[   25.893429]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   25.893452]  ? finish_task_switch.isra.0+0x153/0x700
[   25.893475]  ? __switch_to+0x47/0xf80
[   25.893505]  ? __pfx_read_tsc+0x10/0x10
[   25.893527]  ? ktime_get_ts64+0x86/0x230
[   25.893554]  kunit_try_run_case+0x1a5/0x480
[   25.893580]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.893603]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.893630]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.893655]  ? __kthread_parkme+0x82/0x180
[   25.893676]  ? preempt_count_sub+0x50/0x80
[   25.893699]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.893723]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.893747]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.893771]  kthread+0x337/0x6f0
[   25.893791]  ? trace_preempt_on+0x20/0xc0
[   25.893817]  ? __pfx_kthread+0x10/0x10
[   25.893880]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.893906]  ? calculate_sigpending+0x7b/0xa0
[   25.893931]  ? __pfx_kthread+0x10/0x10
[   25.893978]  ret_from_fork+0x116/0x1d0
[   25.893999]  ? __pfx_kthread+0x10/0x10
[   25.894020]  ret_from_fork_asm+0x1a/0x30
[   25.894052]  </TASK>
[   25.894064] 
[   25.902925] Allocated by task 261:
[   25.903328]  kasan_save_stack+0x45/0x70
[   25.903606]  kasan_save_track+0x18/0x40
[   25.903753]  kasan_save_alloc_info+0x3b/0x50
[   25.903969]  __kasan_slab_alloc+0x91/0xa0
[   25.904170]  kmem_cache_alloc_noprof+0x123/0x3f0
[   25.904548]  kmem_cache_rcu_uaf+0x155/0x510
[   25.904755]  kunit_try_run_case+0x1a5/0x480
[   25.904989]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.905219]  kthread+0x337/0x6f0
[   25.905388]  ret_from_fork+0x116/0x1d0
[   25.905599]  ret_from_fork_asm+0x1a/0x30
[   25.905742] 
[   25.905810] Freed by task 0:
[   25.905954]  kasan_save_stack+0x45/0x70
[   25.906146]  kasan_save_track+0x18/0x40
[   25.906490]  kasan_save_free_info+0x3f/0x60
[   25.906673]  __kasan_slab_free+0x56/0x70
[   25.906813]  slab_free_after_rcu_debug+0xe4/0x310
[   25.907048]  rcu_core+0x66f/0x1c40
[   25.907435]  rcu_core_si+0x12/0x20
[   25.907723]  handle_softirqs+0x209/0x730
[   25.907895]  __irq_exit_rcu+0xc9/0x110
[   25.908106]  irq_exit_rcu+0x12/0x20
[   25.908341]  sysvec_apic_timer_interrupt+0x81/0x90
[   25.908599]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   25.908915] 
[   25.909013] Last potentially related work creation:
[   25.909260]  kasan_save_stack+0x45/0x70
[   25.909447]  kasan_record_aux_stack+0xb2/0xc0
[   25.909647]  kmem_cache_free+0x131/0x420
[   25.909787]  kmem_cache_rcu_uaf+0x194/0x510
[   25.910024]  kunit_try_run_case+0x1a5/0x480
[   25.910229]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.910562]  kthread+0x337/0x6f0
[   25.910824]  ret_from_fork+0x116/0x1d0
[   25.911027]  ret_from_fork_asm+0x1a/0x30
[   25.911723] 
[   25.911827] The buggy address belongs to the object at ffff8881058a0000
[   25.911827]  which belongs to the cache test_cache of size 200
[   25.912808] The buggy address is located 0 bytes inside of
[   25.912808]  freed 200-byte region [ffff8881058a0000, ffff8881058a00c8)
[   25.913689] 
[   25.913814] The buggy address belongs to the physical page:
[   25.914057] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1058a0
[   25.915158] flags: 0x200000000000000(node=0|zone=2)
[   25.915560] page_type: f5(slab)
[   25.915734] raw: 0200000000000000 ffff888101d72640 dead000000000122 0000000000000000
[   25.916058] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   25.916857] page dumped because: kasan: bad access detected
[   25.917320] 
[   25.917413] Memory state around the buggy address:
[   25.917905]  ffff88810589ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   25.918454]  ffff88810589ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   25.919156] >ffff8881058a0000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   25.919725]                    ^
[   25.919998]  ffff8881058a0080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   25.920687]  ffff8881058a0100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.921004] ==================================================================