Hay
Date
May 26, 2025, 9:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   19.028059] ==================================================================
[   19.028427] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   19.028604] Read of size 1 at addr fff00000c794e000 by task kunit_try_catch/213
[   19.028659] 
[   19.028705] CPU: 0 UID: 0 PID: 213 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc7-next-20250526 #1 PREEMPT 
[   19.028795] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.028822] Hardware name: linux,dummy-virt (DT)
[   19.028860] Call trace:
[   19.028885]  show_stack+0x20/0x38 (C)
[   19.028943]  dump_stack_lvl+0x8c/0xd0
[   19.028995]  print_report+0x118/0x608
[   19.029043]  kasan_report+0xdc/0x128
[   19.029086]  __asan_report_load1_noabort+0x20/0x30
[   19.029136]  kmem_cache_rcu_uaf+0x388/0x468
[   19.029182]  kunit_try_run_case+0x170/0x3f0
[   19.029233]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.029285]  kthread+0x328/0x630
[   19.029339]  ret_from_fork+0x10/0x20
[   19.029396] 
[   19.029415] Allocated by task 213:
[   19.029447]  kasan_save_stack+0x3c/0x68
[   19.029492]  kasan_save_track+0x20/0x40
[   19.029530]  kasan_save_alloc_info+0x40/0x58
[   19.029567]  __kasan_slab_alloc+0xa8/0xb0
[   19.029604]  kmem_cache_alloc_noprof+0x10c/0x3a0
[   19.029643]  kmem_cache_rcu_uaf+0x12c/0x468
[   19.029678]  kunit_try_run_case+0x170/0x3f0
[   19.029714]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.029754]  kthread+0x328/0x630
[   19.029785]  ret_from_fork+0x10/0x20
[   19.029820] 
[   19.029838] Freed by task 0:
[   19.029864]  kasan_save_stack+0x3c/0x68
[   19.029899]  kasan_save_track+0x20/0x40
[   19.029935]  kasan_save_free_info+0x4c/0x78
[   19.029973]  __kasan_slab_free+0x6c/0x98
[   19.030019]  slab_free_after_rcu_debug+0xd4/0x2f8
[   19.030091]  rcu_core+0x9f4/0x1e20
[   19.030173]  rcu_core_si+0x18/0x30
[   19.030205]  handle_softirqs+0x374/0xb28
[   19.030761]  __do_softirq+0x1c/0x28
[   19.030908] 
[   19.030933] Last potentially related work creation:
[   19.030963]  kasan_save_stack+0x3c/0x68
[   19.031011]  kasan_record_aux_stack+0xb4/0xc8
[   19.031060]  kmem_cache_free+0x120/0x470
[   19.031097]  kmem_cache_rcu_uaf+0x16c/0x468
[   19.031134]  kunit_try_run_case+0x170/0x3f0
[   19.031170]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.031211]  kthread+0x328/0x630
[   19.031381]  ret_from_fork+0x10/0x20
[   19.031529] 
[   19.031687] The buggy address belongs to the object at fff00000c794e000
[   19.031687]  which belongs to the cache test_cache of size 200
[   19.032142] The buggy address is located 0 bytes inside of
[   19.032142]  freed 200-byte region [fff00000c794e000, fff00000c794e0c8)
[   19.033113] 
[   19.033266] The buggy address belongs to the physical page:
[   19.033329] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10794e
[   19.033399] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.033853] page_type: f5(slab)
[   19.034152] raw: 0bfffe0000000000 fff00000c794a140 dead000000000122 0000000000000000
[   19.034442] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   19.034590] page dumped because: kasan: bad access detected
[   19.034628] 
[   19.034647] Memory state around the buggy address:
[   19.034744]  fff00000c794df00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.035104]  fff00000c794df80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.035206] >fff00000c794e000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   19.035247]                    ^
[   19.035334]  fff00000c794e080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   19.035381]  fff00000c794e100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.035422] ==================================================================


