Hay
Date
June 5, 2025, 7:08 a.m.

Environment
qemu-arm64
qemu-x86_64

[   26.963944] ==================================================================
[   26.964263] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   26.964780] Read of size 1 at addr fff00000c7760000 by task kunit_try_catch/213
[   26.964950] 
[   26.965048] CPU: 0 UID: 0 PID: 213 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250605 #1 PREEMPT 
[   26.965402] Tainted: [B]=BAD_PAGE, [N]=TEST
[   26.965589] Hardware name: linux,dummy-virt (DT)
[   26.965675] Call trace:
[   26.965831]  show_stack+0x20/0x38 (C)
[   26.966342]  dump_stack_lvl+0x8c/0xd0
[   26.966479]  print_report+0x118/0x608
[   26.966594]  kasan_report+0xdc/0x128
[   26.966981]  __asan_report_load1_noabort+0x20/0x30
[   26.967224]  kmem_cache_rcu_uaf+0x388/0x468
[   26.967740]  kunit_try_run_case+0x170/0x3f0
[   26.968155]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   26.968370]  kthread+0x328/0x630
[   26.968531]  ret_from_fork+0x10/0x20
[   26.968892] 
[   26.969024] Allocated by task 213:
[   26.969140]  kasan_save_stack+0x3c/0x68
[   26.969322]  kasan_save_track+0x20/0x40
[   26.969510]  kasan_save_alloc_info+0x40/0x58
[   26.969788]  __kasan_slab_alloc+0xa8/0xb0
[   26.969890]  kmem_cache_alloc_noprof+0x10c/0x398
[   26.969999]  kmem_cache_rcu_uaf+0x12c/0x468
[   26.970089]  kunit_try_run_case+0x170/0x3f0
[   26.970184]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   26.970296]  kthread+0x328/0x630
[   26.971252]  ret_from_fork+0x10/0x20
[   26.971385] 
[   26.971548] Freed by task 0:
[   26.971640]  kasan_save_stack+0x3c/0x68
[   26.971935]  kasan_save_track+0x20/0x40
[   26.972214]  kasan_save_free_info+0x4c/0x78
[   26.972316]  __kasan_slab_free+0x6c/0x98
[   26.972436]  slab_free_after_rcu_debug+0xd4/0x2f8
[   26.972606]  rcu_core+0x9f4/0x1e20
[   26.972744]  rcu_core_si+0x18/0x30
[   26.972986]  handle_softirqs+0x374/0xb28
[   26.973125]  __do_softirq+0x1c/0x28
[   26.973220] 
[   26.973270] Last potentially related work creation:
[   26.973438]  kasan_save_stack+0x3c/0x68
[   26.973586]  kasan_record_aux_stack+0xb4/0xc8
[   26.973680]  kmem_cache_free+0x120/0x468
[   26.973807]  kmem_cache_rcu_uaf+0x16c/0x468
[   26.974071]  kunit_try_run_case+0x170/0x3f0
[   26.974352]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   26.974471]  kthread+0x328/0x630
[   26.974573]  ret_from_fork+0x10/0x20
[   26.974675] 
[   26.974733] The buggy address belongs to the object at fff00000c7760000
[   26.974733]  which belongs to the cache test_cache of size 200
[   26.975630] The buggy address is located 0 bytes inside of
[   26.975630]  freed 200-byte region [fff00000c7760000, fff00000c77600c8)
[   26.975734] 
[   26.975761] The buggy address belongs to the physical page:
[   26.975818] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107760
[   26.975940] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   26.976009] page_type: f5(slab)
[   26.976061] raw: 0bfffe0000000000 fff00000c11a6c80 dead000000000122 0000000000000000
[   26.976124] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   26.976177] page dumped because: kasan: bad access detected
[   26.976217] 
[   26.976237] Memory state around the buggy address:
[   26.976279]  fff00000c775ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   26.976370]  fff00000c775ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   26.976657] >fff00000c7760000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   26.976770]                    ^
[   26.976851]  fff00000c7760080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   26.977247]  fff00000c7760100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.977494] ==================================================================


