Hay
Date
May 13, 2025, 12:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   20.155367] ==================================================================
[   20.155489] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   20.155591] Read of size 1 at addr fff00000c408a000 by task kunit_try_catch/213
[   20.155668] 
[   20.155725] CPU: 1 UID: 0 PID: 213 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250513 #1 PREEMPT 
[   20.155916] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.155991] Hardware name: linux,dummy-virt (DT)
[   20.156085] Call trace:
[   20.156145]  show_stack+0x20/0x38 (C)
[   20.156228]  dump_stack_lvl+0x8c/0xd0
[   20.156331]  print_report+0x118/0x608
[   20.156432]  kasan_report+0xdc/0x128
[   20.156533]  __asan_report_load1_noabort+0x20/0x30
[   20.156644]  kmem_cache_rcu_uaf+0x388/0x468
[   20.156708]  kunit_try_run_case+0x170/0x3f0
[   20.156806]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.156915]  kthread+0x328/0x630
[   20.157052]  ret_from_fork+0x10/0x20
[   20.157119] 
[   20.157141] Allocated by task 213:
[   20.157177]  kasan_save_stack+0x3c/0x68
[   20.157227]  kasan_save_track+0x20/0x40
[   20.157270]  kasan_save_alloc_info+0x40/0x58
[   20.157314]  __kasan_slab_alloc+0xa8/0xb0
[   20.157509]  kmem_cache_alloc_noprof+0x10c/0x3a0
[   20.157620]  kmem_cache_rcu_uaf+0x12c/0x468
[   20.157678]  kunit_try_run_case+0x170/0x3f0
[   20.157721]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.157834]  kthread+0x328/0x630
[   20.157881]  ret_from_fork+0x10/0x20
[   20.157924] 
[   20.157948] Freed by task 0:
[   20.157991]  kasan_save_stack+0x3c/0x68
[   20.158039]  kasan_save_track+0x20/0x40
[   20.158079]  kasan_save_free_info+0x4c/0x78
[   20.158124]  __kasan_slab_free+0x6c/0x98
[   20.158165]  slab_free_after_rcu_debug+0xd4/0x2f8
[   20.158210]  rcu_core+0x9f4/0x1e20
[   20.158252]  rcu_core_si+0x18/0x30
[   20.158293]  handle_softirqs+0x374/0xb28
[   20.158338]  __do_softirq+0x1c/0x28
[   20.158377] 
[   20.158401] Last potentially related work creation:
[   20.158430]  kasan_save_stack+0x3c/0x68
[   20.158486]  kasan_record_aux_stack+0xb4/0xc8
[   20.158531]  kmem_cache_free+0x120/0x470
[   20.158604]  kmem_cache_rcu_uaf+0x16c/0x468
[   20.158703]  kunit_try_run_case+0x170/0x3f0
[   20.158778]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.158828]  kthread+0x328/0x630
[   20.158870]  ret_from_fork+0x10/0x20
[   20.158911] 
[   20.158933] The buggy address belongs to the object at fff00000c408a000
[   20.158933]  which belongs to the cache test_cache of size 200
[   20.159012] The buggy address is located 0 bytes inside of
[   20.159012]  freed 200-byte region [fff00000c408a000, fff00000c408a0c8)
[   20.159083] 
[   20.159111] The buggy address belongs to the physical page:
[   20.159150] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10408a
[   20.159219] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   20.159281] page_type: f5(slab)
[   20.159377] raw: 0bfffe0000000000 fff00000c6617000 dead000000000122 0000000000000000
[   20.159491] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   20.159591] page dumped because: kasan: bad access detected
[   20.159649] 
[   20.159675] Memory state around the buggy address:
[   20.159718]  fff00000c4089f00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   20.159789]  fff00000c4089f80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   20.159840] >fff00000c408a000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   20.159885]                    ^
[   20.159919]  fff00000c408a080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   20.159977]  fff00000c408a100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.160027] ==================================================================

