Hay
Date
June 2, 2025, 2:10 p.m.

Environment
qemu-arm64
qemu-x86_64

[   20.883906] ==================================================================
[   20.884712] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3a4/0x488
[   20.885251] Read of size 1 at addr fff00000c6cf8000 by task kunit_try_catch/200
[   20.885673] 
[   20.885906] CPU: 0 UID: 0 PID: 200 Comm: kunit_try_catch Tainted: G    B            N 6.12.32-rc1 #1
[   20.886023] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.886059] Hardware name: linux,dummy-virt (DT)
[   20.886103] Call trace:
[   20.886133]  dump_backtrace+0x9c/0x128
[   20.886190]  show_stack+0x20/0x38
[   20.886234]  dump_stack_lvl+0x8c/0xd0
[   20.886301]  print_report+0x118/0x5f0
[   20.886343]  kasan_report+0xdc/0x128
[   20.886385]  __asan_report_load1_noabort+0x20/0x30
[   20.886434]  kmem_cache_rcu_uaf+0x3a4/0x488
[   20.886481]  kunit_try_run_case+0x170/0x3f0
[   20.886530]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.886580]  kthread+0x24c/0x2d0
[   20.886626]  ret_from_fork+0x10/0x20
[   20.886674] 
[   20.890197] Allocated by task 200:
[   20.890698]  kasan_save_stack+0x3c/0x68
[   20.891236]  kasan_save_track+0x20/0x40
[   20.892741]  kasan_save_alloc_info+0x40/0x58
[   20.893347]  __kasan_slab_alloc+0xa8/0xb0
[   20.893825]  kmem_cache_alloc_noprof+0xf8/0x300
[   20.894291]  kmem_cache_rcu_uaf+0x130/0x488
[   20.894678]  kunit_try_run_case+0x170/0x3f0
[   20.895297]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.896190]  kthread+0x24c/0x2d0
[   20.896557]  ret_from_fork+0x10/0x20
[   20.896840] 
[   20.897524] Freed by task 0:
[   20.898036]  kasan_save_stack+0x3c/0x68
[   20.898569]  kasan_save_track+0x20/0x40
[   20.899184]  kasan_save_free_info+0x4c/0x78
[   20.899829]  __kasan_slab_free+0x6c/0x98
[   20.900313]  slab_free_after_rcu_debug+0xd0/0x2d0
[   20.900777]  rcu_core+0xa54/0x1df8
[   20.901316]  rcu_core_si+0x18/0x30
[   20.901751]  handle_softirqs+0x36c/0xb18
[   20.902252]  __do_softirq+0x1c/0x28
[   20.902656] 
[   20.902917] Last potentially related work creation:
[   20.903535]  kasan_save_stack+0x3c/0x68
[   20.903997]  __kasan_record_aux_stack+0xbc/0xe8
[   20.904440]  kasan_record_aux_stack_noalloc+0x14/0x20
[   20.904960]  kmem_cache_free+0x28c/0x460
[   20.907315]  kmem_cache_rcu_uaf+0x170/0x488
[   20.908673]  kunit_try_run_case+0x170/0x3f0
[   20.909591]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.910571]  kthread+0x24c/0x2d0
[   20.910898]  ret_from_fork+0x10/0x20
[   20.911225] 
[   20.912692] The buggy address belongs to the object at fff00000c6cf8000
[   20.912692]  which belongs to the cache test_cache of size 200
[   20.914563] The buggy address is located 0 bytes inside of
[   20.914563]  freed 200-byte region [fff00000c6cf8000, fff00000c6cf80c8)
[   20.915320] 
[   20.915534] The buggy address belongs to the physical page:
[   20.915940] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106cf8
[   20.918947] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   20.920213] page_type: f5(slab)
[   20.920728] raw: 0bfffe0000000000 fff00000c5a6fb40 dead000000000122 0000000000000000
[   20.921596] raw: 0000000000000000 00000000800f000f 00000001f5000000 0000000000000000
[   20.922168] page dumped because: kasan: bad access detected
[   20.922789] 
[   20.923060] Memory state around the buggy address:
[   20.923786]  fff00000c6cf7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.924638]  fff00000c6cf7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.925707] >fff00000c6cf8000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   20.926490]                    ^
[   20.926964]  fff00000c6cf8080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   20.928065]  fff00000c6cf8100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.928719] ==================================================================

