Hay
Date
July 16, 2025, 12:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   31.928334] ==================================================================
[   31.929013] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   31.929245] Read of size 1 at addr fff00000c9b0e000 by task kunit_try_catch/244
[   31.930286] 
[   31.930585] CPU: 0 UID: 0 PID: 244 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250716 #1 PREEMPT 
[   31.931570] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.931619] Hardware name: linux,dummy-virt (DT)
[   31.931664] Call trace:
[   31.931690]  show_stack+0x20/0x38 (C)
[   31.931746]  dump_stack_lvl+0x8c/0xd0
[   31.931800]  print_report+0x118/0x5d0
[   31.931843]  kasan_report+0xdc/0x128
[   31.931885]  __asan_report_load1_noabort+0x20/0x30
[   31.931935]  kmem_cache_rcu_uaf+0x388/0x468
[   31.931984]  kunit_try_run_case+0x170/0x3f0
[   31.932036]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.932090]  kthread+0x328/0x630
[   31.934603]  ret_from_fork+0x10/0x20
[   31.934970] 
[   31.934992] Allocated by task 244:
[   31.935716]  kasan_save_stack+0x3c/0x68
[   31.936198]  kasan_save_track+0x20/0x40
[   31.937011]  kasan_save_alloc_info+0x40/0x58
[   31.937061]  __kasan_slab_alloc+0xa8/0xb0
[   31.937097]  kmem_cache_alloc_noprof+0x10c/0x398
[   31.937722]  kmem_cache_rcu_uaf+0x12c/0x468
[   31.937775]  kunit_try_run_case+0x170/0x3f0
[   31.938391]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.938914]  kthread+0x328/0x630
[   31.939393]  ret_from_fork+0x10/0x20
[   31.939663] 
[   31.939683] Freed by task 0:
[   31.939714]  kasan_save_stack+0x3c/0x68
[   31.939954]  kasan_save_track+0x20/0x40
[   31.939996]  kasan_save_free_info+0x4c/0x78
[   31.940800]  __kasan_slab_free+0x6c/0x98
[   31.940923]  slab_free_after_rcu_debug+0xd4/0x2f8
[   31.941988]  rcu_core+0x9f4/0x1e20
[   31.942399]  rcu_core_si+0x18/0x30
[   31.942792]  handle_softirqs+0x374/0xb28
[   31.943520]  __do_softirq+0x1c/0x28
[   31.943832] 
[   31.943858] Last potentially related work creation:
[   31.943898]  kasan_save_stack+0x3c/0x68
[   31.943939]  kasan_record_aux_stack+0xb4/0xc8
[   31.944759]  kmem_cache_free+0x120/0x468
[   31.945050]  kmem_cache_rcu_uaf+0x16c/0x468
[   31.945584]  kunit_try_run_case+0x170/0x3f0
[   31.946059]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.946460]  kthread+0x328/0x630
[   31.946819]  ret_from_fork+0x10/0x20
[   31.946925] 
[   31.946945] The buggy address belongs to the object at fff00000c9b0e000
[   31.946945]  which belongs to the cache test_cache of size 200
[   31.947307] The buggy address is located 0 bytes inside of
[   31.947307]  freed 200-byte region [fff00000c9b0e000, fff00000c9b0e0c8)
[   31.947405] 
[   31.947434] The buggy address belongs to the physical page:
[   31.947480] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109b0e
[   31.948534] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.948599] page_type: f5(slab)
[   31.948772] raw: 0bfffe0000000000 fff00000c56a1b40 dead000000000122 0000000000000000
[   31.949129] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   31.949339] page dumped because: kasan: bad access detected
[   31.949758] 
[   31.949785] Memory state around the buggy address:
[   31.949848]  fff00000c9b0df00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   31.950196]  fff00000c9b0df80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   31.950453] >fff00000c9b0e000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   31.950738]                    ^
[   31.950810]  fff00000c9b0e080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   31.950855]  fff00000c9b0e100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.951349] ==================================================================

