Hay
Date
July 25, 2025, 3:13 a.m.

Environment
qemu-arm64
qemu-x86_64

[   33.631318] ==================================================================
[   33.631411] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   33.631493] Read of size 1 at addr fff00000c9adc000 by task kunit_try_catch/245
[   33.631546] 
[   33.631588] CPU: 1 UID: 0 PID: 245 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250725 #1 PREEMPT 
[   33.631704] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   33.631736] Hardware name: linux,dummy-virt (DT)
[   33.631769] Call trace:
[   33.631797]  show_stack+0x20/0x38 (C)
[   33.631849]  dump_stack_lvl+0x8c/0xd0
[   33.631901]  print_report+0x118/0x5e8
[   33.631947]  kasan_report+0xdc/0x128
[   33.631992]  __asan_report_load1_noabort+0x20/0x30
[   33.632041]  kmem_cache_rcu_uaf+0x388/0x468
[   33.632088]  kunit_try_run_case+0x170/0x3f0
[   33.632138]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.632191]  kthread+0x328/0x630
[   33.632236]  ret_from_fork+0x10/0x20
[   33.632284] 
[   33.632303] Allocated by task 245:
[   33.632334]  kasan_save_stack+0x3c/0x68
[   33.632375]  kasan_save_track+0x20/0x40
[   33.632409]  kasan_save_alloc_info+0x40/0x58
[   33.632447]  __kasan_slab_alloc+0xa8/0xb0
[   33.632481]  kmem_cache_alloc_noprof+0x10c/0x398
[   33.632523]  kmem_cache_rcu_uaf+0x12c/0x468
[   33.632562]  kunit_try_run_case+0x170/0x3f0
[   33.632599]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.632652]  kthread+0x328/0x630
[   33.632689]  ret_from_fork+0x10/0x20
[   33.632725] 
[   33.632745] Freed by task 0:
[   33.632772]  kasan_save_stack+0x3c/0x68
[   33.632807]  kasan_save_track+0x20/0x40
[   33.632842]  kasan_save_free_info+0x4c/0x78
[   33.632879]  __kasan_slab_free+0x7c/0xa8
[   33.632914]  slab_free_after_rcu_debug+0xd4/0x2f8
[   33.632954]  rcu_core+0x9f4/0x1e58
[   33.632993]  rcu_core_si+0x18/0x30
[   33.633027]  handle_softirqs+0x374/0xb28
[   33.633065]  __do_softirq+0x1c/0x28
[   33.633100] 
[   33.633118] Last potentially related work creation:
[   33.633146]  kasan_save_stack+0x3c/0x68
[   33.633182]  kasan_record_aux_stack+0xb4/0xc8
[   33.633221]  kmem_cache_free+0x120/0x468
[   33.633259]  kmem_cache_rcu_uaf+0x16c/0x468
[   33.633301]  kunit_try_run_case+0x170/0x3f0
[   33.633339]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.633381]  kthread+0x328/0x630
[   33.633412]  ret_from_fork+0x10/0x20
[   33.633448] 
[   33.633469] The buggy address belongs to the object at fff00000c9adc000
[   33.633469]  which belongs to the cache test_cache of size 200
[   33.633525] The buggy address is located 0 bytes inside of
[   33.633525]  freed 200-byte region [fff00000c9adc000, fff00000c9adc0c8)
[   33.633584] 
[   33.633607] The buggy address belongs to the physical page:
[   33.633657] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109adc
[   33.633713] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   33.633765] page_type: f5(slab)
[   33.633805] raw: 0bfffe0000000000 fff00000c56bcb40 dead000000000122 0000000000000000
[   33.633856] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   33.633896] page dumped because: kasan: bad access detected
[   33.633928] 
[   33.633945] Memory state around the buggy address:
[   33.633980]  fff00000c9adbf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   33.634024]  fff00000c9adbf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   33.634068] >fff00000c9adc000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   33.634107]                    ^
[   33.634135]  fff00000c9adc080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   33.634177]  fff00000c9adc100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   33.634216] ==================================================================

