Hay
Date
June 2, 2025, 2:13 p.m.

Environment
qemu-arm64
qemu-x86_64

[   19.726742] ==================================================================
[   19.727415] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x390/0x468
[   19.727961] Read of size 1 at addr fff00000c3f5a000 by task kunit_try_catch/203
[   19.728816] 
[   19.728999] CPU: 1 UID: 0 PID: 203 Comm: kunit_try_catch Tainted: G    B            N 6.14.10-rc1 #1
[   19.729104] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.729135] Hardware name: linux,dummy-virt (DT)
[   19.729190] Call trace:
[   19.729218]  show_stack+0x20/0x38 (C)
[   19.729287]  dump_stack_lvl+0x8c/0xd0
[   19.729344]  print_report+0x118/0x608
[   19.729583]  kasan_report+0xdc/0x128
[   19.729648]  __asan_report_load1_noabort+0x20/0x30
[   19.729704]  kmem_cache_rcu_uaf+0x390/0x468
[   19.729757]  kunit_try_run_case+0x170/0x3f0
[   19.729812]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.729867]  kthread+0x318/0x620
[   19.729916]  ret_from_fork+0x10/0x20
[   19.729971] 
[   19.732680] Allocated by task 203:
[   19.732878]  kasan_save_stack+0x3c/0x68
[   19.733095]  kasan_save_track+0x20/0x40
[   19.733378]  kasan_save_alloc_info+0x40/0x58
[   19.733560]  __kasan_slab_alloc+0xa8/0xb0
[   19.733726]  kmem_cache_alloc_noprof+0x10c/0x398
[   19.733896]  kmem_cache_rcu_uaf+0x12c/0x468
[   19.735007]  kunit_try_run_case+0x170/0x3f0
[   19.735638]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.735892]  kthread+0x318/0x620
[   19.736068]  ret_from_fork+0x10/0x20
[   19.736255] 
[   19.736385] Freed by task 0:
[   19.736538]  kasan_save_stack+0x3c/0x68
[   19.736721]  kasan_save_track+0x20/0x40
[   19.736911]  kasan_save_free_info+0x4c/0x78
[   19.737093]  __kasan_slab_free+0x6c/0x98
[   19.738478]  slab_free_after_rcu_debug+0xd4/0x2f8
[   19.738737]  rcu_core+0x9f4/0x1e20
[   19.739034]  rcu_core_si+0x18/0x30
[   19.739637]  handle_softirqs+0x374/0xb28
[   19.739818]  __do_softirq+0x1c/0x28
[   19.739962] 
[   19.740071] Last potentially related work creation:
[   19.740247]  kasan_save_stack+0x3c/0x68
[   19.740447]  kasan_record_aux_stack+0xb4/0xc8
[   19.740656]  kmem_cache_free+0x120/0x468
[   19.740871]  kmem_cache_rcu_uaf+0x16c/0x468
[   19.741077]  kunit_try_run_case+0x170/0x3f0
[   19.742629]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.742948]  kthread+0x318/0x620
[   19.743107]  ret_from_fork+0x10/0x20
[   19.743278] 
[   19.743393] The buggy address belongs to the object at fff00000c3f5a000
[   19.743393]  which belongs to the cache test_cache of size 200
[   19.743856] The buggy address is located 0 bytes inside of
[   19.743856]  freed 200-byte region [fff00000c3f5a000, fff00000c3f5a0c8)
[   19.744674] 
[   19.744834] The buggy address belongs to the physical page:
[   19.745287] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103f5a
[   19.745813] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.746092] page_type: f5(slab)
[   19.746344] raw: 0bfffe0000000000 fff00000c3f5c000 dead000000000122 0000000000000000
[   19.746705] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   19.747043] page dumped because: kasan: bad access detected
[   19.748073] 
[   19.748527] Memory state around the buggy address:
[   19.748839]  fff00000c3f59f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   19.749702]  fff00000c3f59f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   19.750482] >fff00000c3f5a000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   19.751190]                    ^
[   19.751470]  fff00000c3f5a080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   19.752645]  fff00000c3f5a100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.753199] ==================================================================

