Hay
Date
July 19, 2025, 11:12 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.573032] ==================================================================
[   16.573134] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   16.573216] Read of size 1 at addr fff00000c77b1000 by task kunit_try_catch/213
[   16.574016] 
[   16.574187] CPU: 1 UID: 0 PID: 213 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   16.574783] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.574813] Hardware name: linux,dummy-virt (DT)
[   16.575201] Call trace:
[   16.575230]  show_stack+0x20/0x38 (C)
[   16.575597]  dump_stack_lvl+0x8c/0xd0
[   16.575660]  print_report+0x118/0x5d0
[   16.575937]  kasan_report+0xdc/0x128
[   16.576059]  __asan_report_load1_noabort+0x20/0x30
[   16.576299]  kmem_cache_rcu_uaf+0x388/0x468
[   16.576348]  kunit_try_run_case+0x170/0x3f0
[   16.576742]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.577224]  kthread+0x328/0x630
[   16.577326]  ret_from_fork+0x10/0x20
[   16.577530] 
[   16.577550] Allocated by task 213:
[   16.577581]  kasan_save_stack+0x3c/0x68
[   16.578021]  kasan_save_track+0x20/0x40
[   16.578135]  kasan_save_alloc_info+0x40/0x58
[   16.578176]  __kasan_slab_alloc+0xa8/0xb0
[   16.578526]  kmem_cache_alloc_noprof+0x10c/0x398
[   16.578578]  kmem_cache_rcu_uaf+0x12c/0x468
[   16.578901]  kunit_try_run_case+0x170/0x3f0
[   16.579061]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.579107]  kthread+0x328/0x630
[   16.579703]  ret_from_fork+0x10/0x20
[   16.579917] 
[   16.579939] Freed by task 0:
[   16.579969]  kasan_save_stack+0x3c/0x68
[   16.580140]  kasan_save_track+0x20/0x40
[   16.580201]  kasan_save_free_info+0x4c/0x78
[   16.580243]  __kasan_slab_free+0x6c/0x98
[   16.580359]  slab_free_after_rcu_debug+0xd4/0x2f8
[   16.580444]  rcu_core+0x9f4/0x1e20
[   16.580602]  rcu_core_si+0x18/0x30
[   16.580725]  handle_softirqs+0x374/0xb28
[   16.580854]  __do_softirq+0x1c/0x28
[   16.581009] 
[   16.581032] Last potentially related work creation:
[   16.581061]  kasan_save_stack+0x3c/0x68
[   16.581568]  kasan_record_aux_stack+0xb4/0xc8
[   16.581850]  kmem_cache_free+0x120/0x468
[   16.581948]  kmem_cache_rcu_uaf+0x16c/0x468
[   16.581984]  kunit_try_run_case+0x170/0x3f0
[   16.582080]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.582128]  kthread+0x328/0x630
[   16.582765]  ret_from_fork+0x10/0x20
[   16.583195] 
[   16.583381] The buggy address belongs to the object at fff00000c77b1000
[   16.583381]  which belongs to the cache test_cache of size 200
[   16.583722] The buggy address is located 0 bytes inside of
[   16.583722]  freed 200-byte region [fff00000c77b1000, fff00000c77b10c8)
[   16.583793] 
[   16.584151] The buggy address belongs to the physical page:
[   16.584258] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1077b1
[   16.584516] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.584579] page_type: f5(slab)
[   16.584624] raw: 0bfffe0000000000 fff00000c5b338c0 dead000000000122 0000000000000000
[   16.585053] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   16.585354] page dumped because: kasan: bad access detected
[   16.585392] 
[   16.585525] Memory state around the buggy address:
[   16.585731]  fff00000c77b0f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.585789]  fff00000c77b0f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.586354] >fff00000c77b1000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   16.586449]                    ^
[   16.586481]  fff00000c77b1080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   16.587017]  fff00000c77b1100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.587281] ==================================================================

