Hay
Date
May 23, 2025, 11:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   29.225250] ==================================================================
[   29.225479] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   29.225667] Read of size 1 at addr fff00000c777f000 by task kunit_try_catch/215
[   29.227462] 
[   29.227581] CPU: 0 UID: 0 PID: 215 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc7 #1 PREEMPT 
[   29.227760] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.227800] Hardware name: linux,dummy-virt (DT)
[   29.227851] Call trace:
[   29.227887]  show_stack+0x20/0x38 (C)
[   29.228079]  dump_stack_lvl+0x8c/0xd0
[   29.228214]  print_report+0x118/0x608
[   29.228351]  kasan_report+0xdc/0x128
[   29.228476]  __asan_report_load1_noabort+0x20/0x30
[   29.228611]  kmem_cache_rcu_uaf+0x388/0x468
[   29.228730]  kunit_try_run_case+0x170/0x3f0
[   29.228859]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.229081]  kthread+0x328/0x630
[   29.229246]  ret_from_fork+0x10/0x20
[   29.229403] 
[   29.229487] Allocated by task 215:
[   29.229619]  kasan_save_stack+0x3c/0x68
[   29.229781]  kasan_save_track+0x20/0x40
[   29.229907]  kasan_save_alloc_info+0x40/0x58
[   29.230035]  __kasan_slab_alloc+0xa8/0xb0
[   29.230195]  kmem_cache_alloc_noprof+0x10c/0x3a0
[   29.230320]  kmem_cache_rcu_uaf+0x12c/0x468
[   29.230439]  kunit_try_run_case+0x170/0x3f0
[   29.230574]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.230709]  kthread+0x328/0x630
[   29.230820]  ret_from_fork+0x10/0x20
[   29.230924] 
[   29.230982] Freed by task 0:
[   29.231057]  kasan_save_stack+0x3c/0x68
[   29.231162]  kasan_save_track+0x20/0x40
[   29.231269]  kasan_save_free_info+0x4c/0x78
[   29.231391]  __kasan_slab_free+0x6c/0x98
[   29.231508]  slab_free_after_rcu_debug+0xd4/0x2f8
[   29.231616]  rcu_core+0x9f4/0x1e20
[   29.231760]  rcu_core_si+0x18/0x30
[   29.231914]  handle_softirqs+0x374/0xb28
[   29.232042]  __do_softirq+0x1c/0x28
[   29.232137] 
[   29.232191] Last potentially related work creation:
[   29.232273]  kasan_save_stack+0x3c/0x68
[   29.232384]  kasan_record_aux_stack+0xb4/0xc8
[   29.232528]  kmem_cache_free+0x120/0x470
[   29.232679]  kmem_cache_rcu_uaf+0x16c/0x468
[   29.232803]  kunit_try_run_case+0x170/0x3f0
[   29.233003]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.233216]  kthread+0x328/0x630
[   29.233328]  ret_from_fork+0x10/0x20
[   29.233431] 
[   29.233491] The buggy address belongs to the object at fff00000c777f000
[   29.233491]  which belongs to the cache test_cache of size 200
[   29.233636] The buggy address is located 0 bytes inside of
[   29.233636]  freed 200-byte region [fff00000c777f000, fff00000c777f0c8)
[   29.233793] 
[   29.233851] The buggy address belongs to the physical page:
[   29.233944] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10777f
[   29.234111] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   29.234261] page_type: f5(slab)
[   29.234373] raw: 0bfffe0000000000 fff00000c11fd780 dead000000000122 0000000000000000
[   29.234543] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   29.234686] page dumped because: kasan: bad access detected
[   29.234769] 
[   29.234863] Memory state around the buggy address:
[   29.234973]  fff00000c777ef00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.235106]  fff00000c777ef80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.235294] >fff00000c777f000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   29.235478]                    ^
[   29.235604]  fff00000c777f080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   29.235792]  fff00000c777f100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.235910] ==================================================================

