Hay
Date
July 3, 2025, 6:13 p.m.

Environment
qemu-arm64
qemu-x86_64

[   18.028440] ==================================================================
[   18.028565] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   18.028674] Read of size 1 at addr fff00000c78cb000 by task kunit_try_catch/213
[   18.028866] 
[   18.028973] CPU: 0 UID: 0 PID: 213 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   18.029109] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.029137] Hardware name: linux,dummy-virt (DT)
[   18.029173] Call trace:
[   18.029196]  show_stack+0x20/0x38 (C)
[   18.029251]  dump_stack_lvl+0x8c/0xd0
[   18.029301]  print_report+0x118/0x608
[   18.029437]  kasan_report+0xdc/0x128
[   18.029542]  __asan_report_load1_noabort+0x20/0x30
[   18.029593]  kmem_cache_rcu_uaf+0x388/0x468
[   18.029665]  kunit_try_run_case+0x170/0x3f0
[   18.029716]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.029771]  kthread+0x328/0x630
[   18.029842]  ret_from_fork+0x10/0x20
[   18.029892] 
[   18.029910] Allocated by task 213:
[   18.029943]  kasan_save_stack+0x3c/0x68
[   18.030142]  kasan_save_track+0x20/0x40
[   18.030293]  kasan_save_alloc_info+0x40/0x58
[   18.030361]  __kasan_slab_alloc+0xa8/0xb0
[   18.030531]  kmem_cache_alloc_noprof+0x10c/0x398
[   18.030663]  kmem_cache_rcu_uaf+0x12c/0x468
[   18.030742]  kunit_try_run_case+0x170/0x3f0
[   18.030851]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.030950]  kthread+0x328/0x630
[   18.031053]  ret_from_fork+0x10/0x20
[   18.031094] 
[   18.031146] Freed by task 0:
[   18.031174]  kasan_save_stack+0x3c/0x68
[   18.031259]  kasan_save_track+0x20/0x40
[   18.031295]  kasan_save_free_info+0x4c/0x78
[   18.031354]  __kasan_slab_free+0x6c/0x98
[   18.031491]  slab_free_after_rcu_debug+0xd4/0x2f8
[   18.031537]  rcu_core+0x9f4/0x1e20
[   18.031715]  rcu_core_si+0x18/0x30
[   18.031838]  handle_softirqs+0x374/0xb28
[   18.031893]  __do_softirq+0x1c/0x28
[   18.032299] 
[   18.032399] Last potentially related work creation:
[   18.032642]  kasan_save_stack+0x3c/0x68
[   18.032721]  kasan_record_aux_stack+0xb4/0xc8
[   18.033153]  kmem_cache_free+0x120/0x468
[   18.033327]  kmem_cache_rcu_uaf+0x16c/0x468
[   18.033368]  kunit_try_run_case+0x170/0x3f0
[   18.033702]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.034080]  kthread+0x328/0x630
[   18.034157]  ret_from_fork+0x10/0x20
[   18.034194] 
[   18.034729] The buggy address belongs to the object at fff00000c78cb000
[   18.034729]  which belongs to the cache test_cache of size 200
[   18.035171] The buggy address is located 0 bytes inside of
[   18.035171]  freed 200-byte region [fff00000c78cb000, fff00000c78cb0c8)
[   18.035239] 
[   18.035261] The buggy address belongs to the physical page:
[   18.035553] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1078cb
[   18.035971] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.036312] page_type: f5(slab)
[   18.036590] raw: 0bfffe0000000000 fff00000c3eaea00 dead000000000122 0000000000000000
[   18.036737] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   18.037109] page dumped because: kasan: bad access detected
[   18.037145] 
[   18.037162] Memory state around the buggy address:
[   18.037197]  fff00000c78caf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.037574]  fff00000c78caf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.037639] >fff00000c78cb000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   18.037678]                    ^
[   18.037715]  fff00000c78cb080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   18.037976]  fff00000c78cb100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.038333] ==================================================================

