Hay
Date
July 15, 2025, 11:09 a.m.

Environment
qemu-arm64
qemu-x86_64

[   16.773535] ==================================================================
[   16.773651] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x388/0x468
[   16.773730] Read of size 1 at addr fff00000c5953000 by task kunit_try_catch/214
[   16.773782] 
[   16.773824] CPU: 1 UID: 0 PID: 214 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   16.773913] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.773941] Hardware name: linux,dummy-virt (DT)
[   16.773976] Call trace:
[   16.773999]  show_stack+0x20/0x38 (C)
[   16.774052]  dump_stack_lvl+0x8c/0xd0
[   16.774104]  print_report+0x118/0x5d0
[   16.774151]  kasan_report+0xdc/0x128
[   16.774211]  __asan_report_load1_noabort+0x20/0x30
[   16.774262]  kmem_cache_rcu_uaf+0x388/0x468
[   16.774309]  kunit_try_run_case+0x170/0x3f0
[   16.774358]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.774411]  kthread+0x328/0x630
[   16.774453]  ret_from_fork+0x10/0x20
[   16.774505] 
[   16.774522] Allocated by task 214:
[   16.774550]  kasan_save_stack+0x3c/0x68
[   16.774592]  kasan_save_track+0x20/0x40
[   16.774628]  kasan_save_alloc_info+0x40/0x58
[   16.774668]  __kasan_slab_alloc+0xa8/0xb0
[   16.774707]  kmem_cache_alloc_noprof+0x10c/0x398
[   16.774749]  kmem_cache_rcu_uaf+0x12c/0x468
[   16.774788]  kunit_try_run_case+0x170/0x3f0
[   16.774825]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.774869]  kthread+0x328/0x630
[   16.774901]  ret_from_fork+0x10/0x20
[   16.774937] 
[   16.774955] Freed by task 0:
[   16.774982]  kasan_save_stack+0x3c/0x68
[   16.775019]  kasan_save_track+0x20/0x40
[   16.775057]  kasan_save_free_info+0x4c/0x78
[   16.775097]  __kasan_slab_free+0x6c/0x98
[   16.775132]  slab_free_after_rcu_debug+0xd4/0x2f8
[   16.775172]  rcu_core+0x9f4/0x1e20
[   16.775242]  rcu_core_si+0x18/0x30
[   16.775277]  handle_softirqs+0x374/0xb28
[   16.775313]  __do_softirq+0x1c/0x28
[   16.775347] 
[   16.775365] Last potentially related work creation:
[   16.775393]  kasan_save_stack+0x3c/0x68
[   16.775431]  kasan_record_aux_stack+0xb4/0xc8
[   16.775470]  kmem_cache_free+0x120/0x468
[   16.775507]  kmem_cache_rcu_uaf+0x16c/0x468
[   16.775543]  kunit_try_run_case+0x170/0x3f0
[   16.775582]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.775625]  kthread+0x328/0x630
[   16.775656]  ret_from_fork+0x10/0x20
[   16.775691] 
[   16.775709] The buggy address belongs to the object at fff00000c5953000
[   16.775709]  which belongs to the cache test_cache of size 200
[   16.775769] The buggy address is located 0 bytes inside of
[   16.775769]  freed 200-byte region [fff00000c5953000, fff00000c59530c8)
[   16.775834] 
[   16.775855] The buggy address belongs to the physical page:
[   16.775889] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105953
[   16.775948] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.776001] page_type: f5(slab)
[   16.776042] raw: 0bfffe0000000000 fff00000c590f780 dead000000000122 0000000000000000
[   16.776093] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   16.776135] page dumped because: kasan: bad access detected
[   16.776166] 
[   16.776194] Memory state around the buggy address:
[   16.776228]  fff00000c5952f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.776272]  fff00000c5952f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.776318] >fff00000c5953000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   16.776357]                    ^
[   16.776385]  fff00000c5953080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   16.776427]  fff00000c5953100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.776470] ==================================================================