[   12.886502] ==================================================================
[   12.886907] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e5/0x510
[   12.887072] Read of size 1 at addr ffff888102628000 by task kunit_try_catch/218
[   12.887198] 
[   12.887267] CPU: 0 UID: 0 PID: 218 Comm: kunit_try_catch Tainted: G    B            N 6.12.32-rc1 #1
[   12.887313] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.887324] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.887346] Call Trace:
[   12.887361]  <TASK>
[   12.887383]  dump_stack_lvl+0x73/0xb0
[   12.887410]  print_report+0xd1/0x640
[   12.887432]  ? __virt_addr_valid+0x1db/0x2d0
[   12.887455]  ? kmem_cache_rcu_uaf+0x3e5/0x510
[   12.887474]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.887494]  ? kmem_cache_rcu_uaf+0x3e5/0x510
[   12.887513]  kasan_report+0x140/0x180
[   12.887534]  ? kmem_cache_rcu_uaf+0x3e5/0x510
[   12.887556]  __asan_report_load1_noabort+0x18/0x20
[   12.887575]  kmem_cache_rcu_uaf+0x3e5/0x510
[   12.887593]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   12.887610]  ? finish_task_switch.isra.0+0x153/0x700
[   12.887631]  ? __switch_to+0x5d9/0xf60
[   12.887655]  ? __pfx_read_tsc+0x10/0x10
[   12.887696]  ? ktime_get_ts64+0x84/0x230
[   12.887734]  kunit_try_run_case+0x1a6/0x480
[   12.887768]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.887796]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   12.887830]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.887869]  ? __kthread_parkme+0x82/0x160
[   12.887899]  ? preempt_count_sub+0x50/0x80
[   12.888637]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.888694]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.888743]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.888794]  kthread+0x257/0x310
[   12.888831]  ? __pfx_kthread+0x10/0x10
[   12.888870]  ret_from_fork+0x41/0x80
[   12.888915]  ? __pfx_kthread+0x10/0x10
[   12.888954]  ret_from_fork_asm+0x1a/0x30
[   12.888998]  </TASK>
[   12.889012] 
[   12.899285] Allocated by task 218:
[   12.899628]  kasan_save_stack+0x45/0x70
[   12.899960]  kasan_save_track+0x18/0x40
[   12.900497]  kasan_save_alloc_info+0x3b/0x50
[   12.900819]  __kasan_slab_alloc+0x91/0xa0
[   12.901275]  kmem_cache_alloc_noprof+0x107/0x350
[   12.901695]  kmem_cache_rcu_uaf+0x156/0x510
[   12.901927]  kunit_try_run_case+0x1a6/0x480
[   12.902476]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.902725]  kthread+0x257/0x310
[   12.903039]  ret_from_fork+0x41/0x80
[   12.903646]  ret_from_fork_asm+0x1a/0x30
[   12.903838] 
[   12.903990] Freed by task 0:
[   12.904521]  kasan_save_stack+0x45/0x70
[   12.904771]  kasan_save_track+0x18/0x40
[   12.904986]  kasan_save_free_info+0x3f/0x60
[   12.905473]  __kasan_slab_free+0x56/0x70
[   12.905804]  slab_free_after_rcu_debug+0xe4/0x2f0
[   12.906325]  rcu_core+0x683/0x1c80
[   12.906592]  rcu_core_si+0x12/0x20
[   12.906876]  handle_softirqs+0x209/0x730
[   12.907362]  irq_exit_rcu+0x9c/0xd0
[   12.907967]  sysvec_apic_timer_interrupt+0x81/0x90
[   12.908431]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   12.908720] 
[   12.908853] Last potentially related work creation:
[   12.909235]  kasan_save_stack+0x45/0x70
[   12.909808]  __kasan_record_aux_stack+0xae/0xc0
[   12.910157]  kasan_record_aux_stack_noalloc+0xf/0x20
[   12.910680]  kmem_cache_free+0x276/0x400
[   12.911051]  kmem_cache_rcu_uaf+0x195/0x510
[   12.911612]  kunit_try_run_case+0x1a6/0x480
[   12.911811]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.912159]  kthread+0x257/0x310
[   12.912422]  ret_from_fork+0x41/0x80
[   12.912746]  ret_from_fork_asm+0x1a/0x30
[   12.912932] 
[   12.913071] The buggy address belongs to the object at ffff888102628000
[   12.913071]  which belongs to the cache test_cache of size 200
[   12.913799] The buggy address is located 0 bytes inside of
[   12.913799]  freed 200-byte region [ffff888102628000, ffff8881026280c8)
[   12.914829] 
[   12.915034] The buggy address belongs to the physical page:
[   12.915721] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102628
[   12.916417] flags: 0x200000000000000(node=0|zone=2)
[   12.916733] page_type: f5(slab)
[   12.917016] raw: 0200000000000000 ffff888102621280 dead000000000122 0000000000000000
[   12.917362] raw: 0000000000000000 00000000800f000f 00000001f5000000 0000000000000000
[   12.918027] page dumped because: kasan: bad access detected
[   12.918648] 
[   12.918806] Memory state around the buggy address:
[   12.919114]  ffff888102627f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.920009]  ffff888102627f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.920433] >ffff888102628000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   12.920832]                    ^
[   12.921016]  ffff888102628080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   12.921593]  ffff888102628100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.922051] ==================================================================