Hay
Date
June 25, 2025, 8:08 a.m.

Environment
qemu-arm64
qemu-x86_64

[   27.968410] ==================================================================
[   27.968505] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   27.968585] Read of size 1 at addr fff00000c78ed000 by task kunit_try_catch/225
[   27.968637] 
[   27.968678] CPU: 0 UID: 0 PID: 225 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250625 #1 PREEMPT 
[   27.968763] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.968790] Hardware name: linux,dummy-virt (DT)
[   27.968824] Call trace:
[   27.968848]  show_stack+0x20/0x38 (C)
[   27.968902]  dump_stack_lvl+0x8c/0xd0
[   27.968959]  print_report+0x118/0x608
[   27.969006]  kasan_report+0xdc/0x128
[   27.969052]  __asan_report_load1_noabort+0x20/0x30
[   27.969100]  kmem_cache_rcu_uaf+0x388/0x468
[   27.969146]  kunit_try_run_case+0x170/0x3f0
[   27.969197]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   27.969251]  kthread+0x328/0x630
[   27.969294]  ret_from_fork+0x10/0x20
[   27.969345] 
[   27.969363] Allocated by task 225:
[   27.969392]  kasan_save_stack+0x3c/0x68
[   27.969444]  kasan_save_track+0x20/0x40
[   27.969482]  kasan_save_alloc_info+0x40/0x58
[   27.969518]  __kasan_slab_alloc+0xa8/0xb0
[   27.969556]  kmem_cache_alloc_noprof+0x10c/0x398
[   27.969598]  kmem_cache_rcu_uaf+0x12c/0x468
[   27.969636]  kunit_try_run_case+0x170/0x3f0
[   27.969672]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   27.969716]  kthread+0x328/0x630
[   27.969746]  ret_from_fork+0x10/0x20
[   27.969784] 
[   27.969802] Freed by task 0:
[   27.969829]  kasan_save_stack+0x3c/0x68
[   27.969865]  kasan_save_track+0x20/0x40
[   27.969902]  kasan_save_free_info+0x4c/0x78
[   27.969936]  __kasan_slab_free+0x6c/0x98
[   27.969974]  slab_free_after_rcu_debug+0xd4/0x2f8
[   27.970013]  rcu_core+0x9f4/0x1e20
[   27.970051]  rcu_core_si+0x18/0x30
[   27.970096]  handle_softirqs+0x374/0xb28
[   27.970132]  __do_softirq+0x1c/0x28
[   27.970166] 
[   27.970185] Last potentially related work creation:
[   27.970211]  kasan_save_stack+0x3c/0x68
[   27.970248]  kasan_record_aux_stack+0xb4/0xc8
[   27.970285]  kmem_cache_free+0x120/0x468
[   27.970322]  kmem_cache_rcu_uaf+0x16c/0x468
[   27.970358]  kunit_try_run_case+0x170/0x3f0
[   27.970405]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   27.970447]  kthread+0x328/0x630
[   27.970482]  ret_from_fork+0x10/0x20
[   27.970516] 
[   27.970535] The buggy address belongs to the object at fff00000c78ed000
[   27.970535]  which belongs to the cache test_cache of size 200
[   27.970591] The buggy address is located 0 bytes inside of
[   27.970591]  freed 200-byte region [fff00000c78ed000, fff00000c78ed0c8)
[   27.970653] 
[   27.970676] The buggy address belongs to the physical page:
[   27.970710] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1078ed
[   27.970765] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   27.970818] page_type: f5(slab)
[   27.970859] raw: 0bfffe0000000000 fff00000c790a140 dead000000000122 0000000000000000
[   27.970909] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   27.970951] page dumped because: kasan: bad access detected
[   27.970984] 
[   27.971003] Memory state around the buggy address:
[   27.971036]  fff00000c78ecf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   27.971080]  fff00000c78ecf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   27.971123] >fff00000c78ed000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   27.971161]                    ^
[   27.971188]  fff00000c78ed080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   27.971230]  fff00000c78ed100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.971269] ==================================================================