[   13.344522] ==================================================================
[   13.345018] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e3/0x510
[   13.345861] Read of size 1 at addr ffff8881032d8000 by task kunit_try_catch/230
[   13.346328] 
[   13.346953] CPU: 0 UID: 0 PID: 230 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   13.347027] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.347040] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.347061] Call Trace:
[   13.347074]  <TASK>
[   13.347093]  dump_stack_lvl+0x73/0xb0
[   13.347128]  print_report+0xd1/0x610
[   13.347151]  ? __virt_addr_valid+0x1db/0x2d0
[   13.347177]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   13.347200]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.347224]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   13.347247]  kasan_report+0x141/0x180
[   13.347269]  ? kmem_cache_rcu_uaf+0x3e3/0x510
[   13.347297]  __asan_report_load1_noabort+0x18/0x20
[   13.347322]  kmem_cache_rcu_uaf+0x3e3/0x510
[   13.347426]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   13.347450]  ? finish_task_switch.isra.0+0x153/0x700
[   13.347475]  ? __switch_to+0x47/0xf50
[   13.347504]  ? __pfx_read_tsc+0x10/0x10
[   13.347526]  ? ktime_get_ts64+0x86/0x230
[   13.347551]  kunit_try_run_case+0x1a5/0x480
[   13.347577]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.347600]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.347625]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.347649]  ? __kthread_parkme+0x82/0x180
[   13.347670]  ? preempt_count_sub+0x50/0x80
[   13.347693]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.347718]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.347742]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.347781]  kthread+0x337/0x6f0
[   13.347800]  ? trace_preempt_on+0x20/0xc0
[   13.347824]  ? __pfx_kthread+0x10/0x10
[   13.347845]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.347866]  ? calculate_sigpending+0x7b/0xa0
[   13.347891]  ? __pfx_kthread+0x10/0x10
[   13.347913]  ret_from_fork+0x116/0x1d0
[   13.347931]  ? __pfx_kthread+0x10/0x10
[   13.347951]  ret_from_fork_asm+0x1a/0x30
[   13.347983]  </TASK>
[   13.347993] 
[   13.359728] Allocated by task 230:
[   13.359880]  kasan_save_stack+0x45/0x70
[   13.360028]  kasan_save_track+0x18/0x40
[   13.360175]  kasan_save_alloc_info+0x3b/0x50
[   13.360474]  __kasan_slab_alloc+0x91/0xa0
[   13.360792]  kmem_cache_alloc_noprof+0x123/0x3f0
[   13.361007]  kmem_cache_rcu_uaf+0x155/0x510
[   13.361715]  kunit_try_run_case+0x1a5/0x480
[   13.361931]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.362130]  kthread+0x337/0x6f0
[   13.362292]  ret_from_fork+0x116/0x1d0
[   13.362558]  ret_from_fork_asm+0x1a/0x30
[   13.362765] 
[   13.362861] Freed by task 0:
[   13.362989]  kasan_save_stack+0x45/0x70
[   13.363173]  kasan_save_track+0x18/0x40
[   13.363354]  kasan_save_free_info+0x3f/0x60
[   13.364051]  __kasan_slab_free+0x56/0x70
[   13.364258]  slab_free_after_rcu_debug+0xe4/0x310
[   13.364631]  rcu_core+0x66f/0x1c40
[   13.365005]  rcu_core_si+0x12/0x20
[   13.365190]  handle_softirqs+0x209/0x730
[   13.365599]  __irq_exit_rcu+0xc9/0x110
[   13.365794]  irq_exit_rcu+0x12/0x20
[   13.365981]  sysvec_apic_timer_interrupt+0x81/0x90
[   13.366306]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   13.366769] 
[   13.366876] Last potentially related work creation:
[   13.367218]  kasan_save_stack+0x45/0x70
[   13.367488]  kasan_record_aux_stack+0xb2/0xc0
[   13.368004]  kmem_cache_free+0x131/0x420
[   13.368208]  kmem_cache_rcu_uaf+0x194/0x510
[   13.368359]  kunit_try_run_case+0x1a5/0x480
[   13.368652]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.368918]  kthread+0x337/0x6f0
[   13.369076]  ret_from_fork+0x116/0x1d0
[   13.369252]  ret_from_fork_asm+0x1a/0x30
[   13.369829] 
[   13.369927] The buggy address belongs to the object at ffff8881032d8000
[   13.369927]  which belongs to the cache test_cache of size 200
[   13.370907] The buggy address is located 0 bytes inside of
[   13.370907]  freed 200-byte region [ffff8881032d8000, ffff8881032d80c8)
[   13.371533] 
[   13.371633] The buggy address belongs to the physical page:
[   13.371879] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1032d8
[   13.372244] flags: 0x200000000000000(node=0|zone=2)
[   13.372877] page_type: f5(slab)
[   13.373033] raw: 0200000000000000 ffff8881032d5000 dead000000000122 0000000000000000
[   13.373560] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   13.373888] page dumped because: kasan: bad access detected
[   13.374115] 
[   13.374198] Memory state around the buggy address:
[   13.374392]  ffff8881032d7f00: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
[   13.375026]  ffff8881032d7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.375333] >ffff8881032d8000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   13.375922]                    ^
[   13.376084]  ffff8881032d8080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   13.376378]  ffff8881032d8100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.376737] ==================================================================