[   12.206527] ==================================================================
[   12.206987] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   12.208040] Read of size 1 at addr ffff888103343000 by task kunit_try_catch/231
[   12.209205] 
[   12.209572] CPU: 1 UID: 0 PID: 231 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   12.209624] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.209636] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.209658] Call Trace:
[   12.209670]  <TASK>
[   12.209689]  dump_stack_lvl+0x73/0xb0
[   12.209845]  print_report+0xd1/0x650
[   12.209877]  ? __virt_addr_valid+0x1db/0x2d0
[   12.209902]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.209924]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.209945]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.209967]  kasan_report+0x141/0x180
[   12.209987]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.210014]  __asan_report_load1_noabort+0x18/0x20
[   12.210036]  kmem_cache_rcu_uaf+0x3e3/0x510
[   12.210058]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   12.210079]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   12.210122]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   12.210149]  kunit_try_run_case+0x1a5/0x480
[   12.210173]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.210194]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.210217]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.210238]  ? __kthread_parkme+0x82/0x180
[   12.210259]  ? preempt_count_sub+0x50/0x80
[   12.210282]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.210304]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.210326]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.210347]  kthread+0x337/0x6f0
[   12.210365]  ? trace_preempt_on+0x20/0xc0
[   12.210389]  ? __pfx_kthread+0x10/0x10
[   12.210408]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.210428]  ? calculate_sigpending+0x7b/0xa0
[   12.210451]  ? __pfx_kthread+0x10/0x10
[   12.210471]  ret_from_fork+0x116/0x1d0
[   12.210490]  ? __pfx_kthread+0x10/0x10
[   12.210509]  ret_from_fork_asm+0x1a/0x30
[   12.210539]  </TASK>
[   12.210552] 
[   12.220208] Allocated by task 231:
[   12.220633]  kasan_save_stack+0x45/0x70
[   12.220804]  kasan_save_track+0x18/0x40
[   12.221007]  kasan_save_alloc_info+0x3b/0x50
[   12.221245]  __kasan_slab_alloc+0x91/0xa0
[   12.221563]  kmem_cache_alloc_noprof+0x123/0x3f0
[   12.221770]  kmem_cache_rcu_uaf+0x155/0x510
[   12.221980]  kunit_try_run_case+0x1a5/0x480
[   12.222330]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.222570]  kthread+0x337/0x6f0
[   12.222742]  ret_from_fork+0x116/0x1d0
[   12.222902]  ret_from_fork_asm+0x1a/0x30
[   12.223067] 
[   12.223169] Freed by task 0:
[   12.223363]  kasan_save_stack+0x45/0x70
[   12.223502]  kasan_save_track+0x18/0x40
[   12.223772]  kasan_save_free_info+0x3f/0x60
[   12.224043]  __kasan_slab_free+0x56/0x70
[   12.224239]  slab_free_after_rcu_debug+0xe4/0x310
[   12.224537]  rcu_core+0x66f/0x1c40
[   12.224676]  rcu_core_si+0x12/0x20
[   12.224799]  handle_softirqs+0x209/0x730
[   12.225126]  __irq_exit_rcu+0xc9/0x110
[   12.225524]  irq_exit_rcu+0x12/0x20
[   12.225661]  sysvec_apic_timer_interrupt+0x81/0x90
[   12.225873]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   12.226096] 
[   12.226361] Last potentially related work creation:
[   12.226570]  kasan_save_stack+0x45/0x70
[   12.226852]  kasan_record_aux_stack+0xb2/0xc0
[   12.227089]  kmem_cache_free+0x131/0x420
[   12.227961]  kmem_cache_rcu_uaf+0x194/0x510
[   12.228322]  kunit_try_run_case+0x1a5/0x480
[   12.228702]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.228936]  kthread+0x337/0x6f0
[   12.229119]  ret_from_fork+0x116/0x1d0
[   12.229591]  ret_from_fork_asm+0x1a/0x30
[   12.229880] 
[   12.229985] The buggy address belongs to the object at ffff888103343000
[   12.229985]  which belongs to the cache test_cache of size 200
[   12.230785] The buggy address is located 0 bytes inside of
[   12.230785]  freed 200-byte region [ffff888103343000, ffff8881033430c8)
[   12.231558] 
[   12.231662] The buggy address belongs to the physical page:
[   12.231841] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103343
[   12.232534] flags: 0x200000000000000(node=0|zone=2)
[   12.232890] page_type: f5(slab)
[   12.233239] raw: 0200000000000000 ffff888101849640 dead000000000122 0000000000000000
[   12.233935] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   12.234543] page dumped because: kasan: bad access detected
[   12.234740] 
[   12.234949] Memory state around the buggy address:
[   12.235134]  ffff888103342f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.235875]  ffff888103342f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.236418] >ffff888103343000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   12.236673]                    ^
[   12.236978]  ffff888103343080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   12.237495]  ffff888103343100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.237880] ==================================================================