Hay
Date
July 5, 2025, 11:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   19.295546] ==================================================================
[   19.295645] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   19.295724] Read of size 1 at addr fff00000c78c3000 by task kunit_try_catch/213
[   19.295777] 
[   19.295818] CPU: 0 UID: 0 PID: 213 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   19.295912] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.295940] Hardware name: linux,dummy-virt (DT)
[   19.295974] Call trace:
[   19.295996]  show_stack+0x20/0x38 (C)
[   19.296342]  dump_stack_lvl+0x8c/0xd0
[   19.297057]  print_report+0x118/0x608
[   19.297721]  kasan_report+0xdc/0x128
[   19.298005]  __asan_report_load1_noabort+0x20/0x30
[   19.298923]  kmem_cache_rcu_uaf+0x388/0x468
[   19.299181]  kunit_try_run_case+0x170/0x3f0
[   19.299575]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.299952]  kthread+0x328/0x630
[   19.300688]  ret_from_fork+0x10/0x20
[   19.301180] 
[   19.301203] Allocated by task 213:
[   19.301527]  kasan_save_stack+0x3c/0x68
[   19.301648]  kasan_save_track+0x20/0x40
[   19.302299]  kasan_save_alloc_info+0x40/0x58
[   19.302467]  __kasan_slab_alloc+0xa8/0xb0
[   19.302528]  kmem_cache_alloc_noprof+0x10c/0x398
[   19.303055]  kmem_cache_rcu_uaf+0x12c/0x468
[   19.303431]  kunit_try_run_case+0x170/0x3f0
[   19.303585]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.304323]  kthread+0x328/0x630
[   19.305146]  ret_from_fork+0x10/0x20
[   19.305331] 
[   19.305355] Freed by task 0:
[   19.305482]  kasan_save_stack+0x3c/0x68
[   19.305836]  kasan_save_track+0x20/0x40
[   19.306273]  kasan_save_free_info+0x4c/0x78
[   19.306451]  __kasan_slab_free+0x6c/0x98
[   19.306710]  slab_free_after_rcu_debug+0xd4/0x2f8
[   19.306755]  rcu_core+0x9f4/0x1e20
[   19.306792]  rcu_core_si+0x18/0x30
[   19.307609]  handle_softirqs+0x374/0xb28
[   19.308044]  __do_softirq+0x1c/0x28
[   19.308620] 
[   19.308650] Last potentially related work creation:
[   19.308710]  kasan_save_stack+0x3c/0x68
[   19.308893]  kasan_record_aux_stack+0xb4/0xc8
[   19.309566]  kmem_cache_free+0x120/0x468
[   19.310141]  kmem_cache_rcu_uaf+0x16c/0x468
[   19.310393]  kunit_try_run_case+0x170/0x3f0
[   19.311006]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.311265]  kthread+0x328/0x630
[   19.311310]  ret_from_fork+0x10/0x20
[   19.311347] 
[   19.311367] The buggy address belongs to the object at fff00000c78c3000
[   19.311367]  which belongs to the cache test_cache of size 200
[   19.312261] The buggy address is located 0 bytes inside of
[   19.312261]  freed 200-byte region [fff00000c78c3000, fff00000c78c30c8)
[   19.312801] 
[   19.312840] The buggy address belongs to the physical page:
[   19.313385] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1078c3
[   19.313904] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.314047] page_type: f5(slab)
[   19.314299] raw: 0bfffe0000000000 fff00000c78c0000 dead000000000122 0000000000000000
[   19.314374] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   19.314416] page dumped because: kasan: bad access detected
[   19.314447] 
[   19.315531] Memory state around the buggy address:
[   19.315826]  fff00000c78c2f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.316342]  fff00000c78c2f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.316405] >fff00000c78c3000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   19.316589]                    ^
[   19.316891]  fff00000c78c3080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   19.317391]  fff00000c78c3100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.317560] ==================================================================

