Hay
Date
June 16, 2025, 7:07 a.m.

Environment
qemu-arm64
qemu-x86_64

[   21.022067] ==================================================================
[   21.022369] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   21.022555] Read of size 1 at addr fff00000c7736000 by task kunit_try_catch/222
[   21.022667] 
[   21.022767] CPU: 0 UID: 0 PID: 222 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250616 #1 PREEMPT 
[   21.022986] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.023105] Hardware name: linux,dummy-virt (DT)
[   21.023257] Call trace:
[   21.023391]  show_stack+0x20/0x38 (C)
[   21.023577]  dump_stack_lvl+0x8c/0xd0
[   21.023735]  print_report+0x118/0x608
[   21.023946]  kasan_report+0xdc/0x128
[   21.024133]  __asan_report_load1_noabort+0x20/0x30
[   21.024332]  kmem_cache_rcu_uaf+0x388/0x468
[   21.024549]  kunit_try_run_case+0x170/0x3f0
[   21.024727]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.024931]  kthread+0x328/0x630
[   21.025035]  ret_from_fork+0x10/0x20
[   21.025219] 
[   21.025306] Allocated by task 222:
[   21.025385]  kasan_save_stack+0x3c/0x68
[   21.025499]  kasan_save_track+0x20/0x40
[   21.026017]  kasan_save_alloc_info+0x40/0x58
[   21.026112]  __kasan_slab_alloc+0xa8/0xb0
[   21.026219]  kmem_cache_alloc_noprof+0x10c/0x398
[   21.026328]  kmem_cache_rcu_uaf+0x12c/0x468
[   21.026430]  kunit_try_run_case+0x170/0x3f0
[   21.026534]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.026648]  kthread+0x328/0x630
[   21.026953]  ret_from_fork+0x10/0x20
[   21.027063] 
[   21.027092] Freed by task 0:
[   21.027135]  kasan_save_stack+0x3c/0x68
[   21.027183]  kasan_save_track+0x20/0x40
[   21.027229]  kasan_save_free_info+0x4c/0x78
[   21.027271]  __kasan_slab_free+0x6c/0x98
[   21.027318]  slab_free_after_rcu_debug+0xd4/0x2f8
[   21.027365]  rcu_core+0x9f4/0x1e20
[   21.027408]  rcu_core_si+0x18/0x30
[   21.027446]  handle_softirqs+0x374/0xb28
[   21.027487]  __do_softirq+0x1c/0x28
[   21.027527] 
[   21.027549] Last potentially related work creation:
[   21.027581]  kasan_save_stack+0x3c/0x68
[   21.027626]  kasan_record_aux_stack+0xb4/0xc8
[   21.027667]  kmem_cache_free+0x120/0x468
[   21.027710]  kmem_cache_rcu_uaf+0x16c/0x468
[   21.027749]  kunit_try_run_case+0x170/0x3f0
[   21.027792]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.027863]  kthread+0x328/0x630
[   21.027929]  ret_from_fork+0x10/0x20
[   21.028003] 
[   21.028044] The buggy address belongs to the object at fff00000c7736000
[   21.028044]  which belongs to the cache test_cache of size 200
[   21.028218] The buggy address is located 0 bytes inside of
[   21.028218]  freed 200-byte region [fff00000c7736000, fff00000c77360c8)
[   21.028470] 
[   21.028524] The buggy address belongs to the physical page:
[   21.028698] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107736
[   21.028848] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   21.029224] page_type: f5(slab)
[   21.029341] raw: 0bfffe0000000000 fff00000c10ddb40 dead000000000122 0000000000000000
[   21.029562] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   21.029695] page dumped because: kasan: bad access detected
[   21.029898] 
[   21.029951] Memory state around the buggy address:
[   21.030144]  fff00000c7735f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   21.030334]  fff00000c7735f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   21.030564] >fff00000c7736000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   21.030674]                    ^
[   21.031051]  fff00000c7736080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   21.031320]  fff00000c7736100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.031524] ==================================================================

