Hay
Date
July 1, 2025, 3:08 p.m.

Environment
qemu-arm64
qemu-x86_64

[   18.189917] ==================================================================
[   18.190034] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   18.190111] Read of size 1 at addr fff00000c57df000 by task kunit_try_catch/214
[   18.190165] 
[   18.190206] CPU: 1 UID: 0 PID: 214 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   18.190295] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.190323] Hardware name: linux,dummy-virt (DT)
[   18.190361] Call trace:
[   18.190386]  show_stack+0x20/0x38 (C)
[   18.190441]  dump_stack_lvl+0x8c/0xd0
[   18.190494]  print_report+0x118/0x608
[   18.190542]  kasan_report+0xdc/0x128
[   18.190602]  __asan_report_load1_noabort+0x20/0x30
[   18.190655]  kmem_cache_rcu_uaf+0x388/0x468
[   18.190702]  kunit_try_run_case+0x170/0x3f0
[   18.190752]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.190807]  kthread+0x328/0x630
[   18.190852]  ret_from_fork+0x10/0x20
[   18.190903] 
[   18.190921] Allocated by task 214:
[   18.190952]  kasan_save_stack+0x3c/0x68
[   18.190994]  kasan_save_track+0x20/0x40
[   18.191032]  kasan_save_alloc_info+0x40/0x58
[   18.191071]  __kasan_slab_alloc+0xa8/0xb0
[   18.191110]  kmem_cache_alloc_noprof+0x10c/0x398
[   18.191150]  kmem_cache_rcu_uaf+0x12c/0x468
[   18.191193]  kunit_try_run_case+0x170/0x3f0
[   18.191232]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.191276]  kthread+0x328/0x630
[   18.191311]  ret_from_fork+0x10/0x20
[   18.191346] 
[   18.191366] Freed by task 0:
[   18.191393]  kasan_save_stack+0x3c/0x68
[   18.191430]  kasan_save_track+0x20/0x40
[   18.191468]  kasan_save_free_info+0x4c/0x78
[   18.191508]  __kasan_slab_free+0x6c/0x98
[   18.191544]  slab_free_after_rcu_debug+0xd4/0x2f8
[   18.191594]  rcu_core+0x9f4/0x1e20
[   18.191632]  rcu_core_si+0x18/0x30
[   18.191665]  handle_softirqs+0x374/0xb28
[   18.191703]  __do_softirq+0x1c/0x28
[   18.191735] 
[   18.191754] Last potentially related work creation:
[   18.191781]  kasan_save_stack+0x3c/0x68
[   18.191819]  kasan_record_aux_stack+0xb4/0xc8
[   18.191861]  kmem_cache_free+0x120/0x468
[   18.191897]  kmem_cache_rcu_uaf+0x16c/0x468
[   18.191935]  kunit_try_run_case+0x170/0x3f0
[   18.191972]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.192016]  kthread+0x328/0x630
[   18.192048]  ret_from_fork+0x10/0x20
[   18.192084] 
[   18.192103] The buggy address belongs to the object at fff00000c57df000
[   18.192103]  which belongs to the cache test_cache of size 200
[   18.192164] The buggy address is located 0 bytes inside of
[   18.192164]  freed 200-byte region [fff00000c57df000, fff00000c57df0c8)
[   18.192229] 
[   18.192252] The buggy address belongs to the physical page:
[   18.192285] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1057df
[   18.192346] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.192402] page_type: f5(slab)
[   18.192446] raw: 0bfffe0000000000 fff00000c57d53c0 dead000000000122 0000000000000000
[   18.192499] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   18.192542] page dumped because: kasan: bad access detected
[   18.192583] 
[   18.192601] Memory state around the buggy address:
[   18.192637]  fff00000c57def00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.192681]  fff00000c57def80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.192725] >fff00000c57df000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   18.192765]                    ^
[   18.192793]  fff00000c57df080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   18.192837]  fff00000c57df100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.192877] ==================================================================