[   24.092059] ==================================================================
[   24.092581] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   24.093004] Read of size 1 at addr ffff88810608a000 by task kunit_try_catch/262
[   24.093691] 
[   24.093800] CPU: 1 UID: 0 PID: 262 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250716 #1 PREEMPT(voluntary) 
[   24.093858] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.093870] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   24.093893] Call Trace:
[   24.093908]  <TASK>
[   24.093927]  dump_stack_lvl+0x73/0xb0
[   24.093962]  print_report+0xd1/0x610
[   24.093986]  ? __virt_addr_valid+0x1db/0x2d0
[   24.094297]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   24.094322]  ? kasan_complete_mode_report_info+0x64/0x200
[   24.094349]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   24.094372]  kasan_report+0x141/0x180
[   24.094394]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   24.094422]  __asan_report_load1_noabort+0x18/0x20
[   24.094446]  kmem_cache_rcu_uaf+0x3e3/0x510
[   24.094472]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   24.094495]  ? finish_task_switch.isra.0+0x153/0x700
[   24.094518]  ? __switch_to+0x47/0xf80
[   24.094548]  ? __pfx_read_tsc+0x10/0x10
[   24.094585]  ? ktime_get_ts64+0x86/0x230
[   24.094611]  kunit_try_run_case+0x1a5/0x480
[   24.094637]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.094659]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   24.094684]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   24.094706]  ? __kthread_parkme+0x82/0x180
[   24.094728]  ? preempt_count_sub+0x50/0x80
[   24.094749]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.094772]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.094800]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   24.094826]  kthread+0x337/0x6f0
[   24.094845]  ? trace_preempt_on+0x20/0xc0
[   24.094898]  ? __pfx_kthread+0x10/0x10
[   24.094918]  ? _raw_spin_unlock_irq+0x47/0x80
[   24.094939]  ? calculate_sigpending+0x7b/0xa0
[   24.094965]  ? __pfx_kthread+0x10/0x10
[   24.094986]  ret_from_fork+0x116/0x1d0
[   24.095006]  ? __pfx_kthread+0x10/0x10
[   24.095026]  ret_from_fork_asm+0x1a/0x30
[   24.095059]  </TASK>
[   24.095071] 
[   24.104844] Allocated by task 262:
[   24.105355]  kasan_save_stack+0x45/0x70
[   24.105536]  kasan_save_track+0x18/0x40
[   24.105761]  kasan_save_alloc_info+0x3b/0x50
[   24.106152]  __kasan_slab_alloc+0x91/0xa0
[   24.106368]  kmem_cache_alloc_noprof+0x123/0x3f0
[   24.106571]  kmem_cache_rcu_uaf+0x155/0x510
[   24.106782]  kunit_try_run_case+0x1a5/0x480
[   24.107266]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.107499]  kthread+0x337/0x6f0
[   24.107783]  ret_from_fork+0x116/0x1d0
[   24.107977]  ret_from_fork_asm+0x1a/0x30
[   24.108477] 
[   24.108564] Freed by task 0:
[   24.108733]  kasan_save_stack+0x45/0x70
[   24.108907]  kasan_save_track+0x18/0x40
[   24.109390]  kasan_save_free_info+0x3f/0x60
[   24.109579]  __kasan_slab_free+0x56/0x70
[   24.109777]  slab_free_after_rcu_debug+0xe4/0x310
[   24.109981]  rcu_core+0x66f/0x1c40
[   24.110379]  rcu_core_si+0x12/0x20
[   24.110534]  handle_softirqs+0x209/0x730
[   24.110867]  __irq_exit_rcu+0xc9/0x110
[   24.111172]  irq_exit_rcu+0x12/0x20
[   24.111375]  sysvec_apic_timer_interrupt+0x81/0x90
[   24.111573]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   24.111956] 
[   24.112054] Last potentially related work creation:
[   24.112245]  kasan_save_stack+0x45/0x70
[   24.112435]  kasan_record_aux_stack+0xb2/0xc0
[   24.113046]  kmem_cache_free+0x131/0x420
[   24.113203]  kmem_cache_rcu_uaf+0x194/0x510
[   24.113584]  kunit_try_run_case+0x1a5/0x480
[   24.113767]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.114184]  kthread+0x337/0x6f0
[   24.114358]  ret_from_fork+0x116/0x1d0
[   24.114703]  ret_from_fork_asm+0x1a/0x30
[   24.115004] 
[   24.115089] The buggy address belongs to the object at ffff88810608a000
[   24.115089]  which belongs to the cache test_cache of size 200
[   24.115845] The buggy address is located 0 bytes inside of
[   24.115845]  freed 200-byte region [ffff88810608a000, ffff88810608a0c8)
[   24.116490] 
[   24.116733] The buggy address belongs to the physical page:
[   24.116951] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10608a
[   24.117327] flags: 0x200000000000000(node=0|zone=2)
[   24.117575] page_type: f5(slab)
[   24.117732] raw: 0200000000000000 ffff888106085280 dead000000000122 0000000000000000
[   24.118483] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   24.118983] page dumped because: kasan: bad access detected
[   24.119249] 
[   24.119352] Memory state around the buggy address:
[   24.119768]  ffff888106089f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.120241]  ffff888106089f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.120637] >ffff88810608a000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   24.120918]                    ^
[   24.121292]  ffff88810608a080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   24.121721]  ffff88810608a100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.122159] ==================================================================