[   12.271584] ==================================================================
[   12.272125] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   12.272777] Read of size 1 at addr ffff8881028d3000 by task kunit_try_catch/238
[   12.273090] 
[   12.273199] CPU: 1 UID: 0 PID: 238 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250616 #1 PREEMPT(voluntary) 
[   12.273504] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.273518] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.273561] Call Trace:
[   12.273577]  <TASK>
[   12.273612]  dump_stack_lvl+0x73/0xb0
[   12.273647]  print_report+0xd1/0x650
[   12.273672]  ? __virt_addr_valid+0x1db/0x2d0
[   12.273705]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.273728]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.273750]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.273773]  kasan_report+0x141/0x180
[   12.273794]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.273820]  __asan_report_load1_noabort+0x18/0x20
[   12.273843]  kmem_cache_rcu_uaf+0x3e3/0x510
[   12.273866]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   12.273889]  ? finish_task_switch.isra.0+0x153/0x700
[   12.273911]  ? __switch_to+0x47/0xf50
[   12.273952]  ? __pfx_read_tsc+0x10/0x10
[   12.273974]  ? ktime_get_ts64+0x86/0x230
[   12.274001]  kunit_try_run_case+0x1a5/0x480
[   12.274026]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.274047]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.274072]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.274094]  ? __kthread_parkme+0x82/0x180
[   12.274115]  ? preempt_count_sub+0x50/0x80
[   12.274137]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.274159]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.274194]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.274217]  kthread+0x337/0x6f0
[   12.274236]  ? trace_preempt_on+0x20/0xc0
[   12.274260]  ? __pfx_kthread+0x10/0x10
[   12.274281]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.274301]  ? calculate_sigpending+0x7b/0xa0
[   12.274325]  ? __pfx_kthread+0x10/0x10
[   12.274345]  ret_from_fork+0x116/0x1d0
[   12.274363]  ? __pfx_kthread+0x10/0x10
[   12.274383]  ret_from_fork_asm+0x1a/0x30
[   12.274414]  </TASK>
[   12.274425] 
[   12.282298] Allocated by task 238:
[   12.282523]  kasan_save_stack+0x45/0x70
[   12.283008]  kasan_save_track+0x18/0x40
[   12.283235]  kasan_save_alloc_info+0x3b/0x50
[   12.283446]  __kasan_slab_alloc+0x91/0xa0
[   12.283755]  kmem_cache_alloc_noprof+0x123/0x3f0
[   12.283941]  kmem_cache_rcu_uaf+0x155/0x510
[   12.284135]  kunit_try_run_case+0x1a5/0x480
[   12.284283]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.284651]  kthread+0x337/0x6f0
[   12.284879]  ret_from_fork+0x116/0x1d0
[   12.285122]  ret_from_fork_asm+0x1a/0x30
[   12.285253] 
[   12.285316] Freed by task 0:
[   12.285415]  kasan_save_stack+0x45/0x70
[   12.285600]  kasan_save_track+0x18/0x40
[   12.285820]  kasan_save_free_info+0x3f/0x60
[   12.286103]  __kasan_slab_free+0x56/0x70
[   12.286838]  slab_free_after_rcu_debug+0xe4/0x310
[   12.287028]  rcu_core+0x66f/0x1c40
[   12.287210]  rcu_core_si+0x12/0x20
[   12.287383]  handle_softirqs+0x209/0x730
[   12.288139]  __irq_exit_rcu+0xc9/0x110
[   12.288277]  irq_exit_rcu+0x12/0x20
[   12.288411]  sysvec_apic_timer_interrupt+0x81/0x90
[   12.288569]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   12.288731] 
[   12.288800] Last potentially related work creation:
[   12.288955]  kasan_save_stack+0x45/0x70
[   12.289087]  kasan_record_aux_stack+0xb2/0xc0
[   12.289230]  kmem_cache_free+0x131/0x420
[   12.289585]  kmem_cache_rcu_uaf+0x194/0x510
[   12.289821]  kunit_try_run_case+0x1a5/0x480
[   12.290130]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.290619]  kthread+0x337/0x6f0
[   12.291086]  ret_from_fork+0x116/0x1d0
[   12.291250]  ret_from_fork_asm+0x1a/0x30
[   12.291577] 
[   12.291742] The buggy address belongs to the object at ffff8881028d3000
[   12.291742]  which belongs to the cache test_cache of size 200
[   12.292223] The buggy address is located 0 bytes inside of
[   12.292223]  freed 200-byte region [ffff8881028d3000, ffff8881028d30c8)
[   12.292981] 
[   12.293117] The buggy address belongs to the physical page:
[   12.293352] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1028d3
[   12.293850] flags: 0x200000000000000(node=0|zone=2)
[   12.294107] page_type: f5(slab)
[   12.294234] raw: 0200000000000000 ffff888101894500 dead000000000122 0000000000000000
[   12.294866] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   12.295165] page dumped because: kasan: bad access detected
[   12.295441] 
[   12.295509] Memory state around the buggy address:
[   12.295889]  ffff8881028d2f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.296228]  ffff8881028d2f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.296663] >ffff8881028d3000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   12.297000]                    ^
[   12.297136]  ffff8881028d3080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   12.297578]  ffff8881028d3100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.297842] ==================================================================