Hay
Date
July 1, 2025, 11:08 a.m.

Environment
qemu-arm64
qemu-x86_64

[   19.553771] ==================================================================
[   19.553888] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   19.553982] Read of size 1 at addr fff00000c7713000 by task kunit_try_catch/214
[   19.554040] 
[   19.554089] CPU: 1 UID: 0 PID: 214 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   19.554203] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.554231] Hardware name: linux,dummy-virt (DT)
[   19.554271] Call trace:
[   19.554295]  show_stack+0x20/0x38 (C)
[   19.554351]  dump_stack_lvl+0x8c/0xd0
[   19.554407]  print_report+0x118/0x608
[   19.554455]  kasan_report+0xdc/0x128
[   19.554504]  __asan_report_load1_noabort+0x20/0x30
[   19.554558]  kmem_cache_rcu_uaf+0x388/0x468
[   19.554608]  kunit_try_run_case+0x170/0x3f0
[   19.554660]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.554717]  kthread+0x328/0x630
[   19.554764]  ret_from_fork+0x10/0x20
[   19.554817] 
[   19.554838] Allocated by task 214:
[   19.554871]  kasan_save_stack+0x3c/0x68
[   19.554914]  kasan_save_track+0x20/0x40
[   19.554951]  kasan_save_alloc_info+0x40/0x58
[   19.554994]  __kasan_slab_alloc+0xa8/0xb0
[   19.555034]  kmem_cache_alloc_noprof+0x10c/0x398
[   19.555080]  kmem_cache_rcu_uaf+0x12c/0x468
[   19.556199]  kunit_try_run_case+0x170/0x3f0
[   19.556245]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.556293]  kthread+0x328/0x630
[   19.556329]  ret_from_fork+0x10/0x20
[   19.556369] 
[   19.556389] Freed by task 0:
[   19.556421]  kasan_save_stack+0x3c/0x68
[   19.556464]  kasan_save_track+0x20/0x40
[   19.556504]  kasan_save_free_info+0x4c/0x78
[   19.556547]  __kasan_slab_free+0x6c/0x98
[   19.556585]  slab_free_after_rcu_debug+0xd4/0x2f8
[   19.556630]  rcu_core+0x9f4/0x1e20
[   19.556670]  rcu_core_si+0x18/0x30
[   19.556708]  handle_softirqs+0x374/0xb28
[   19.556748]  __do_softirq+0x1c/0x28
[   19.556785] 
[   19.556807] Last potentially related work creation:
[   19.556837]  kasan_save_stack+0x3c/0x68
[   19.556876]  kasan_record_aux_stack+0xb4/0xc8
[   19.556920]  kmem_cache_free+0x120/0x468
[   19.556958]  kmem_cache_rcu_uaf+0x16c/0x468
[   19.556998]  kunit_try_run_case+0x170/0x3f0
[   19.557039]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.557085]  kthread+0x328/0x630
[   19.557120]  ret_from_fork+0x10/0x20
[   19.557169] 
[   19.557241] The buggy address belongs to the object at fff00000c7713000
[   19.557241]  which belongs to the cache test_cache of size 200
[   19.557338] The buggy address is located 0 bytes inside of
[   19.557338]  freed 200-byte region [fff00000c7713000, fff00000c77130c8)
[   19.557406] 
[   19.557442] The buggy address belongs to the physical page:
[   19.557479] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107713
[   19.557540] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.557602] page_type: f5(slab)
[   19.557652] raw: 0bfffe0000000000 fff00000c0cacdc0 dead000000000122 0000000000000000
[   19.557721] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   19.557767] page dumped because: kasan: bad access detected
[   19.557830] 
[   19.557851] Memory state around the buggy address:
[   19.557888]  fff00000c7712f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.557938]  fff00000c7712f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.558003] >fff00000c7713000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   19.558067]                    ^
[   19.558098]  fff00000c7713080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   19.558170]  fff00000c7713100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.558230] ==================================================================