[   14.486347] ==================================================================
[   14.487006] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   14.487526] Read of size 1 at addr ffff888103926000 by task kunit_try_catch/231
[   14.487899] 
[   14.488012] CPU: 0 UID: 0 PID: 231 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   14.488067] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.488080] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.488105] Call Trace:
[   14.488121]  <TASK>
[   14.488143]  dump_stack_lvl+0x73/0xb0
[   14.488181]  print_report+0xd1/0x650
[   14.488207]  ? __virt_addr_valid+0x1db/0x2d0
[   14.488235]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   14.488261]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.488288]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   14.488313]  kasan_report+0x141/0x180
[   14.488338]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   14.488369]  __asan_report_load1_noabort+0x18/0x20
[   14.488397]  kmem_cache_rcu_uaf+0x3e3/0x510
[   14.488422]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   14.488532]  ? finish_task_switch.isra.0+0x153/0x700
[   14.488560]  ? __switch_to+0x47/0xf50
[   14.488594]  ? __pfx_read_tsc+0x10/0x10
[   14.488618]  ? ktime_get_ts64+0x86/0x230
[   14.488645]  kunit_try_run_case+0x1a5/0x480
[   14.488675]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.488699]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.488726]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.488751]  ? __kthread_parkme+0x82/0x180
[   14.488775]  ? preempt_count_sub+0x50/0x80
[   14.488809]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.488835]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.488860]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.488886]  kthread+0x337/0x6f0
[   14.488907]  ? trace_preempt_on+0x20/0xc0
[   14.488934]  ? __pfx_kthread+0x10/0x10
[   14.488956]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.488979]  ? calculate_sigpending+0x7b/0xa0
[   14.489006]  ? __pfx_kthread+0x10/0x10
[   14.489029]  ret_from_fork+0x116/0x1d0
[   14.489050]  ? __pfx_kthread+0x10/0x10
[   14.489072]  ret_from_fork_asm+0x1a/0x30
[   14.489107]  </TASK>
[   14.489121] 
[   14.500477] Allocated by task 231:
[   14.500746]  kasan_save_stack+0x45/0x70
[   14.501019]  kasan_save_track+0x18/0x40
[   14.501218]  kasan_save_alloc_info+0x3b/0x50
[   14.501390]  __kasan_slab_alloc+0x91/0xa0
[   14.501731]  kmem_cache_alloc_noprof+0x123/0x3f0
[   14.502014]  kmem_cache_rcu_uaf+0x155/0x510
[   14.502240]  kunit_try_run_case+0x1a5/0x480
[   14.502810]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.503086]  kthread+0x337/0x6f0
[   14.503290]  ret_from_fork+0x116/0x1d0
[   14.503605]  ret_from_fork_asm+0x1a/0x30
[   14.503885] 
[   14.504005] Freed by task 0:
[   14.504238]  kasan_save_stack+0x45/0x70
[   14.504393]  kasan_save_track+0x18/0x40
[   14.504541]  kasan_save_free_info+0x3f/0x60
[   14.504718]  __kasan_slab_free+0x56/0x70
[   14.504958]  slab_free_after_rcu_debug+0xe4/0x310
[   14.505325]  rcu_core+0x66f/0x1c40
[   14.505629]  rcu_core_si+0x12/0x20
[   14.505859]  handle_softirqs+0x209/0x730
[   14.506082]  __irq_exit_rcu+0xc9/0x110
[   14.506232]  irq_exit_rcu+0x12/0x20
[   14.506373]  sysvec_apic_timer_interrupt+0x81/0x90
[   14.506613]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   14.506923] 
[   14.507050] Last potentially related work creation:
[   14.507675]  kasan_save_stack+0x45/0x70
[   14.507958]  kasan_record_aux_stack+0xb2/0xc0
[   14.508331]  kmem_cache_free+0x131/0x420
[   14.508723]  kmem_cache_rcu_uaf+0x194/0x510
[   14.509667]  kunit_try_run_case+0x1a5/0x480
[   14.509872]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.510176]  kthread+0x337/0x6f0
[   14.510670]  ret_from_fork+0x116/0x1d0
[   14.510908]  ret_from_fork_asm+0x1a/0x30
[   14.511138] 
[   14.511480] The buggy address belongs to the object at ffff888103926000
[   14.511480]  which belongs to the cache test_cache of size 200
[   14.512587] The buggy address is located 0 bytes inside of
[   14.512587]  freed 200-byte region [ffff888103926000, ffff8881039260c8)
[   14.513445] 
[   14.513682] The buggy address belongs to the physical page:
[   14.513954] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103926
[   14.514429] flags: 0x200000000000000(node=0|zone=2)
[   14.514749] page_type: f5(slab)
[   14.514958] raw: 0200000000000000 ffff888103923000 dead000000000122 0000000000000000
[   14.515521] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   14.515931] page dumped because: kasan: bad access detected
[   14.516363] 
[   14.516876] Memory state around the buggy address:
[   14.517128]  ffff888103925f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.517660]  ffff888103925f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.518004] >ffff888103926000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   14.518487]                    ^
[   14.518637]  ffff888103926080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   14.519574]  ffff888103926100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.519916] ==================================================================