[   26.587047] ==================================================================
[   26.587504] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   26.587881] Read of size 1 at addr ffff88810581a000 by task kunit_try_catch/262
[   26.588563] 
[   26.588904] CPU: 0 UID: 0 PID: 262 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250725 #1 PREEMPT(voluntary) 
[   26.588978] Tainted: [B]=BAD_PAGE, [N]=TEST
[   26.588992] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   26.589017] Call Trace:
[   26.589033]  <TASK>
[   26.589075]  dump_stack_lvl+0x73/0xb0
[   26.589234]  print_report+0xd1/0x640
[   26.589262]  ? __virt_addr_valid+0x1db/0x2d0
[   26.589291]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   26.589316]  ? kasan_complete_mode_report_info+0x64/0x200
[   26.589346]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   26.589371]  kasan_report+0x141/0x180
[   26.589395]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   26.589426]  __asan_report_load1_noabort+0x18/0x20
[   26.589453]  kmem_cache_rcu_uaf+0x3e3/0x510
[   26.589479]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   26.589505]  ? finish_task_switch.isra.0+0x153/0x700
[   26.589531]  ? __switch_to+0x47/0xf80
[   26.589563]  ? __pfx_read_tsc+0x10/0x10
[   26.589587]  ? ktime_get_ts64+0x86/0x230
[   26.589616]  kunit_try_run_case+0x1a5/0x480
[   26.589644]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.589669]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   26.589696]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   26.589724]  ? __kthread_parkme+0x82/0x180
[   26.589747]  ? preempt_count_sub+0x50/0x80
[   26.589772]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.589814]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.589842]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   26.589870]  kthread+0x337/0x6f0
[   26.589892]  ? trace_preempt_on+0x20/0xc0
[   26.589918]  ? __pfx_kthread+0x10/0x10
[   26.589952]  ? _raw_spin_unlock_irq+0x47/0x80
[   26.589978]  ? calculate_sigpending+0x7b/0xa0
[   26.590005]  ? __pfx_kthread+0x10/0x10
[   26.590029]  ret_from_fork+0x116/0x1d0
[   26.590050]  ? __pfx_kthread+0x10/0x10
[   26.590083]  ret_from_fork_asm+0x1a/0x30
[   26.590117]  </TASK>
[   26.590130] 
[   26.600477] Allocated by task 262:
[   26.600968]  kasan_save_stack+0x45/0x70
[   26.601296]  kasan_save_track+0x18/0x40
[   26.601619]  kasan_save_alloc_info+0x3b/0x50
[   26.601976]  __kasan_slab_alloc+0x91/0xa0
[   26.602364]  kmem_cache_alloc_noprof+0x123/0x3f0
[   26.602597]  kmem_cache_rcu_uaf+0x155/0x510
[   26.602783]  kunit_try_run_case+0x1a5/0x480
[   26.603341]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.603562]  kthread+0x337/0x6f0
[   26.603941]  ret_from_fork+0x116/0x1d0
[   26.604182]  ret_from_fork_asm+0x1a/0x30
[   26.604499] 
[   26.604600] Freed by task 0:
[   26.604969]  kasan_save_stack+0x45/0x70
[   26.605277]  kasan_save_track+0x18/0x40
[   26.605449]  kasan_save_free_info+0x3f/0x60
[   26.605968]  __kasan_slab_free+0x5e/0x80
[   26.606208]  slab_free_after_rcu_debug+0xe4/0x310
[   26.606430]  rcu_core+0x66f/0x1c40
[   26.606595]  rcu_core_si+0x12/0x20
[   26.606762]  handle_softirqs+0x209/0x730
[   26.607296]  __irq_exit_rcu+0xc9/0x110
[   26.607452]  irq_exit_rcu+0x12/0x20
[   26.607782]  sysvec_apic_timer_interrupt+0x81/0x90
[   26.608197]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   26.608459] 
[   26.608540] Last potentially related work creation:
[   26.608751]  kasan_save_stack+0x45/0x70
[   26.609236]  kasan_record_aux_stack+0xb2/0xc0
[   26.609421]  kmem_cache_free+0x131/0x420
[   26.610173]  kmem_cache_rcu_uaf+0x194/0x510
[   26.610497]  kunit_try_run_case+0x1a5/0x480
[   26.610805]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.611253]  kthread+0x337/0x6f0
[   26.611460]  ret_from_fork+0x116/0x1d0
[   26.611740]  ret_from_fork_asm+0x1a/0x30
[   26.612017] 
[   26.612198] The buggy address belongs to the object at ffff88810581a000
[   26.612198]  which belongs to the cache test_cache of size 200
[   26.612728] The buggy address is located 0 bytes inside of
[   26.612728]  freed 200-byte region [ffff88810581a000, ffff88810581a0c8)
[   26.613451] 
[   26.613556] The buggy address belongs to the physical page:
[   26.614123] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10581a
[   26.614443] flags: 0x200000000000000(node=0|zone=2)
[   26.614677] page_type: f5(slab)
[   26.614824] raw: 0200000000000000 ffff8881016a5c80 dead000000000122 0000000000000000
[   26.615614] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   26.616068] page dumped because: kasan: bad access detected
[   26.616344] 
[   26.616422] Memory state around the buggy address:
[   26.616601]  ffff888105819f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.616909]  ffff888105819f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.617253] >ffff88810581a000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   26.617519]                    ^
[   26.617680]  ffff88810581a080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   26.617982]  ffff88810581a100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.618340] ==================================================================