[   12.409965] ==================================================================
[   12.410792] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   12.412272] Read of size 1 at addr ffff8881033b9000 by task kunit_try_catch/230
[   12.412599] 
[   12.413190] CPU: 0 UID: 0 PID: 230 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   12.413245] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.413258] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.413280] Call Trace:
[   12.413294]  <TASK>
[   12.413315]  dump_stack_lvl+0x73/0xb0
[   12.413350]  print_report+0xd1/0x650
[   12.413374]  ? __virt_addr_valid+0x1db/0x2d0
[   12.413399]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.413421]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.413442]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.413464]  kasan_report+0x141/0x180
[   12.413484]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.413510]  __asan_report_load1_noabort+0x18/0x20
[   12.413533]  kmem_cache_rcu_uaf+0x3e3/0x510
[   12.413554]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   12.413575]  ? finish_task_switch.isra.0+0x153/0x700
[   12.413597]  ? __switch_to+0x47/0xf50
[   12.413626]  ? __pfx_read_tsc+0x10/0x10
[   12.413646]  ? ktime_get_ts64+0x86/0x230
[   12.413670]  kunit_try_run_case+0x1a5/0x480
[   12.413710]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.413731]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.413754]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.413775]  ? __kthread_parkme+0x82/0x180
[   12.413795]  ? preempt_count_sub+0x50/0x80
[   12.413816]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.413838]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.413859]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.413880]  kthread+0x337/0x6f0
[   12.413898]  ? trace_preempt_on+0x20/0xc0
[   12.413921]  ? __pfx_kthread+0x10/0x10
[   12.413940]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.413959]  ? calculate_sigpending+0x7b/0xa0
[   12.413982]  ? __pfx_kthread+0x10/0x10
[   12.414002]  ret_from_fork+0x116/0x1d0
[   12.414018]  ? __pfx_kthread+0x10/0x10
[   12.414049]  ret_from_fork_asm+0x1a/0x30
[   12.414322]  </TASK>
[   12.414337] 
[   12.427995] Allocated by task 230:
[   12.428877]  kasan_save_stack+0x45/0x70
[   12.429261]  kasan_save_track+0x18/0x40
[   12.429402]  kasan_save_alloc_info+0x3b/0x50
[   12.429547]  __kasan_slab_alloc+0x91/0xa0
[   12.430205]  kmem_cache_alloc_noprof+0x123/0x3f0
[   12.430809]  kmem_cache_rcu_uaf+0x155/0x510
[   12.431453]  kunit_try_run_case+0x1a5/0x480
[   12.432088]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.432591]  kthread+0x337/0x6f0
[   12.433014]  ret_from_fork+0x116/0x1d0
[   12.433336]  ret_from_fork_asm+0x1a/0x30
[   12.433479] 
[   12.433551] Freed by task 0:
[   12.434050]  kasan_save_stack+0x45/0x70
[   12.434504]  kasan_save_track+0x18/0x40
[   12.434919]  kasan_save_free_info+0x3f/0x60
[   12.435540]  __kasan_slab_free+0x56/0x70
[   12.435831]  slab_free_after_rcu_debug+0xe4/0x310
[   12.435995]  rcu_core+0x66f/0x1c40
[   12.436135]  rcu_core_si+0x12/0x20
[   12.436264]  handle_softirqs+0x209/0x730
[   12.436405]  __irq_exit_rcu+0xc9/0x110
[   12.436535]  irq_exit_rcu+0x12/0x20
[   12.436676]  sysvec_apic_timer_interrupt+0x81/0x90
[   12.436836]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   12.437290] 
[   12.437461] Last potentially related work creation:
[   12.437637]  kasan_save_stack+0x45/0x70
[   12.438206]  kasan_record_aux_stack+0xb2/0xc0
[   12.438695]  kmem_cache_free+0x131/0x420
[   12.438926]  kmem_cache_rcu_uaf+0x194/0x510
[   12.439087]  kunit_try_run_case+0x1a5/0x480
[   12.439234]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.439406]  kthread+0x337/0x6f0
[   12.439525]  ret_from_fork+0x116/0x1d0
[   12.439730]  ret_from_fork_asm+0x1a/0x30
[   12.440088] 
[   12.440252] The buggy address belongs to the object at ffff8881033b9000
[   12.440252]  which belongs to the cache test_cache of size 200
[   12.441484] The buggy address is located 0 bytes inside of
[   12.441484]  freed 200-byte region [ffff8881033b9000, ffff8881033b90c8)
[   12.442775] 
[   12.443055] The buggy address belongs to the physical page:
[   12.443535] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1033b9
[   12.444110] flags: 0x200000000000000(node=0|zone=2)
[   12.444285] page_type: f5(slab)
[   12.444411] raw: 0200000000000000 ffff8881033b6000 dead000000000122 0000000000000000
[   12.444641] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   12.445311] page dumped because: kasan: bad access detected
[   12.445800] 
[   12.446136] Memory state around the buggy address:
[   12.446555]  ffff8881033b8f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.447274]  ffff8881033b8f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.448087] >ffff8881033b9000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   12.448312]                    ^
[   12.448428]  ffff8881033b9080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   12.448684]  ffff8881033b9100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.449390] ==================================================================