Hay
Date
July 1, 2025, 12:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   18.691511] ==================================================================
[   18.691623] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   18.691703] Read of size 1 at addr fff00000c7829000 by task kunit_try_catch/213
[   18.691756] 
[   18.691800] CPU: 1 UID: 0 PID: 213 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   18.691887] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.691913] Hardware name: linux,dummy-virt (DT)
[   18.691949] Call trace:
[   18.691974]  show_stack+0x20/0x38 (C)
[   18.692027]  dump_stack_lvl+0x8c/0xd0
[   18.692080]  print_report+0x118/0x608
[   18.692127]  kasan_report+0xdc/0x128
[   18.692172]  __asan_report_load1_noabort+0x20/0x30
[   18.692224]  kmem_cache_rcu_uaf+0x388/0x468
[   18.692271]  kunit_try_run_case+0x170/0x3f0
[   18.692321]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.692376]  kthread+0x328/0x630
[   18.692420]  ret_from_fork+0x10/0x20
[   18.692486] 
[   18.692505] Allocated by task 213:
[   18.692535]  kasan_save_stack+0x3c/0x68
[   18.692577]  kasan_save_track+0x20/0x40
[   18.692615]  kasan_save_alloc_info+0x40/0x58
[   18.692656]  __kasan_slab_alloc+0xa8/0xb0
[   18.692695]  kmem_cache_alloc_noprof+0x10c/0x398
[   18.692737]  kmem_cache_rcu_uaf+0x12c/0x468
[   18.692776]  kunit_try_run_case+0x170/0x3f0
[   18.692814]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.692857]  kthread+0x328/0x630
[   18.692889]  ret_from_fork+0x10/0x20
[   18.692924] 
[   18.692944] Freed by task 0:
[   18.692970]  kasan_save_stack+0x3c/0x68
[   18.693007]  kasan_save_track+0x20/0x40
[   18.693044]  kasan_save_free_info+0x4c/0x78
[   18.693085]  __kasan_slab_free+0x6c/0x98
[   18.693120]  slab_free_after_rcu_debug+0xd4/0x2f8
[   18.693160]  rcu_core+0x9f4/0x1e20
[   18.693196]  rcu_core_si+0x18/0x30
[   18.693231]  handle_softirqs+0x374/0xb28
[   18.693268]  __do_softirq+0x1c/0x28
[   18.693302] 
[   18.693322] Last potentially related work creation:
[   18.693348]  kasan_save_stack+0x3c/0x68
[   18.693387]  kasan_record_aux_stack+0xb4/0xc8
[   18.693426]  kmem_cache_free+0x120/0x468
[   18.693472]  kmem_cache_rcu_uaf+0x16c/0x468
[   18.693510]  kunit_try_run_case+0x170/0x3f0
[   18.693548]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.693592]  kthread+0x328/0x630
[   18.693623]  ret_from_fork+0x10/0x20
[   18.693659] 
[   18.693677] The buggy address belongs to the object at fff00000c7829000
[   18.693677]  which belongs to the cache test_cache of size 200
[   18.693739] The buggy address is located 0 bytes inside of
[   18.693739]  freed 200-byte region [fff00000c7829000, fff00000c78290c8)
[   18.693802] 
[   18.693824] The buggy address belongs to the physical page:
[   18.693858] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107829
[   18.693917] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.693971] page_type: f5(slab)
[   18.694015] raw: 0bfffe0000000000 fff00000c3e4f500 dead000000000122 0000000000000000
[   18.694066] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   18.694110] page dumped because: kasan: bad access detected
[   18.694140] 
[   18.694158] Memory state around the buggy address:
[   18.694194]  fff00000c7828f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   18.694239]  fff00000c7828f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   18.694285] >fff00000c7829000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   18.694326]                    ^
[   18.694354]  fff00000c7829080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   18.694397]  fff00000c7829100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.694455] ==================================================================

