Hay
Date
July 8, 2025, 11:09 p.m.

Environment
qemu-arm64
qemu-x86_64

[   20.381303] ==================================================================
[   20.381400] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   20.381478] Read of size 1 at addr fff00000c7730000 by task kunit_try_catch/213
[   20.382868] 
[   20.382932] CPU: 1 UID: 0 PID: 213 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   20.383360] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.383724] Hardware name: linux,dummy-virt (DT)
[   20.383891] Call trace:
[   20.383956]  show_stack+0x20/0x38 (C)
[   20.384015]  dump_stack_lvl+0x8c/0xd0
[   20.384069]  print_report+0x118/0x608
[   20.384367]  kasan_report+0xdc/0x128
[   20.384605]  __asan_report_load1_noabort+0x20/0x30
[   20.384658]  kmem_cache_rcu_uaf+0x388/0x468
[   20.385069]  kunit_try_run_case+0x170/0x3f0
[   20.385152]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.385800]  kthread+0x328/0x630
[   20.386149]  ret_from_fork+0x10/0x20
[   20.386454] 
[   20.386542] Allocated by task 213:
[   20.386574]  kasan_save_stack+0x3c/0x68
[   20.386854]  kasan_save_track+0x20/0x40
[   20.387003]  kasan_save_alloc_info+0x40/0x58
[   20.387071]  __kasan_slab_alloc+0xa8/0xb0
[   20.387319]  kmem_cache_alloc_noprof+0x10c/0x398
[   20.387815]  kmem_cache_rcu_uaf+0x12c/0x468
[   20.387904]  kunit_try_run_case+0x170/0x3f0
[   20.387941]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.387985]  kthread+0x328/0x630
[   20.388505]  ret_from_fork+0x10/0x20
[   20.388555] 
[   20.388589] Freed by task 0:
[   20.388617]  kasan_save_stack+0x3c/0x68
[   20.388792]  kasan_save_track+0x20/0x40
[   20.388829]  kasan_save_free_info+0x4c/0x78
[   20.388869]  __kasan_slab_free+0x6c/0x98
[   20.389284]  slab_free_after_rcu_debug+0xd4/0x2f8
[   20.389512]  rcu_core+0x9f4/0x1e20
[   20.389643]  rcu_core_si+0x18/0x30
[   20.389882]  handle_softirqs+0x374/0xb28
[   20.390052]  __do_softirq+0x1c/0x28
[   20.390088] 
[   20.390281] Last potentially related work creation:
[   20.390315]  kasan_save_stack+0x3c/0x68
[   20.390631]  kasan_record_aux_stack+0xb4/0xc8
[   20.390676]  kmem_cache_free+0x120/0x468
[   20.390714]  kmem_cache_rcu_uaf+0x16c/0x468
[   20.391177]  kunit_try_run_case+0x170/0x3f0
[   20.391228]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.391354]  kthread+0x328/0x630
[   20.391388]  ret_from_fork+0x10/0x20
[   20.391663] 
[   20.391844] The buggy address belongs to the object at fff00000c7730000
[   20.391844]  which belongs to the cache test_cache of size 200
[   20.391924] The buggy address is located 0 bytes inside of
[   20.391924]  freed 200-byte region [fff00000c7730000, fff00000c77300c8)
[   20.392282] 
[   20.392307] The buggy address belongs to the physical page:
[   20.392342] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107730
[   20.392401] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   20.392454] page_type: f5(slab)
[   20.392497] raw: 0bfffe0000000000 fff00000c63df3c0 dead000000000122 0000000000000000
[   20.392550] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   20.392591] page dumped because: kasan: bad access detected
[   20.392623] 
[   20.392641] Memory state around the buggy address:
[   20.392675]  fff00000c772ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.392719]  fff00000c772ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.393371] >fff00000c7730000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   20.393456]                    ^
[   20.393486]  fff00000c7730080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   20.393690]  fff00000c7730100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.394073] ==================================================================

