Hay
Date
July 20, 2025, 11:12 a.m.

Environment
qemu-arm64
qemu-x86_64

[   16.380337] ==================================================================
[   16.380449] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   16.380727] Read of size 1 at addr fff00000c7017000 by task kunit_try_catch/213
[   16.380882] 
[   16.381010] CPU: 0 UID: 0 PID: 213 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   16.381180] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.381316] Hardware name: linux,dummy-virt (DT)
[   16.381452] Call trace:
[   16.381507]  show_stack+0x20/0x38 (C)
[   16.381559]  dump_stack_lvl+0x8c/0xd0
[   16.381614]  print_report+0x118/0x5d0
[   16.381744]  kasan_report+0xdc/0x128
[   16.381889]  __asan_report_load1_noabort+0x20/0x30
[   16.382134]  kmem_cache_rcu_uaf+0x388/0x468
[   16.382182]  kunit_try_run_case+0x170/0x3f0
[   16.382232]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.382283]  kthread+0x328/0x630
[   16.382327]  ret_from_fork+0x10/0x20
[   16.382376] 
[   16.382394] Allocated by task 213:
[   16.382424]  kasan_save_stack+0x3c/0x68
[   16.382464]  kasan_save_track+0x20/0x40
[   16.382501]  kasan_save_alloc_info+0x40/0x58
[   16.382539]  __kasan_slab_alloc+0xa8/0xb0
[   16.382576]  kmem_cache_alloc_noprof+0x10c/0x398
[   16.382623]  kmem_cache_rcu_uaf+0x12c/0x468
[   16.382987]  kunit_try_run_case+0x170/0x3f0
[   16.383081]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.383321]  kthread+0x328/0x630
[   16.383366]  ret_from_fork+0x10/0x20
[   16.383442] 
[   16.383464] Freed by task 0:
[   16.383939]  kasan_save_stack+0x3c/0x68
[   16.384272]  kasan_save_track+0x20/0x40
[   16.384318]  kasan_save_free_info+0x4c/0x78
[   16.384782]  __kasan_slab_free+0x6c/0x98
[   16.384828]  slab_free_after_rcu_debug+0xd4/0x2f8
[   16.384871]  rcu_core+0x9f4/0x1e20
[   16.384909]  rcu_core_si+0x18/0x30
[   16.384942]  handle_softirqs+0x374/0xb28
[   16.384980]  __do_softirq+0x1c/0x28
[   16.385013] 
[   16.385033] Last potentially related work creation:
[   16.385061]  kasan_save_stack+0x3c/0x68
[   16.385098]  kasan_record_aux_stack+0xb4/0xc8
[   16.385138]  kmem_cache_free+0x120/0x468
[   16.385176]  kmem_cache_rcu_uaf+0x16c/0x468
[   16.385211]  kunit_try_run_case+0x170/0x3f0
[   16.385249]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.385291]  kthread+0x328/0x630
[   16.385322]  ret_from_fork+0x10/0x20
[   16.385371] 
[   16.385390] The buggy address belongs to the object at fff00000c7017000
[   16.385390]  which belongs to the cache test_cache of size 200
[   16.385450] The buggy address is located 0 bytes inside of
[   16.385450]  freed 200-byte region [fff00000c7017000, fff00000c70170c8)
[   16.385762] 
[   16.385788] The buggy address belongs to the physical page:
[   16.385823] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107017
[   16.385883] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.386565] page_type: f5(slab)
[   16.386864] raw: 0bfffe0000000000 fff00000c700b280 dead000000000122 0000000000000000
[   16.386917] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   16.386959] page dumped because: kasan: bad access detected
[   16.387398] 
[   16.387452] Memory state around the buggy address:
[   16.387490]  fff00000c7016f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.387599]  fff00000c7016f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.387699] >fff00000c7017000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   16.387737]                    ^
[   16.387767]  fff00000c7017080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   16.387810]  fff00000c7017100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.388031] ==================================================================