[   12.234257] ==================================================================
[   12.234980] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   12.235496] Read of size 1 at addr ffff888103118000 by task kunit_try_catch/230
[   12.235971] 
[   12.236185] CPU: 0 UID: 0 PID: 230 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   12.236233] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.236245] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.236268] Call Trace:
[   12.236280]  <TASK>
[   12.236319]  dump_stack_lvl+0x73/0xb0
[   12.236352]  print_report+0xd1/0x650
[   12.236375]  ? __virt_addr_valid+0x1db/0x2d0
[   12.236398]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.236419]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.236440]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.236461]  kasan_report+0x141/0x180
[   12.236482]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   12.236508]  __asan_report_load1_noabort+0x18/0x20
[   12.236531]  kmem_cache_rcu_uaf+0x3e3/0x510
[   12.236553]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   12.236575]  ? finish_task_switch.isra.0+0x153/0x700
[   12.236598]  ? __switch_to+0x47/0xf50
[   12.236626]  ? __pfx_read_tsc+0x10/0x10
[   12.236646]  ? ktime_get_ts64+0x86/0x230
[   12.236903]  kunit_try_run_case+0x1a5/0x480
[   12.236930]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.236952]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.236976]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.236998]  ? __kthread_parkme+0x82/0x180
[   12.237017]  ? preempt_count_sub+0x50/0x80
[   12.237070]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.237092]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.237124]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.237280]  kthread+0x337/0x6f0
[   12.237307]  ? trace_preempt_on+0x20/0xc0
[   12.237333]  ? __pfx_kthread+0x10/0x10
[   12.237352]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.237373]  ? calculate_sigpending+0x7b/0xa0
[   12.237396]  ? __pfx_kthread+0x10/0x10
[   12.237417]  ret_from_fork+0x116/0x1d0
[   12.237435]  ? __pfx_kthread+0x10/0x10
[   12.237455]  ret_from_fork_asm+0x1a/0x30
[   12.237484]  </TASK>
[   12.237497] 
[   12.248468] Allocated by task 230:
[   12.248817]  kasan_save_stack+0x45/0x70
[   12.249020]  kasan_save_track+0x18/0x40
[   12.249466]  kasan_save_alloc_info+0x3b/0x50
[   12.249761]  __kasan_slab_alloc+0x91/0xa0
[   12.249982]  kmem_cache_alloc_noprof+0x123/0x3f0
[   12.250534]  kmem_cache_rcu_uaf+0x155/0x510
[   12.250708]  kunit_try_run_case+0x1a5/0x480
[   12.250961]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.251558]  kthread+0x337/0x6f0
[   12.251830]  ret_from_fork+0x116/0x1d0
[   12.252052]  ret_from_fork_asm+0x1a/0x30
[   12.252369] 
[   12.252473] Freed by task 0:
[   12.252700]  kasan_save_stack+0x45/0x70
[   12.253122]  kasan_save_track+0x18/0x40
[   12.253388]  kasan_save_free_info+0x3f/0x60
[   12.253867]  __kasan_slab_free+0x56/0x70
[   12.254044]  slab_free_after_rcu_debug+0xe4/0x310
[   12.254601]  rcu_core+0x66f/0x1c40
[   12.254803]  rcu_core_si+0x12/0x20
[   12.254976]  handle_softirqs+0x209/0x730
[   12.255507]  __irq_exit_rcu+0xc9/0x110
[   12.255687]  irq_exit_rcu+0x12/0x20
[   12.255838]  sysvec_apic_timer_interrupt+0x81/0x90
[   12.256427]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   12.256792] 
[   12.256901] Last potentially related work creation:
[   12.257323]  kasan_save_stack+0x45/0x70
[   12.257508]  kasan_record_aux_stack+0xb2/0xc0
[   12.257967]  kmem_cache_free+0x131/0x420
[   12.258306]  kmem_cache_rcu_uaf+0x194/0x510
[   12.258651]  kunit_try_run_case+0x1a5/0x480
[   12.258852]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.259288]  kthread+0x337/0x6f0
[   12.259497]  ret_from_fork+0x116/0x1d0
[   12.259634]  ret_from_fork_asm+0x1a/0x30
[   12.260011] 
[   12.260154] The buggy address belongs to the object at ffff888103118000
[   12.260154]  which belongs to the cache test_cache of size 200
[   12.260735] The buggy address is located 0 bytes inside of
[   12.260735]  freed 200-byte region [ffff888103118000, ffff8881031180c8)
[   12.261652] 
[   12.261767] The buggy address belongs to the physical page:
[   12.261981] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103118
[   12.262720] flags: 0x200000000000000(node=0|zone=2)
[   12.263064] page_type: f5(slab)
[   12.263456] raw: 0200000000000000 ffff888101ae4c80 dead000000000122 0000000000000000
[   12.263926] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   12.264502] page dumped because: kasan: bad access detected
[   12.264720] 
[   12.264806] Memory state around the buggy address:
[   12.265224]  ffff888103117f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.265935]  ffff888103117f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.266368] >ffff888103118000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   12.266954]                    ^
[   12.267303]  ffff888103118080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   12.267619]  ffff888103118100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.268070] ==================================================================