Hay
Date
June 17, 2025, 3:40 p.m.

Environment
qemu-arm64
qemu-x86_64

[   23.450010] ==================================================================
[   23.450172] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   23.450279] Read of size 1 at addr fff00000c7926000 by task kunit_try_catch/215
[   23.450341] 
[   23.450400] CPU: 0 UID: 0 PID: 215 Comm: kunit_try_catch Tainted: G    B            N  6.15.3-rc1 #1 PREEMPT 
[   23.450503] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.450535] Hardware name: linux,dummy-virt (DT)
[   23.450576] Call trace:
[   23.450605]  show_stack+0x20/0x38 (C)
[   23.450683]  dump_stack_lvl+0x8c/0xd0
[   23.450760]  print_report+0x118/0x608
[   23.450831]  kasan_report+0xdc/0x128
[   23.450897]  __asan_report_load1_noabort+0x20/0x30
[   23.450956]  kmem_cache_rcu_uaf+0x388/0x468
[   23.451012]  kunit_try_run_case+0x170/0x3f0
[   23.451072]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.451135]  kthread+0x328/0x630
[   23.451188]  ret_from_fork+0x10/0x20
[   23.451246] 
[   23.451268] Allocated by task 215:
[   23.451303]  kasan_save_stack+0x3c/0x68
[   23.451351]  kasan_save_track+0x20/0x40
[   23.451393]  kasan_save_alloc_info+0x40/0x58
[   23.451437]  __kasan_slab_alloc+0xa8/0xb0
[   23.451477]  kmem_cache_alloc_noprof+0x10c/0x398
[   23.451521]  kmem_cache_rcu_uaf+0x12c/0x468
[   23.451566]  kunit_try_run_case+0x170/0x3f0
[   23.451611]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.451659]  kthread+0x328/0x630
[   23.451697]  ret_from_fork+0x10/0x20
[   23.451750] 
[   23.451772] Freed by task 0:
[   23.451804]  kasan_save_stack+0x3c/0x68
[   23.451845]  kasan_save_track+0x20/0x40
[   23.451895]  kasan_save_free_info+0x4c/0x78
[   23.451941]  __kasan_slab_free+0x6c/0x98
[   23.451982]  slab_free_after_rcu_debug+0xd4/0x2f8
[   23.452024]  rcu_core+0x9f4/0x1e20
[   23.452065]  rcu_core_si+0x18/0x30
[   23.452101]  handle_softirqs+0x374/0xb28
[   23.452180]  __do_softirq+0x1c/0x28
[   23.452220] 
[   23.452241] Last potentially related work creation:
[   23.452270]  kasan_save_stack+0x3c/0x68
[   23.452313]  kasan_record_aux_stack+0xb4/0xc8
[   23.452355]  kmem_cache_free+0x120/0x468
[   23.452396]  kmem_cache_rcu_uaf+0x16c/0x468
[   23.452441]  kunit_try_run_case+0x170/0x3f0
[   23.452483]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.452532]  kthread+0x328/0x630
[   23.452571]  ret_from_fork+0x10/0x20
[   23.452609] 
[   23.452630] The buggy address belongs to the object at fff00000c7926000
[   23.452630]  which belongs to the cache test_cache of size 200
[   23.452697] The buggy address is located 0 bytes inside of
[   23.452697]  freed 200-byte region [fff00000c7926000, fff00000c79260c8)
[   23.452775] 
[   23.452802] The buggy address belongs to the physical page:
[   23.452840] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107926
[   23.452906] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   23.452967] page_type: f5(slab)
[   23.453018] raw: 0bfffe0000000000 fff00000c5918500 dead000000000122 0000000000000000
[   23.453076] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   23.453124] page dumped because: kasan: bad access detected
[   23.453158] 
[   23.453177] Memory state around the buggy address:
[   23.453217]  fff00000c7925f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   23.453270]  fff00000c7925f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   23.453366] >fff00000c7926000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   23.453412]                    ^
[   23.453446]  fff00000c7926080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   23.453493]  fff00000c7926100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.453536] ==================================================================