[   12.297239] ==================================================================
[   12.297852] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   12.298371] Read of size 1 at addr ffff88810259d000 by task kunit_try_catch/230
[   12.299298] 
[   12.299427] CPU: 0 UID: 0 PID: 230 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   12.299477] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.299490] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.299512] Call Trace:
[   12.299526]  <TASK>
[   12.299547]  dump_stack_lvl+0x73/0xb0
[   12.299580]  print_report+0xd1/0x650
[   12.299604]  ? __virt_addr_valid+0x1db/0x2d0
[   12.299628]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.299649]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.299670]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.299691]  kasan_report+0x141/0x180
[   12.299712]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.299738]  __asan_report_load1_noabort+0x18/0x20
[   12.299761]  kmem_cache_rcu_uaf+0x3e3/0x510
[   12.299783]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   12.299803]  ? finish_task_switch.isra.0+0x153/0x700
[   12.299826]  ? __switch_to+0x47/0xf50
[   12.299854]  ? __pfx_read_tsc+0x10/0x10
[   12.299875]  ? ktime_get_ts64+0x86/0x230
[   12.299899]  kunit_try_run_case+0x1a5/0x480
[   12.299924]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.299945]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.300207]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.300231]  ? __kthread_parkme+0x82/0x180
[   12.300252]  ? preempt_count_sub+0x50/0x80
[   12.300274]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.300297]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.300319]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.300342]  kthread+0x337/0x6f0
[   12.300362]  ? trace_preempt_on+0x20/0xc0
[   12.300615]  ? __pfx_kthread+0x10/0x10
[   12.300637]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.300660]  ? calculate_sigpending+0x7b/0xa0
[   12.300683]  ? __pfx_kthread+0x10/0x10
[   12.300704]  ret_from_fork+0x116/0x1d0
[   12.300722]  ? __pfx_kthread+0x10/0x10
[   12.300742]  ret_from_fork_asm+0x1a/0x30
[   12.300804]  </TASK>
[   12.300817] 
[   12.309935] Allocated by task 230:
[   12.310182]  kasan_save_stack+0x45/0x70
[   12.310734]  kasan_save_track+0x18/0x40
[   12.311002]  kasan_save_alloc_info+0x3b/0x50
[   12.311270]  __kasan_slab_alloc+0x91/0xa0
[   12.311436]  kmem_cache_alloc_noprof+0x123/0x3f0
[   12.311611]  kmem_cache_rcu_uaf+0x155/0x510
[   12.311874]  kunit_try_run_case+0x1a5/0x480
[   12.312083]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.312665]  kthread+0x337/0x6f0
[   12.312828]  ret_from_fork+0x116/0x1d0
[   12.313099]  ret_from_fork_asm+0x1a/0x30
[   12.313259] 
[   12.313535] Freed by task 0:
[   12.313860]  kasan_save_stack+0x45/0x70
[   12.314005]  kasan_save_track+0x18/0x40
[   12.314225]  kasan_save_free_info+0x3f/0x60
[   12.314489]  __kasan_slab_free+0x56/0x70
[   12.314744]  slab_free_after_rcu_debug+0xe4/0x310
[   12.315089]  rcu_core+0x66f/0x1c40
[   12.315306]  rcu_core_si+0x12/0x20
[   12.315465]  handle_softirqs+0x209/0x730
[   12.315720]  __irq_exit_rcu+0xc9/0x110
[   12.316201]  irq_exit_rcu+0x12/0x20
[   12.316508]  sysvec_apic_timer_interrupt+0x81/0x90
[   12.316860]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   12.317086] 
[   12.317161] Last potentially related work creation:
[   12.317413]  kasan_save_stack+0x45/0x70
[   12.317760]  kasan_record_aux_stack+0xb2/0xc0
[   12.318054]  kmem_cache_free+0x131/0x420
[   12.318242]  kmem_cache_rcu_uaf+0x194/0x510
[   12.318464]  kunit_try_run_case+0x1a5/0x480
[   12.318696]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.319045]  kthread+0x337/0x6f0
[   12.319524]  ret_from_fork+0x116/0x1d0
[   12.319688]  ret_from_fork_asm+0x1a/0x30
[   12.319888] 
[   12.320665] The buggy address belongs to the object at ffff88810259d000
[   12.320665]  which belongs to the cache test_cache of size 200
[   12.321336] The buggy address is located 0 bytes inside of
[   12.321336]  freed 200-byte region [ffff88810259d000, ffff88810259d0c8)
[   12.322352] 
[   12.322605] The buggy address belongs to the physical page:
[   12.323015] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10259d
[   12.323503] flags: 0x200000000000000(node=0|zone=2)
[   12.323914] page_type: f5(slab)
[   12.324228] raw: 0200000000000000 ffff888102596280 dead000000000122 0000000000000000
[   12.324792] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   12.325242] page dumped because: kasan: bad access detected
[   12.325491] 
[   12.325592] Memory state around the buggy address:
[   12.325770]  ffff88810259cf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.326158]  ffff88810259cf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.326478] >ffff88810259d000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   12.326801]                    ^
[   12.327098]  ffff88810259d080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   12.327432]  ffff88810259d100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.327742] ==================================================================