[   13.484746] ==================================================================
[   13.485818] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e5/0x510
[   13.486289] Read of size 1 at addr ffff888101beb000 by task kunit_try_catch/221
[   13.487033] 
[   13.487136] CPU: 1 UID: 0 PID: 221 Comm: kunit_try_catch Tainted: G    B            N 6.14.10-rc1 #1
[   13.487179] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.487191] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.487211] Call Trace:
[   13.487236]  <TASK>
[   13.487255]  dump_stack_lvl+0x73/0xb0
[   13.487285]  print_report+0xd1/0x650
[   13.487319]  ? __virt_addr_valid+0x1db/0x2d0
[   13.487344]  ? kmem_cache_rcu_uaf+0x3e5/0x510
[   13.487365]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.487390]  ? kmem_cache_rcu_uaf+0x3e5/0x510
[   13.487412]  kasan_report+0x140/0x180
[   13.487433]  ? kmem_cache_rcu_uaf+0x3e5/0x510
[   13.487459]  __asan_report_load1_noabort+0x18/0x20
[   13.487481]  kmem_cache_rcu_uaf+0x3e5/0x510
[   13.487502]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   13.487523]  ? finish_task_switch.isra.0+0x153/0x700
[   13.487547]  ? __switch_to+0x5d9/0xf60
[   13.487576]  ? __pfx_read_tsc+0x10/0x10
[   13.487597]  ? ktime_get_ts64+0x86/0x230
[   13.487622]  kunit_try_run_case+0x1a6/0x480
[   13.487647]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.487667]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   13.487692]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.487714]  ? __kthread_parkme+0x82/0x160
[   13.487737]  ? preempt_count_sub+0x50/0x80
[   13.487760]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.487782]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.487807]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.487832]  kthread+0x324/0x6e0
[   13.487853]  ? trace_preempt_on+0x20/0xc0
[   13.487877]  ? __pfx_kthread+0x10/0x10
[   13.487898]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.487919]  ? calculate_sigpending+0x7b/0xa0
[   13.487941]  ? __pfx_kthread+0x10/0x10
[   13.487962]  ret_from_fork+0x41/0x80
[   13.487980]  ? __pfx_kthread+0x10/0x10
[   13.488002]  ret_from_fork_asm+0x1a/0x30
[   13.488043]  </TASK>
[   13.488053] 
[   13.496439] Allocated by task 221:
[   13.496630]  kasan_save_stack+0x45/0x70
[   13.496814]  kasan_save_track+0x18/0x40
[   13.497000]  kasan_save_alloc_info+0x3b/0x50
[   13.497157]  __kasan_slab_alloc+0x91/0xa0
[   13.497295]  kmem_cache_alloc_noprof+0x124/0x400
[   13.497500]  kmem_cache_rcu_uaf+0x156/0x510
[   13.497754]  kunit_try_run_case+0x1a6/0x480
[   13.497969]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.498237]  kthread+0x324/0x6e0
[   13.498390]  ret_from_fork+0x41/0x80
[   13.498521]  ret_from_fork_asm+0x1a/0x30
[   13.498758] 
[   13.498836] Freed by task 0:
[   13.498987]  kasan_save_stack+0x45/0x70
[   13.499162]  kasan_save_track+0x18/0x40
[   13.499326]  kasan_save_free_info+0x3f/0x60
[   13.499514]  __kasan_slab_free+0x56/0x70
[   13.499888]  slab_free_after_rcu_debug+0xe4/0x310
[   13.500100]  rcu_core+0x680/0x1d70
[   13.500225]  rcu_core_si+0x12/0x20
[   13.500345]  handle_softirqs+0x209/0x730
[   13.500482]  __irq_exit_rcu+0xc9/0x110
[   13.500612]  irq_exit_rcu+0x12/0x20
[   13.500757]  sysvec_apic_timer_interrupt+0x81/0x90
[   13.501359]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   13.501692] 
[   13.501806] Last potentially related work creation:
[   13.502050]  kasan_save_stack+0x45/0x70
[   13.502249]  kasan_record_aux_stack+0xb2/0xc0
[   13.502461]  kmem_cache_free+0x132/0x420
[   13.502763]  kmem_cache_rcu_uaf+0x195/0x510
[   13.502948]  kunit_try_run_case+0x1a6/0x480
[   13.503124]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.503327]  kthread+0x324/0x6e0
[   13.503499]  ret_from_fork+0x41/0x80
[   13.503847]  ret_from_fork_asm+0x1a/0x30
[   13.503996] 
[   13.504078] The buggy address belongs to the object at ffff888101beb000
[   13.504078]  which belongs to the cache test_cache of size 200
[   13.505050] The buggy address is located 0 bytes inside of
[   13.505050]  freed 200-byte region [ffff888101beb000, ffff888101beb0c8)
[   13.505547] 
[   13.505919] The buggy address belongs to the physical page:
[   13.506408] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101beb
[   13.507054] flags: 0x200000000000000(node=0|zone=2)
[   13.507288] page_type: f5(slab)
[   13.507450] raw: 0200000000000000 ffff888101b62780 dead000000000122 0000000000000000
[   13.508402] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   13.508891] page dumped because: kasan: bad access detected
[   13.509132] 
[   13.509225] Memory state around the buggy address:
[   13.509429]  ffff888101beaf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.510232]  ffff888101beaf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.510757] >ffff888101beb000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   13.511209]                    ^
[   13.511366]  ffff888101beb080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   13.512221]  ffff888101beb100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.512709] ==================================================================