[   20.664356] ==================================================================
[   20.665855] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   20.666954] Read of size 1 at addr ffff888102ee2000 by task kunit_try_catch/233
[   20.667903] 
[   20.668119] CPU: 1 UID: 0 PID: 233 Comm: kunit_try_catch Tainted: G    B            N  6.15.3-rc1 #1 PREEMPT(voluntary) 
[   20.668228] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.668256] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   20.668360] Call Trace:
[   20.668397]  <TASK>
[   20.668441]  dump_stack_lvl+0x73/0xb0
[   20.668506]  print_report+0xd1/0x650
[   20.668570]  ? __virt_addr_valid+0x1db/0x2d0
[   20.668643]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   20.668703]  ? kasan_complete_mode_report_info+0x64/0x200
[   20.668772]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   20.668839]  kasan_report+0x141/0x180
[   20.668910]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   20.668989]  __asan_report_load1_noabort+0x18/0x20
[   20.669108]  kmem_cache_rcu_uaf+0x3e3/0x510
[   20.669180]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   20.669235]  ? finish_task_switch.isra.0+0x153/0x700
[   20.669329]  ? __switch_to+0x5d9/0xf60
[   20.669394]  ? dequeue_task_fair+0x166/0x4e0
[   20.669473]  ? __pfx_read_tsc+0x10/0x10
[   20.669535]  ? ktime_get_ts64+0x86/0x230
[   20.669616]  kunit_try_run_case+0x1a5/0x480
[   20.669703]  ? __pfx_kunit_try_run_case+0x10/0x10
[   20.669777]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   20.669854]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   20.669928]  ? __kthread_parkme+0x82/0x180
[   20.670002]  ? preempt_count_sub+0x50/0x80
[   20.670126]  ? __pfx_kunit_try_run_case+0x10/0x10
[   20.670205]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.670277]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   20.670360]  kthread+0x337/0x6f0
[   20.670419]  ? trace_preempt_on+0x20/0xc0
[   20.670493]  ? __pfx_kthread+0x10/0x10
[   20.670550]  ? _raw_spin_unlock_irq+0x47/0x80
[   20.670606]  ? calculate_sigpending+0x7b/0xa0
[   20.670667]  ? __pfx_kthread+0x10/0x10
[   20.670714]  ret_from_fork+0x41/0x80
[   20.670766]  ? __pfx_kthread+0x10/0x10
[   20.670814]  ret_from_fork_asm+0x1a/0x30
[   20.670893]  </TASK>
[   20.670924] 
[   20.686922] Allocated by task 233:
[   20.687404]  kasan_save_stack+0x45/0x70
[   20.687863]  kasan_save_track+0x18/0x40
[   20.688344]  kasan_save_alloc_info+0x3b/0x50
[   20.688757]  __kasan_slab_alloc+0x91/0xa0
[   20.689264]  kmem_cache_alloc_noprof+0x123/0x3f0
[   20.689643]  kmem_cache_rcu_uaf+0x155/0x510
[   20.690141]  kunit_try_run_case+0x1a5/0x480
[   20.690537]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.690919]  kthread+0x337/0x6f0
[   20.691245]  ret_from_fork+0x41/0x80
[   20.691575]  ret_from_fork_asm+0x1a/0x30
[   20.692020] 
[   20.692285] Freed by task 0:
[   20.692642]  kasan_save_stack+0x45/0x70
[   20.693100]  kasan_save_track+0x18/0x40
[   20.693564]  kasan_save_free_info+0x3f/0x60
[   20.694021]  __kasan_slab_free+0x56/0x70
[   20.694495]  slab_free_after_rcu_debug+0xe4/0x310
[   20.694946]  rcu_core+0x66c/0x1c30
[   20.695403]  rcu_core_si+0x12/0x20
[   20.695746]  handle_softirqs+0x209/0x730
[   20.696179]  __irq_exit_rcu+0xc9/0x110
[   20.696583]  irq_exit_rcu+0x12/0x20
[   20.696930]  sysvec_apic_timer_interrupt+0x81/0x90
[   20.697457]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   20.697823] 
[   20.698001] Last potentially related work creation:
[   20.698426]  kasan_save_stack+0x45/0x70
[   20.698836]  kasan_record_aux_stack+0xb2/0xc0
[   20.699323]  kmem_cache_free+0x131/0x420
[   20.699743]  kmem_cache_rcu_uaf+0x194/0x510
[   20.700238]  kunit_try_run_case+0x1a5/0x480
[   20.700696]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.701281]  kthread+0x337/0x6f0
[   20.701628]  ret_from_fork+0x41/0x80
[   20.701940]  ret_from_fork_asm+0x1a/0x30
[   20.702321] 
[   20.702555] The buggy address belongs to the object at ffff888102ee2000
[   20.702555]  which belongs to the cache test_cache of size 200
[   20.703640] The buggy address is located 0 bytes inside of
[   20.703640]  freed 200-byte region [ffff888102ee2000, ffff888102ee20c8)
[   20.704703] 
[   20.704942] The buggy address belongs to the physical page:
[   20.705459] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102ee2
[   20.705949] flags: 0x200000000000000(node=0|zone=2)
[   20.706453] page_type: f5(slab)
[   20.706830] raw: 0200000000000000 ffff888101b20dc0 dead000000000122 0000000000000000
[   20.707552] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   20.708244] page dumped because: kasan: bad access detected
[   20.708626] 
[   20.708805] Memory state around the buggy address:
[   20.709315]  ffff888102ee1f00: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
[   20.709898]  ffff888102ee1f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.710572] >ffff888102ee2000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   20.711161]                    ^
[   20.711503]  ffff888102ee2080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   20.712149]  ffff888102ee2100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.712706] ==================================================================