[   13.440367] ==================================================================
[   13.440863] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   13.441595] Read of size 1 at addr ffff88810270d000 by task kunit_try_catch/232
[   13.442597] 
[   13.442838] CPU: 0 UID: 0 PID: 232 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc7 #1 PREEMPT(voluntary) 
[   13.442888] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.442900] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.442922] Call Trace:
[   13.442937]  <TASK>
[   13.442956]  dump_stack_lvl+0x73/0xb0
[   13.442989]  print_report+0xd1/0x650
[   13.443013]  ? __virt_addr_valid+0x1db/0x2d0
[   13.443038]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   13.443059]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.443083]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   13.443104]  kasan_report+0x141/0x180
[   13.443128]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   13.443154]  __asan_report_load1_noabort+0x18/0x20
[   13.443176]  kmem_cache_rcu_uaf+0x3e3/0x510
[   13.443197]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   13.443218]  ? finish_task_switch.isra.0+0x153/0x700
[   13.443244]  ? __switch_to+0x5d9/0xf60
[   13.443266]  ? dequeue_task_fair+0x166/0x4e0
[   13.443306]  ? __pfx_read_tsc+0x10/0x10
[   13.443329]  ? ktime_get_ts64+0x86/0x230
[   13.443356]  kunit_try_run_case+0x1a5/0x480
[   13.443382]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.443406]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.443444]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.443468]  ? __kthread_parkme+0x82/0x180
[   13.443491]  ? preempt_count_sub+0x50/0x80
[   13.443517]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.443541]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.443564]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.443588]  kthread+0x337/0x6f0
[   13.443606]  ? trace_preempt_on+0x20/0xc0
[   13.443631]  ? __pfx_kthread+0x10/0x10
[   13.443650]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.443672]  ? calculate_sigpending+0x7b/0xa0
[   13.443695]  ? __pfx_kthread+0x10/0x10
[   13.443715]  ret_from_fork+0x41/0x80
[   13.443736]  ? __pfx_kthread+0x10/0x10
[   13.443755]  ret_from_fork_asm+0x1a/0x30
[   13.443789]  </TASK>
[   13.443801] 
[   13.454108] Allocated by task 232:
[   13.454350]  kasan_save_stack+0x45/0x70
[   13.454501]  kasan_save_track+0x18/0x40
[   13.454762]  kasan_save_alloc_info+0x3b/0x50
[   13.454984]  __kasan_slab_alloc+0x91/0xa0
[   13.455169]  kmem_cache_alloc_noprof+0x123/0x3f0
[   13.455390]  kmem_cache_rcu_uaf+0x155/0x510
[   13.455535]  kunit_try_run_case+0x1a5/0x480
[   13.455724]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.456021]  kthread+0x337/0x6f0
[   13.456215]  ret_from_fork+0x41/0x80
[   13.456358]  ret_from_fork_asm+0x1a/0x30
[   13.456582] 
[   13.456678] Freed by task 0:
[   13.456894]  kasan_save_stack+0x45/0x70
[   13.457374]  kasan_save_track+0x18/0x40
[   13.457562]  kasan_save_free_info+0x3f/0x60
[   13.458317]  __kasan_slab_free+0x56/0x70
[   13.458581]  slab_free_after_rcu_debug+0xe4/0x310
[   13.458933]  rcu_core+0x66c/0x1c30
[   13.459098]  rcu_core_si+0x12/0x20
[   13.459275]  handle_softirqs+0x209/0x730
[   13.459472]  __irq_exit_rcu+0xc9/0x110
[   13.460200]  irq_exit_rcu+0x12/0x20
[   13.460346]  sysvec_apic_timer_interrupt+0x81/0x90
[   13.460902]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   13.461284] 
[   13.461374] Last potentially related work creation:
[   13.461764]  kasan_save_stack+0x45/0x70
[   13.462066]  kasan_record_aux_stack+0xb2/0xc0
[   13.462519]  kmem_cache_free+0x131/0x420
[   13.462747]  kmem_cache_rcu_uaf+0x194/0x510
[   13.462979]  kunit_try_run_case+0x1a5/0x480
[   13.463287]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.463740]  kthread+0x337/0x6f0
[   13.464009]  ret_from_fork+0x41/0x80
[   13.464335]  ret_from_fork_asm+0x1a/0x30
[   13.464579] 
[   13.464893] The buggy address belongs to the object at ffff88810270d000
[   13.464893]  which belongs to the cache test_cache of size 200
[   13.465421] The buggy address is located 0 bytes inside of
[   13.465421]  freed 200-byte region [ffff88810270d000, ffff88810270d0c8)
[   13.465957] 
[   13.466099] The buggy address belongs to the physical page:
[   13.466400] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10270d
[   13.466772] flags: 0x200000000000000(node=0|zone=2)
[   13.466975] page_type: f5(slab)
[   13.467473] raw: 0200000000000000 ffff888102707280 dead000000000122 0000000000000000
[   13.467759] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   13.468085] page dumped because: kasan: bad access detected
[   13.468335] 
[   13.468612] Memory state around the buggy address:
[   13.468906]  ffff88810270cf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.469322]  ffff88810270cf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.469699] >ffff88810270d000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   13.470118]                    ^
[   13.470291]  ffff88810270d080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   13.470759]  ffff88810270d100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.471085] ==================================================================