[   13.102661] ==================================================================
[   13.103208] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   13.103599] Read of size 1 at addr ffff888102741000 by task kunit_try_catch/230
[   13.104189] 
[   13.104409] CPU: 1 UID: 0 PID: 230 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   13.104458] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.104470] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.104840] Call Trace:
[   13.104856]  <TASK>
[   13.104873]  dump_stack_lvl+0x73/0xb0
[   13.104926]  print_report+0xd1/0x610
[   13.104948]  ? __virt_addr_valid+0x1db/0x2d0
[   13.104970]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   13.104992]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.105014]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   13.105037]  kasan_report+0x141/0x180
[   13.105058]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   13.105084]  __asan_report_load1_noabort+0x18/0x20
[   13.105107]  kmem_cache_rcu_uaf+0x3e3/0x510
[   13.105130]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   13.105151]  ? finish_task_switch.isra.0+0x153/0x700
[   13.105173]  ? __switch_to+0x47/0xf50
[   13.105202]  ? __pfx_read_tsc+0x10/0x10
[   13.105222]  ? ktime_get_ts64+0x86/0x230
[   13.105246]  kunit_try_run_case+0x1a5/0x480
[   13.105271]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.105292]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.105316]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.105338]  ? __kthread_parkme+0x82/0x180
[   13.105370]  ? preempt_count_sub+0x50/0x80
[   13.105391]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.105414]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.105446]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.105468]  kthread+0x337/0x6f0
[   13.105486]  ? trace_preempt_on+0x20/0xc0
[   13.105511]  ? __pfx_kthread+0x10/0x10
[   13.105531]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.105552]  ? calculate_sigpending+0x7b/0xa0
[   13.105576]  ? __pfx_kthread+0x10/0x10
[   13.105595]  ret_from_fork+0x116/0x1d0
[   13.105614]  ? __pfx_kthread+0x10/0x10
[   13.105633]  ret_from_fork_asm+0x1a/0x30
[   13.105663]  </TASK>
[   13.105673] 
[   13.115952] Allocated by task 230:
[   13.116145]  kasan_save_stack+0x45/0x70
[   13.116552]  kasan_save_track+0x18/0x40
[   13.116876]  kasan_save_alloc_info+0x3b/0x50
[   13.117190]  __kasan_slab_alloc+0x91/0xa0
[   13.117373]  kmem_cache_alloc_noprof+0x123/0x3f0
[   13.117862]  kmem_cache_rcu_uaf+0x155/0x510
[   13.118082]  kunit_try_run_case+0x1a5/0x480
[   13.118276]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.118843]  kthread+0x337/0x6f0
[   13.119013]  ret_from_fork+0x116/0x1d0
[   13.119191]  ret_from_fork_asm+0x1a/0x30
[   13.119548] 
[   13.119653] Freed by task 0:
[   13.119771]  kasan_save_stack+0x45/0x70
[   13.120223]  kasan_save_track+0x18/0x40
[   13.120509]  kasan_save_free_info+0x3f/0x60
[   13.120889]  __kasan_slab_free+0x56/0x70
[   13.121112]  slab_free_after_rcu_debug+0xe4/0x310
[   13.121523]  rcu_core+0x66f/0x1c40
[   13.121708]  rcu_core_si+0x12/0x20
[   13.121861]  handle_softirqs+0x209/0x730
[   13.122048]  __irq_exit_rcu+0xc9/0x110
[   13.122226]  irq_exit_rcu+0x12/0x20
[   13.122666]  sysvec_apic_timer_interrupt+0x81/0x90
[   13.122852]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   13.123306] 
[   13.123395] Last potentially related work creation:
[   13.123801]  kasan_save_stack+0x45/0x70
[   13.124156]  kasan_record_aux_stack+0xb2/0xc0
[   13.124331]  kmem_cache_free+0x131/0x420
[   13.124605]  kmem_cache_rcu_uaf+0x194/0x510
[   13.125061]  kunit_try_run_case+0x1a5/0x480
[   13.125258]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.125681]  kthread+0x337/0x6f0
[   13.125862]  ret_from_fork+0x116/0x1d0
[   13.126163]  ret_from_fork_asm+0x1a/0x30
[   13.126321] 
[   13.126757] The buggy address belongs to the object at ffff888102741000
[   13.126757]  which belongs to the cache test_cache of size 200
[   13.127255] The buggy address is located 0 bytes inside of
[   13.127255]  freed 200-byte region [ffff888102741000, ffff8881027410c8)
[   13.128126] 
[   13.128235] The buggy address belongs to the physical page:
[   13.128674] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102741
[   13.129203] flags: 0x200000000000000(node=0|zone=2)
[   13.129613] page_type: f5(slab)
[   13.129784] raw: 0200000000000000 ffff88810100d640 dead000000000122 0000000000000000
[   13.130227] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   13.130649] page dumped because: kasan: bad access detected
[   13.131134] 
[   13.131214] Memory state around the buggy address:
[   13.131771]  ffff888102740f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.132134]  ffff888102740f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.132679] >ffff888102741000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   13.133188]                    ^
[   13.133419]  ffff888102741080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   13.133882]  ffff888102741100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.134264] ==================================================================