[   22.643210] ==================================================================
[   22.643668] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   22.644199] Read of size 1 at addr ffff888103ac1000 by task kunit_try_catch/242
[   22.644496] 
[   22.644588] CPU: 1 UID: 0 PID: 242 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250625 #1 PREEMPT(voluntary) 
[   22.644641] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.644654] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   22.644676] Call Trace:
[   22.644690]  <TASK>
[   22.644709]  dump_stack_lvl+0x73/0xb0
[   22.644739]  print_report+0xd1/0x650
[   22.644761]  ? __virt_addr_valid+0x1db/0x2d0
[   22.644787]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   22.644809]  ? kasan_complete_mode_report_info+0x64/0x200
[   22.644835]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   22.644858]  kasan_report+0x141/0x180
[   22.644881]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   22.644914]  __asan_report_load1_noabort+0x18/0x20
[   22.644937]  kmem_cache_rcu_uaf+0x3e3/0x510
[   22.644973]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   22.644994]  ? finish_task_switch.isra.0+0x153/0x700
[   22.645016]  ? __switch_to+0x47/0xf50
[   22.645052]  ? __pfx_read_tsc+0x10/0x10
[   22.645073]  ? ktime_get_ts64+0x86/0x230
[   22.645103]  kunit_try_run_case+0x1a5/0x480
[   22.645130]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.645151]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   22.645173]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   22.645199]  ? __kthread_parkme+0x82/0x180
[   22.645220]  ? preempt_count_sub+0x50/0x80
[   22.645246]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.645270]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.645294]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   22.645316]  kthread+0x337/0x6f0
[   22.645335]  ? trace_preempt_on+0x20/0xc0
[   22.645360]  ? __pfx_kthread+0x10/0x10
[   22.645381]  ? _raw_spin_unlock_irq+0x47/0x80
[   22.645403]  ? calculate_sigpending+0x7b/0xa0
[   22.645428]  ? __pfx_kthread+0x10/0x10
[   22.645451]  ret_from_fork+0x116/0x1d0
[   22.645468]  ? __pfx_kthread+0x10/0x10
[   22.645489]  ret_from_fork_asm+0x1a/0x30
[   22.645530]  </TASK>
[   22.645540] 
[   22.653069] Allocated by task 242:
[   22.653318]  kasan_save_stack+0x45/0x70
[   22.653529]  kasan_save_track+0x18/0x40
[   22.653674]  kasan_save_alloc_info+0x3b/0x50
[   22.653935]  __kasan_slab_alloc+0x91/0xa0
[   22.654340]  kmem_cache_alloc_noprof+0x123/0x3f0
[   22.654527]  kmem_cache_rcu_uaf+0x155/0x510
[   22.654726]  kunit_try_run_case+0x1a5/0x480
[   22.655140]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.655319]  kthread+0x337/0x6f0
[   22.655432]  ret_from_fork+0x116/0x1d0
[   22.655571]  ret_from_fork_asm+0x1a/0x30
[   22.655757] 
[   22.655841] Freed by task 0:
[   22.656065]  kasan_save_stack+0x45/0x70
[   22.656335]  kasan_save_track+0x18/0x40
[   22.656677]  kasan_save_free_info+0x3f/0x60
[   22.657384]  __kasan_slab_free+0x56/0x70
[   22.657527]  slab_free_after_rcu_debug+0xe4/0x310
[   22.657730]  rcu_core+0x66f/0x1c40
[   22.658470]  rcu_core_si+0x12/0x20
[   22.658644]  handle_softirqs+0x209/0x730
[   22.658792]  __irq_exit_rcu+0xc9/0x110
[   22.659656]  irq_exit_rcu+0x12/0x20
[   22.659964]  sysvec_apic_timer_interrupt+0x81/0x90
[   22.660216]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   22.660672] 
[   22.660791] Last potentially related work creation:
[   22.661278]  kasan_save_stack+0x45/0x70
[   22.661441]  kasan_record_aux_stack+0xb2/0xc0
[   22.661773]  kmem_cache_free+0x131/0x420
[   22.662025]  kmem_cache_rcu_uaf+0x194/0x510
[   22.662435]  kunit_try_run_case+0x1a5/0x480
[   22.662634]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.663110]  kthread+0x337/0x6f0
[   22.663368]  ret_from_fork+0x116/0x1d0
[   22.663568]  ret_from_fork_asm+0x1a/0x30
[   22.663773] 
[   22.663859] The buggy address belongs to the object at ffff888103ac1000
[   22.663859]  which belongs to the cache test_cache of size 200
[   22.664604] The buggy address is located 0 bytes inside of
[   22.664604]  freed 200-byte region [ffff888103ac1000, ffff888103ac10c8)
[   22.665289] 
[   22.665389] The buggy address belongs to the physical page:
[   22.665630] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103ac1
[   22.666044] flags: 0x200000000000000(node=0|zone=2)
[   22.666530] page_type: f5(slab)
[   22.666670] raw: 0200000000000000 ffff888103ae5140 dead000000000122 0000000000000000
[   22.667389] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   22.667705] page dumped because: kasan: bad access detected
[   22.668340] 
[   22.668428] Memory state around the buggy address:
[   22.668867]  ffff888103ac0f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.669374]  ffff888103ac0f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.669660] >ffff888103ac1000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   22.670285]                    ^
[   22.670432]  ffff888103ac1080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   22.671053]  ffff888103ac1100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.671396] ==================================================================