Hay
Date
June 7, 2025, 10:40 a.m.

Environment
qemu-arm64
qemu-x86_64

[   22.459936] ==================================================================
[   22.461155] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3a4/0x488
[   22.462152] Read of size 1 at addr fff00000c41fc000 by task kunit_try_catch/201
[   22.462998] 
[   22.463607] CPU: 1 UID: 0 PID: 201 Comm: kunit_try_catch Tainted: G    B            N 6.12.33-rc1 #1
[   22.463792] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.463873] Hardware name: linux,dummy-virt (DT)
[   22.463988] Call trace:
[   22.464056]  dump_backtrace+0x9c/0x128
[   22.464180]  show_stack+0x20/0x38
[   22.464231]  dump_stack_lvl+0x8c/0xd0
[   22.464287]  print_report+0x118/0x5f0
[   22.464335]  kasan_report+0xdc/0x128
[   22.464380]  __asan_report_load1_noabort+0x20/0x30
[   22.464429]  kmem_cache_rcu_uaf+0x3a4/0x488
[   22.464479]  kunit_try_run_case+0x170/0x3f0
[   22.464531]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.464586]  kthread+0x24c/0x2d0
[   22.464633]  ret_from_fork+0x10/0x20
[   22.464682] 
[   22.470477] Allocated by task 201:
[   22.470868]  kasan_save_stack+0x3c/0x68
[   22.471490]  kasan_save_track+0x20/0x40
[   22.472156]  kasan_save_alloc_info+0x40/0x58
[   22.472830]  __kasan_slab_alloc+0xa8/0xb0
[   22.473448]  kmem_cache_alloc_noprof+0xf8/0x300
[   22.474132]  kmem_cache_rcu_uaf+0x130/0x488
[   22.474676]  kunit_try_run_case+0x170/0x3f0
[   22.475345]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.476011]  kthread+0x24c/0x2d0
[   22.476487]  ret_from_fork+0x10/0x20
[   22.477084] 
[   22.477426] Freed by task 0:
[   22.477845]  kasan_save_stack+0x3c/0x68
[   22.478299]  kasan_save_track+0x20/0x40
[   22.478714]  kasan_save_free_info+0x4c/0x78
[   22.479350]  __kasan_slab_free+0x6c/0x98
[   22.480015]  slab_free_after_rcu_debug+0xd0/0x2d0
[   22.480791]  rcu_core+0xa54/0x1df8
[   22.481314]  rcu_core_si+0x18/0x30
[   22.481940]  handle_softirqs+0x36c/0xb18
[   22.482561]  __do_softirq+0x1c/0x28
[   22.483146] 
[   22.483461] Last potentially related work creation:
[   22.484090]  kasan_save_stack+0x3c/0x68
[   22.484609]  __kasan_record_aux_stack+0xbc/0xe8
[   22.485246]  kasan_record_aux_stack_noalloc+0x14/0x20
[   22.485866]  kmem_cache_free+0x28c/0x460
[   22.486413]  kmem_cache_rcu_uaf+0x170/0x488
[   22.487021]  kunit_try_run_case+0x170/0x3f0
[   22.487568]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.488228]  kthread+0x24c/0x2d0
[   22.488712]  ret_from_fork+0x10/0x20
[   22.489242] 
[   22.489599] The buggy address belongs to the object at fff00000c41fc000
[   22.489599]  which belongs to the cache test_cache of size 200
[   22.490685] The buggy address is located 0 bytes inside of
[   22.490685]  freed 200-byte region [fff00000c41fc000, fff00000c41fc0c8)
[   22.491869] 
[   22.492208] The buggy address belongs to the physical page:
[   22.493056] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1041fc
[   22.493940] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   22.494781] page_type: f5(slab)
[   22.495331] raw: 0bfffe0000000000 fff00000c4182280 dead000000000122 0000000000000000
[   22.496254] raw: 0000000000000000 00000000800f000f 00000001f5000000 0000000000000000
[   22.497088] page dumped because: kasan: bad access detected
[   22.497725] 
[   22.498069] Memory state around the buggy address:
[   22.498626]  fff00000c41fbf00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   22.499467]  fff00000c41fbf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   22.500208] >fff00000c41fc000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   22.500906]                    ^
[   22.501387]  fff00000c41fc080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   22.502123]  fff00000c41fc100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.502867] ==================================================================