[   12.796668] ==================================================================
[   12.797181] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   12.797487] Read of size 1 at addr ffff888102fdc000 by task kunit_try_catch/230
[   12.797897] 
[   12.798041] CPU: 0 UID: 0 PID: 230 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   12.798186] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.798199] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.798222] Call Trace:
[   12.798234]  <TASK>
[   12.798251]  dump_stack_lvl+0x73/0xb0
[   12.798283]  print_report+0xd1/0x610
[   12.798304]  ? __virt_addr_valid+0x1db/0x2d0
[   12.798327]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.798350]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.798425]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.798450]  kasan_report+0x141/0x180
[   12.798471]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.798498]  __asan_report_load1_noabort+0x18/0x20
[   12.798521]  kmem_cache_rcu_uaf+0x3e3/0x510
[   12.798543]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   12.798565]  ? finish_task_switch.isra.0+0x153/0x700
[   12.798611]  ? __switch_to+0x47/0xf50
[   12.798640]  ? __pfx_read_tsc+0x10/0x10
[   12.798660]  ? ktime_get_ts64+0x86/0x230
[   12.798684]  kunit_try_run_case+0x1a5/0x480
[   12.798709]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.798730]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.798772]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.798795]  ? __kthread_parkme+0x82/0x180
[   12.798816]  ? preempt_count_sub+0x50/0x80
[   12.798838]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.798861]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.798882]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.798905]  kthread+0x337/0x6f0
[   12.798924]  ? trace_preempt_on+0x20/0xc0
[   12.798946]  ? __pfx_kthread+0x10/0x10
[   12.798965]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.798986]  ? calculate_sigpending+0x7b/0xa0
[   12.799021]  ? __pfx_kthread+0x10/0x10
[   12.799041]  ret_from_fork+0x116/0x1d0
[   12.799059]  ? __pfx_kthread+0x10/0x10
[   12.799078]  ret_from_fork_asm+0x1a/0x30
[   12.799109]  </TASK>
[   12.799119] 
[   12.809771] Allocated by task 230:
[   12.809958]  kasan_save_stack+0x45/0x70
[   12.810187]  kasan_save_track+0x18/0x40
[   12.810556]  kasan_save_alloc_info+0x3b/0x50
[   12.810904]  __kasan_slab_alloc+0x91/0xa0
[   12.811142]  kmem_cache_alloc_noprof+0x123/0x3f0
[   12.811464]  kmem_cache_rcu_uaf+0x155/0x510
[   12.811771]  kunit_try_run_case+0x1a5/0x480
[   12.811979]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.812215]  kthread+0x337/0x6f0
[   12.812367]  ret_from_fork+0x116/0x1d0
[   12.812554]  ret_from_fork_asm+0x1a/0x30
[   12.812836] 
[   12.812907] Freed by task 0:
[   12.813054]  kasan_save_stack+0x45/0x70
[   12.813583]  kasan_save_track+0x18/0x40
[   12.813720]  kasan_save_free_info+0x3f/0x60
[   12.814315]  __kasan_slab_free+0x56/0x70
[   12.814934]  slab_free_after_rcu_debug+0xe4/0x310
[   12.815188]  rcu_core+0x66f/0x1c40
[   12.815357]  rcu_core_si+0x12/0x20
[   12.815764]  handle_softirqs+0x209/0x730
[   12.816139]  __irq_exit_rcu+0xc9/0x110
[   12.816334]  irq_exit_rcu+0x12/0x20
[   12.816704]  sysvec_apic_timer_interrupt+0x81/0x90
[   12.816926]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   12.817159] 
[   12.817248] Last potentially related work creation:
[   12.817818]  kasan_save_stack+0x45/0x70
[   12.818351]  kasan_record_aux_stack+0xb2/0xc0
[   12.818671]  kmem_cache_free+0x131/0x420
[   12.818849]  kmem_cache_rcu_uaf+0x194/0x510
[   12.819049]  kunit_try_run_case+0x1a5/0x480
[   12.819243]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.819968]  kthread+0x337/0x6f0
[   12.820295]  ret_from_fork+0x116/0x1d0
[   12.820856]  ret_from_fork_asm+0x1a/0x30
[   12.821062] 
[   12.821155] The buggy address belongs to the object at ffff888102fdc000
[   12.821155]  which belongs to the cache test_cache of size 200
[   12.822350] The buggy address is located 0 bytes inside of
[   12.822350]  freed 200-byte region [ffff888102fdc000, ffff888102fdc0c8)
[   12.823562] 
[   12.823806] The buggy address belongs to the physical page:
[   12.824064] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102fdc
[   12.824619] flags: 0x200000000000000(node=0|zone=2)
[   12.824899] page_type: f5(slab)
[   12.825222] raw: 0200000000000000 ffff888102fd9000 dead000000000122 0000000000000000
[   12.825733] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   12.826046] page dumped because: kasan: bad access detected
[   12.826279] 
[   12.826364] Memory state around the buggy address:
[   12.826988]  ffff888102fdbf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.827479]  ffff888102fdbf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.828056] >ffff888102fdc000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   12.828719]                    ^
[   12.829048]  ffff888102fdc080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   12.829352]  ffff888102fdc100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.829914] ==================================================================