[   11.904725] ==================================================================
[   11.905240] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   11.905486] Read of size 1 at addr ffff8881029dd000 by task kunit_try_catch/230
[   11.906887] 
[   11.907178] CPU: 0 UID: 0 PID: 230 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250513 #1 PREEMPT(voluntary) 
[   11.907234] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.907355] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.907380] Call Trace:
[   11.907395]  <TASK>
[   11.907416]  dump_stack_lvl+0x73/0xb0
[   11.907449]  print_report+0xd1/0x650
[   11.907472]  ? __virt_addr_valid+0x1db/0x2d0
[   11.907497]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   11.907539]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.907562]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   11.907586]  kasan_report+0x141/0x180
[   11.907608]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   11.907646]  __asan_report_load1_noabort+0x18/0x20
[   11.907666]  kmem_cache_rcu_uaf+0x3e3/0x510
[   11.907689]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   11.907711]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   11.907741]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   11.907769]  kunit_try_run_case+0x1a5/0x480
[   11.907794]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.907815]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.907837]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.907859]  ? __kthread_parkme+0x82/0x180
[   11.907880]  ? preempt_count_sub+0x50/0x80
[   11.907906]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.907928]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.907950]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.907972]  kthread+0x337/0x6f0
[   11.908220]  ? trace_preempt_on+0x20/0xc0
[   11.908245]  ? __pfx_kthread+0x10/0x10
[   11.908266]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.908286]  ? calculate_sigpending+0x7b/0xa0
[   11.908312]  ? __pfx_kthread+0x10/0x10
[   11.908334]  ret_from_fork+0x116/0x1d0
[   11.908352]  ? __pfx_kthread+0x10/0x10
[   11.908372]  ret_from_fork_asm+0x1a/0x30
[   11.908404]  </TASK>
[   11.908415] 
[   11.918855] Allocated by task 230:
[   11.918986]  kasan_save_stack+0x45/0x70
[   11.919431]  kasan_save_track+0x18/0x40
[   11.919787]  kasan_save_alloc_info+0x3b/0x50
[   11.920015]  __kasan_slab_alloc+0x91/0xa0
[   11.920272]  kmem_cache_alloc_noprof+0x123/0x3f0
[   11.920479]  kmem_cache_rcu_uaf+0x155/0x510
[   11.920814]  kunit_try_run_case+0x1a5/0x480
[   11.921127]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.921458]  kthread+0x337/0x6f0
[   11.921725]  ret_from_fork+0x116/0x1d0
[   11.921864]  ret_from_fork_asm+0x1a/0x30
[   11.922071] 
[   11.922171] Freed by task 0:
[   11.922341]  kasan_save_stack+0x45/0x70
[   11.922565]  kasan_save_track+0x18/0x40
[   11.922886]  kasan_save_free_info+0x3f/0x60
[   11.923093]  __kasan_slab_free+0x56/0x70
[   11.923386]  slab_free_after_rcu_debug+0xe4/0x310
[   11.923576]  rcu_core+0x66f/0x1c40
[   11.923971]  rcu_core_si+0x12/0x20
[   11.924146]  handle_softirqs+0x209/0x730
[   11.924636]  __irq_exit_rcu+0xc9/0x110
[   11.924831]  irq_exit_rcu+0x12/0x20
[   11.924995]  sysvec_apic_timer_interrupt+0x81/0x90
[   11.925305]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   11.926244] 
[   11.926343] Last potentially related work creation:
[   11.927013]  kasan_save_stack+0x45/0x70
[   11.927355]  kasan_record_aux_stack+0xb2/0xc0
[   11.927664]  kmem_cache_free+0x131/0x420
[   11.927854]  kmem_cache_rcu_uaf+0x194/0x510
[   11.928039]  kunit_try_run_case+0x1a5/0x480
[   11.928466]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.928851]  kthread+0x337/0x6f0
[   11.929019]  ret_from_fork+0x116/0x1d0
[   11.929186]  ret_from_fork_asm+0x1a/0x30
[   11.929365] 
[   11.929453] The buggy address belongs to the object at ffff8881029dd000
[   11.929453]  which belongs to the cache test_cache of size 200
[   11.930652] The buggy address is located 0 bytes inside of
[   11.930652]  freed 200-byte region [ffff8881029dd000, ffff8881029dd0c8)
[   11.931847] 
[   11.931969] The buggy address belongs to the physical page:
[   11.932364] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1029dd
[   11.933015] flags: 0x200000000000000(node=0|zone=2)
[   11.933393] page_type: f5(slab)
[   11.933878] raw: 0200000000000000 ffff888101ce8640 dead000000000122 0000000000000000
[   11.934403] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   11.934828] page dumped because: kasan: bad access detected
[   11.935066] 
[   11.935158] Memory state around the buggy address:
[   11.935823]  ffff8881029dcf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.936491]  ffff8881029dcf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.936950] >ffff8881029dd000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   11.937475]                    ^
[   11.937985]  ffff8881029dd080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   11.938476]  ffff8881029dd100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.939068] ==================================================================