[   12.207149] ==================================================================
[   12.207659] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   12.208126] Read of size 1 at addr ffff888102789000 by task kunit_try_catch/230
[   12.208406] 
[   12.208531] CPU: 1 UID: 0 PID: 230 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250605 #1 PREEMPT(voluntary) 
[   12.208579] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.208590] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.208612] Call Trace:
[   12.208624]  <TASK>
[   12.208641]  dump_stack_lvl+0x73/0xb0
[   12.208669]  print_report+0xd1/0x650
[   12.208691]  ? __virt_addr_valid+0x1db/0x2d0
[   12.208716]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.208738]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.208761]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.208820]  kasan_report+0x141/0x180
[   12.208842]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.208880]  __asan_report_load1_noabort+0x18/0x20
[   12.208912]  kmem_cache_rcu_uaf+0x3e3/0x510
[   12.208935]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   12.208957]  ? finish_task_switch.isra.0+0x153/0x700
[   12.208979]  ? __switch_to+0x47/0xf50
[   12.209008]  ? __pfx_read_tsc+0x10/0x10
[   12.209030]  ? ktime_get_ts64+0x86/0x230
[   12.209105]  kunit_try_run_case+0x1a5/0x480
[   12.209130]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.209149]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.209175]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.209199]  ? __kthread_parkme+0x82/0x180
[   12.209219]  ? preempt_count_sub+0x50/0x80
[   12.209241]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.209261]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.209285]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.209309]  kthread+0x337/0x6f0
[   12.209328]  ? trace_preempt_on+0x20/0xc0
[   12.209351]  ? __pfx_kthread+0x10/0x10
[   12.209371]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.209392]  ? calculate_sigpending+0x7b/0xa0
[   12.209416]  ? __pfx_kthread+0x10/0x10
[   12.209436]  ret_from_fork+0x116/0x1d0
[   12.209454]  ? __pfx_kthread+0x10/0x10
[   12.209474]  ret_from_fork_asm+0x1a/0x30
[   12.209504]  </TASK>
[   12.209515] 
[   12.220368] Allocated by task 230:
[   12.220621]  kasan_save_stack+0x45/0x70
[   12.221008]  kasan_save_track+0x18/0x40
[   12.221392]  kasan_save_alloc_info+0x3b/0x50
[   12.221593]  __kasan_slab_alloc+0x91/0xa0
[   12.221991]  kmem_cache_alloc_noprof+0x123/0x3f0
[   12.222338]  kmem_cache_rcu_uaf+0x155/0x510
[   12.222608]  kunit_try_run_case+0x1a5/0x480
[   12.222850]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.223335]  kthread+0x337/0x6f0
[   12.223467]  ret_from_fork+0x116/0x1d0
[   12.223791]  ret_from_fork_asm+0x1a/0x30
[   12.224149] 
[   12.224352] Freed by task 0:
[   12.224484]  kasan_save_stack+0x45/0x70
[   12.224954]  kasan_save_track+0x18/0x40
[   12.225136]  kasan_save_free_info+0x3f/0x60
[   12.225343]  __kasan_slab_free+0x56/0x70
[   12.225524]  slab_free_after_rcu_debug+0xe4/0x310
[   12.226221]  rcu_core+0x66f/0x1c40
[   12.226390]  rcu_core_si+0x12/0x20
[   12.226518]  handle_softirqs+0x209/0x730
[   12.226951]  __irq_exit_rcu+0xc9/0x110
[   12.227337]  irq_exit_rcu+0x12/0x20
[   12.227522]  sysvec_apic_timer_interrupt+0x81/0x90
[   12.227751]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   12.228252] 
[   12.228332] Last potentially related work creation:
[   12.228730]  kasan_save_stack+0x45/0x70
[   12.229163]  kasan_record_aux_stack+0xb2/0xc0
[   12.229395]  kmem_cache_free+0x131/0x420
[   12.229669]  kmem_cache_rcu_uaf+0x194/0x510
[   12.229870]  kunit_try_run_case+0x1a5/0x480
[   12.230334]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.230655]  kthread+0x337/0x6f0
[   12.230855]  ret_from_fork+0x116/0x1d0
[   12.231242]  ret_from_fork_asm+0x1a/0x30
[   12.231400] 
[   12.231496] The buggy address belongs to the object at ffff888102789000
[   12.231496]  which belongs to the cache test_cache of size 200
[   12.232681] The buggy address is located 0 bytes inside of
[   12.232681]  freed 200-byte region [ffff888102789000, ffff8881027890c8)
[   12.233334] 
[   12.233442] The buggy address belongs to the physical page:
[   12.233909] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102789
[   12.234373] flags: 0x200000000000000(node=0|zone=2)
[   12.234587] page_type: f5(slab)
[   12.235045] raw: 0200000000000000 ffff8881018ce280 dead000000000122 0000000000000000
[   12.235361] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   12.235796] page dumped because: kasan: bad access detected
[   12.236220] 
[   12.236322] Memory state around the buggy address:
[   12.236698]  ffff888102788f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.237178]  ffff888102788f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.237570] >ffff888102789000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   12.238123]                    ^
[   12.238264]  ffff888102789080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   12.238597]  ffff888102789100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.239159] ==================================================================