[   13.337123] ==================================================================
[   13.337655] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   13.337983] Read of size 1 at addr ffff888102b96000 by task kunit_try_catch/231
[   13.338284] 
[   13.338388] CPU: 0 UID: 0 PID: 231 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   13.338439] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.338450] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.338474] Call Trace:
[   13.338487]  <TASK>
[   13.338507]  dump_stack_lvl+0x73/0xb0
[   13.338541]  print_report+0xd1/0x650
[   13.338564]  ? __virt_addr_valid+0x1db/0x2d0
[   13.338590]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   13.338647]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.338670]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   13.338694]  kasan_report+0x141/0x180
[   13.338716]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   13.338744]  __asan_report_load1_noabort+0x18/0x20
[   13.338769]  kmem_cache_rcu_uaf+0x3e3/0x510
[   13.338792]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   13.338815]  ? finish_task_switch.isra.0+0x153/0x700
[   13.338840]  ? __switch_to+0x47/0xf50
[   13.338870]  ? __pfx_read_tsc+0x10/0x10
[   13.338893]  ? ktime_get_ts64+0x86/0x230
[   13.338918]  kunit_try_run_case+0x1a5/0x480
[   13.339228]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.339254]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.339280]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.339305]  ? __kthread_parkme+0x82/0x180
[   13.339327]  ? preempt_count_sub+0x50/0x80
[   13.339351]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.339375]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.339400]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.339426]  kthread+0x337/0x6f0
[   13.339444]  ? trace_preempt_on+0x20/0xc0
[   13.339469]  ? __pfx_kthread+0x10/0x10
[   13.339498]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.339545]  ? calculate_sigpending+0x7b/0xa0
[   13.339570]  ? __pfx_kthread+0x10/0x10
[   13.339592]  ret_from_fork+0x116/0x1d0
[   13.339621]  ? __pfx_kthread+0x10/0x10
[   13.339641]  ret_from_fork_asm+0x1a/0x30
[   13.339674]  </TASK>
[   13.339685] 
[   13.351051] Allocated by task 231:
[   13.351244]  kasan_save_stack+0x45/0x70
[   13.351472]  kasan_save_track+0x18/0x40
[   13.351848]  kasan_save_alloc_info+0x3b/0x50
[   13.352367]  __kasan_slab_alloc+0x91/0xa0
[   13.352709]  kmem_cache_alloc_noprof+0x123/0x3f0
[   13.352898]  kmem_cache_rcu_uaf+0x155/0x510
[   13.353431]  kunit_try_run_case+0x1a5/0x480
[   13.353723]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.354167]  kthread+0x337/0x6f0
[   13.354340]  ret_from_fork+0x116/0x1d0
[   13.354698]  ret_from_fork_asm+0x1a/0x30
[   13.355073] 
[   13.355171] Freed by task 0:
[   13.355292]  kasan_save_stack+0x45/0x70
[   13.355762]  kasan_save_track+0x18/0x40
[   13.356096]  kasan_save_free_info+0x3f/0x60
[   13.356268]  __kasan_slab_free+0x56/0x70
[   13.356469]  slab_free_after_rcu_debug+0xe4/0x310
[   13.356832]  rcu_core+0x66f/0x1c40
[   13.356971]  rcu_core_si+0x12/0x20
[   13.357240]  handle_softirqs+0x209/0x730
[   13.357445]  __irq_exit_rcu+0xc9/0x110
[   13.357903]  irq_exit_rcu+0x12/0x20
[   13.358138]  sysvec_apic_timer_interrupt+0x81/0x90
[   13.358367]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   13.358593] 
[   13.358685] Last potentially related work creation:
[   13.358887]  kasan_save_stack+0x45/0x70
[   13.359384]  kasan_record_aux_stack+0xb2/0xc0
[   13.359559]  kmem_cache_free+0x131/0x420
[   13.359963]  kmem_cache_rcu_uaf+0x194/0x510
[   13.360335]  kunit_try_run_case+0x1a5/0x480
[   13.360531]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.361125]  kthread+0x337/0x6f0
[   13.361392]  ret_from_fork+0x116/0x1d0
[   13.361682]  ret_from_fork_asm+0x1a/0x30
[   13.361919] 
[   13.362223] The buggy address belongs to the object at ffff888102b96000
[   13.362223]  which belongs to the cache test_cache of size 200
[   13.362903] The buggy address is located 0 bytes inside of
[   13.362903]  freed 200-byte region [ffff888102b96000, ffff888102b960c8)
[   13.363753] 
[   13.364055] The buggy address belongs to the physical page:
[   13.364373] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b96
[   13.365105] flags: 0x200000000000000(node=0|zone=2)
[   13.365333] page_type: f5(slab)
[   13.365505] raw: 0200000000000000 ffff888102b91140 dead000000000122 0000000000000000
[   13.365896] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   13.366418] page dumped because: kasan: bad access detected
[   13.366752] 
[   13.366852] Memory state around the buggy address:
[   13.367050]  ffff888102b95f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.367455]  ffff888102b95f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.367807] >ffff888102b96000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   13.368122]                    ^
[   13.368235]  ffff888102b96080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   13.368820]  ffff888102b96100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.369222] ==================================================================