[   11.777347] ==================================================================
[   11.778146] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   11.778475] Read of size 1 at addr ffff88810397b000 by task kunit_try_catch/231
[   11.778982] 
[   11.779138] CPU: 0 UID: 0 PID: 231 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc7-next-20250526 #1 PREEMPT(voluntary) 
[   11.779185] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.779197] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.779220] Call Trace:
[   11.779232]  <TASK>
[   11.779250]  dump_stack_lvl+0x73/0xb0
[   11.779524]  print_report+0xd1/0x650
[   11.779551]  ? __virt_addr_valid+0x1db/0x2d0
[   11.779577]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   11.779600]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.779624]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   11.779663]  kasan_report+0x141/0x180
[   11.779685]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   11.779713]  __asan_report_load1_noabort+0x18/0x20
[   11.779734]  kmem_cache_rcu_uaf+0x3e3/0x510
[   11.779758]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   11.779780]  ? finish_task_switch.isra.0+0x153/0x700
[   11.779803]  ? __switch_to+0x47/0xf50
[   11.779833]  ? __pfx_read_tsc+0x10/0x10
[   11.779854]  ? ktime_get_ts64+0x86/0x230
[   11.779880]  kunit_try_run_case+0x1a5/0x480
[   11.779908]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.779927]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.779954]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.779979]  ? __kthread_parkme+0x82/0x180
[   11.779999]  ? preempt_count_sub+0x50/0x80
[   11.780021]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.780042]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.780066]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.780090]  kthread+0x337/0x6f0
[   11.780109]  ? trace_preempt_on+0x20/0xc0
[   11.780133]  ? __pfx_kthread+0x10/0x10
[   11.780154]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.780175]  ? calculate_sigpending+0x7b/0xa0
[   11.780199]  ? __pfx_kthread+0x10/0x10
[   11.780221]  ret_from_fork+0x116/0x1d0
[   11.780239]  ? __pfx_kthread+0x10/0x10
[   11.780259]  ret_from_fork_asm+0x1a/0x30
[   11.780290]  </TASK>
[   11.780300] 
[   11.788959] Allocated by task 231:
[   11.789207]  kasan_save_stack+0x45/0x70
[   11.789478]  kasan_save_track+0x18/0x40
[   11.789800]  kasan_save_alloc_info+0x3b/0x50
[   11.790070]  __kasan_slab_alloc+0x91/0xa0
[   11.790343]  kmem_cache_alloc_noprof+0x123/0x3f0
[   11.790556]  kmem_cache_rcu_uaf+0x155/0x510
[   11.790766]  kunit_try_run_case+0x1a5/0x480
[   11.791170]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.791450]  kthread+0x337/0x6f0
[   11.791724]  ret_from_fork+0x116/0x1d0
[   11.791929]  ret_from_fork_asm+0x1a/0x30
[   11.792337] 
[   11.792432] Freed by task 0:
[   11.792586]  kasan_save_stack+0x45/0x70
[   11.792768]  kasan_save_track+0x18/0x40
[   11.793044]  kasan_save_free_info+0x3f/0x60
[   11.793374]  __kasan_slab_free+0x56/0x70
[   11.793634]  slab_free_after_rcu_debug+0xe4/0x310
[   11.793815]  rcu_core+0x66f/0x1c40
[   11.794222]  rcu_core_si+0x12/0x20
[   11.794468]  handle_softirqs+0x209/0x730
[   11.794640]  __irq_exit_rcu+0xc9/0x110
[   11.794863]  irq_exit_rcu+0x12/0x20
[   11.795260]  sysvec_apic_timer_interrupt+0x81/0x90
[   11.795496]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   11.795746] 
[   11.795911] Last potentially related work creation:
[   11.796295]  kasan_save_stack+0x45/0x70
[   11.796514]  kasan_record_aux_stack+0xb2/0xc0
[   11.796769]  kmem_cache_free+0x131/0x420
[   11.796955]  kmem_cache_rcu_uaf+0x194/0x510
[   11.797337]  kunit_try_run_case+0x1a5/0x480
[   11.797573]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.797876]  kthread+0x337/0x6f0
[   11.798188]  ret_from_fork+0x116/0x1d0
[   11.798460]  ret_from_fork_asm+0x1a/0x30
[   11.798708] 
[   11.798790] The buggy address belongs to the object at ffff88810397b000
[   11.798790]  which belongs to the cache test_cache of size 200
[   11.799443] The buggy address is located 0 bytes inside of
[   11.799443]  freed 200-byte region [ffff88810397b000, ffff88810397b0c8)
[   11.800402] 
[   11.800507] The buggy address belongs to the physical page:
[   11.800717] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10397b
[   11.801194] flags: 0x200000000000000(node=0|zone=2)
[   11.801407] page_type: f5(slab)
[   11.801585] raw: 0200000000000000 ffff88810189ca00 dead000000000122 0000000000000000
[   11.802072] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   11.802467] page dumped because: kasan: bad access detected
[   11.802856] 
[   11.803007] Memory state around the buggy address:
[   11.803341]  ffff88810397af00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.803670]  ffff88810397af80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.804125] >ffff88810397b000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   11.804457]                    ^
[   11.804628]  ffff88810397b080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   11.804989]  ffff88810397b100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.805328] ==================================================================