[   19.001838] ==================================================================
[   19.002905] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e5/0x510
[   19.003732] Read of size 1 at addr ffff888102930000 by task kunit_try_catch/218
[   19.004592] 
[   19.004867] CPU: 0 UID: 0 PID: 218 Comm: kunit_try_catch Tainted: G    B            N 6.12.33-rc1 #1
[   19.004980] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.005013] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   19.005068] Call Trace:
[   19.005108]  <TASK>
[   19.005159]  dump_stack_lvl+0x73/0xb0
[   19.005270]  print_report+0xd1/0x640
[   19.005351]  ? __virt_addr_valid+0x1db/0x2d0
[   19.005447]  ? kmem_cache_rcu_uaf+0x3e5/0x510
[   19.005540]  ? kasan_complete_mode_report_info+0x64/0x200
[   19.005615]  ? kmem_cache_rcu_uaf+0x3e5/0x510
[   19.005681]  kasan_report+0x140/0x180
[   19.005757]  ? kmem_cache_rcu_uaf+0x3e5/0x510
[   19.005840]  __asan_report_load1_noabort+0x18/0x20
[   19.005914]  kmem_cache_rcu_uaf+0x3e5/0x510
[   19.005982]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   19.006046]  ? __kasan_check_write+0x18/0x20
[   19.006079]  ? queued_spin_lock_slowpath+0x117/0xb40
[   19.006113]  ? irqentry_exit+0x2a/0x60
[   19.006144]  ? trace_hardirqs_on+0x37/0xe0
[   19.006179]  ? __pfx_read_tsc+0x10/0x10
[   19.006207]  ? ktime_get_ts64+0x84/0x230
[   19.006274]  kunit_try_run_case+0x1a6/0x480
[   19.006309]  ? __pfx_kunit_try_run_case+0x10/0x10
[   19.006340]  ? queued_spin_lock_slowpath+0x117/0xb40
[   19.006369]  ? __kthread_parkme+0x82/0x160
[   19.006397]  ? preempt_count_sub+0x50/0x80
[   19.006428]  ? __pfx_kunit_try_run_case+0x10/0x10
[   19.006456]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   19.006493]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   19.006529]  kthread+0x257/0x310
[   19.006556]  ? __pfx_kthread+0x10/0x10
[   19.006582]  ret_from_fork+0x41/0x80
[   19.006610]  ? __pfx_kthread+0x10/0x10
[   19.006636]  ret_from_fork_asm+0x1a/0x30
[   19.006678]  </TASK>
[   19.006693] 
[   19.020748] Allocated by task 218:
[   19.021149]  kasan_save_stack+0x45/0x70
[   19.021614]  kasan_save_track+0x18/0x40
[   19.021996]  kasan_save_alloc_info+0x3b/0x50
[   19.022388]  __kasan_slab_alloc+0x91/0xa0
[   19.022799]  kmem_cache_alloc_noprof+0x107/0x350
[   19.023331]  kmem_cache_rcu_uaf+0x156/0x510
[   19.023753]  kunit_try_run_case+0x1a6/0x480
[   19.024232]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   19.024768]  kthread+0x257/0x310
[   19.025147]  ret_from_fork+0x41/0x80
[   19.025504]  ret_from_fork_asm+0x1a/0x30
[   19.025924] 
[   19.026146] Freed by task 0:
[   19.026476]  kasan_save_stack+0x45/0x70
[   19.026786]  kasan_save_track+0x18/0x40
[   19.027140]  kasan_save_free_info+0x3f/0x60
[   19.027600]  __kasan_slab_free+0x56/0x70
[   19.028086]  slab_free_after_rcu_debug+0xe4/0x2f0
[   19.028577]  rcu_core+0x683/0x1c80
[   19.029023]  rcu_core_si+0x12/0x20
[   19.029393]  handle_softirqs+0x209/0x730
[   19.029776]  irq_exit_rcu+0x9c/0xd0
[   19.030161]  sysvec_apic_timer_interrupt+0x81/0x90
[   19.030526]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   19.031059] 
[   19.031314] Last potentially related work creation:
[   19.031749]  kasan_save_stack+0x45/0x70
[   19.032192]  __kasan_record_aux_stack+0xae/0xc0
[   19.032664]  kasan_record_aux_stack_noalloc+0xf/0x20
[   19.033147]  kmem_cache_free+0x276/0x400
[   19.033576]  kmem_cache_rcu_uaf+0x195/0x510
[   19.034016]  kunit_try_run_case+0x1a6/0x480
[   19.034447]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   19.034978]  kthread+0x257/0x310
[   19.035315]  ret_from_fork+0x41/0x80
[   19.035706]  ret_from_fork_asm+0x1a/0x30
[   19.036130] 
[   19.036360] The buggy address belongs to the object at ffff888102930000
[   19.036360]  which belongs to the cache test_cache of size 200
[   19.037094] The buggy address is located 0 bytes inside of
[   19.037094]  freed 200-byte region [ffff888102930000, ffff8881029300c8)
[   19.040666] 
[   19.041310] The buggy address belongs to the physical page:
[   19.041668] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102930
[   19.042479] flags: 0x200000000000000(node=0|zone=2)
[   19.043003] page_type: f5(slab)
[   19.043432] raw: 0200000000000000 ffff88810292e000 dead000000000122 0000000000000000
[   19.044160] raw: 0000000000000000 00000000800f000f 00000001f5000000 0000000000000000
[   19.044866] page dumped because: kasan: bad access detected
[   19.045391] 
[   19.045595] Memory state around the buggy address:
[   19.046156]  ffff88810292ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.046837]  ffff88810292ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.047416] >ffff888102930000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   19.047968]                    ^
[   19.048559]  ffff888102930080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   19.049342]  ffff888102930100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.050052] ==================================================================