Hay
Date
May 12, 2025, 6:12 p.m.

Environment
qemu-arm64
qemu-x86_64

[   19.671599] ==================================================================
[   19.672151] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x390/0x468
[   19.672419] Read of size 1 at addr fff00000c654f000 by task kunit_try_catch/202
[   19.672654] 
[   19.672810] CPU: 0 UID: 0 PID: 202 Comm: kunit_try_catch Tainted: G    B            N 6.14.7-rc1 #1
[   19.672913] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.672943] Hardware name: linux,dummy-virt (DT)
[   19.672982] Call trace:
[   19.673011]  show_stack+0x20/0x38 (C)
[   19.673073]  dump_stack_lvl+0x8c/0xd0
[   19.673134]  print_report+0x118/0x608
[   19.673189]  kasan_report+0xdc/0x128
[   19.673241]  __asan_report_load1_noabort+0x20/0x30
[   19.673292]  kmem_cache_rcu_uaf+0x390/0x468
[   19.673345]  kunit_try_run_case+0x170/0x3f0
[   19.673400]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.673458]  kthread+0x318/0x620
[   19.673508]  ret_from_fork+0x10/0x20
[   19.673564] 
[   19.677702] Allocated by task 202:
[   19.677907]  kasan_save_stack+0x3c/0x68
[   19.678188]  kasan_save_track+0x20/0x40
[   19.678447]  kasan_save_alloc_info+0x40/0x58
[   19.678790]  __kasan_slab_alloc+0xa8/0xb0
[   19.679165]  kmem_cache_alloc_noprof+0x10c/0x3a0
[   19.679833]  kmem_cache_rcu_uaf+0x12c/0x468
[   19.680267]  kunit_try_run_case+0x170/0x3f0
[   19.680524]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.681024]  kthread+0x318/0x620
[   19.681351]  ret_from_fork+0x10/0x20
[   19.681574] 
[   19.681782] Freed by task 0:
[   19.681969]  kasan_save_stack+0x3c/0x68
[   19.682245]  kasan_save_track+0x20/0x40
[   19.682477]  kasan_save_free_info+0x4c/0x78
[   19.682830]  __kasan_slab_free+0x6c/0x98
[   19.683172]  slab_free_after_rcu_debug+0xd4/0x2f8
[   19.683355]  rcu_core+0x9f4/0x1e20
[   19.683701]  rcu_core_si+0x18/0x30
[   19.683884]  handle_softirqs+0x374/0xb28
[   19.684148]  __do_softirq+0x1c/0x28
[   19.684404] 
[   19.684534] Last potentially related work creation:
[   19.684705]  kasan_save_stack+0x3c/0x68
[   19.684946]  kasan_record_aux_stack+0xb4/0xc8
[   19.685319]  kmem_cache_free+0x120/0x470
[   19.685650]  kmem_cache_rcu_uaf+0x16c/0x468
[   19.685911]  kunit_try_run_case+0x170/0x3f0
[   19.686180]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.686451]  kthread+0x318/0x620
[   19.686613]  ret_from_fork+0x10/0x20
[   19.687058] 
[   19.687251] The buggy address belongs to the object at fff00000c654f000
[   19.687251]  which belongs to the cache test_cache of size 200
[   19.687706] The buggy address is located 0 bytes inside of
[   19.687706]  freed 200-byte region [fff00000c654f000, fff00000c654f0c8)
[   19.688888] 
[   19.689029] The buggy address belongs to the physical page:
[   19.689385] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10654f
[   19.689777] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.690136] page_type: f5(slab)
[   19.690435] raw: 0bfffe0000000000 fff00000c656d3c0 dead000000000122 0000000000000000
[   19.691210] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   19.691447] page dumped because: kasan: bad access detected
[   19.691627] 
[   19.691728] Memory state around the buggy address:
[   19.691930]  fff00000c654ef00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   19.692140]  fff00000c654ef80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   19.692650] >fff00000c654f000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   19.692906]                    ^
[   19.693074]  fff00000c654f080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   19.693582]  fff00000c654f100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.693877] ==================================================================

[   13.210433] ==================================================================
[   13.211024] BUG: KASAN: slab-use-after-free in kmem_cache_rcu_uaf+0x3e5/0x510
[   13.211864] Read of size 1 at addr ffff888102ae7000 by task kunit_try_catch/221
[   13.212705] 
[   13.213262] CPU: 0 UID: 0 PID: 221 Comm: kunit_try_catch Tainted: G    B            N 6.14.7-rc1 #1
[   13.213318] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.213330] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.213355] Call Trace:
[   13.213371]  <TASK>
[   13.213393]  dump_stack_lvl+0x73/0xb0
[   13.213428]  print_report+0xd1/0x650
[   13.213451]  ? __virt_addr_valid+0x1db/0x2d0
[   13.213475]  ? kmem_cache_rcu_uaf+0x3e5/0x510
[   13.213497]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.213522]  ? kmem_cache_rcu_uaf+0x3e5/0x510
[   13.213543]  kasan_report+0x140/0x180
[   13.213564]  ? kmem_cache_rcu_uaf+0x3e5/0x510
[   13.213590]  __asan_report_load1_noabort+0x18/0x20
[   13.213612]  kmem_cache_rcu_uaf+0x3e5/0x510
[   13.213634]  ? __pfx_kmem_cache_rcu_uaf+0x10/0x10
[   13.213655]  ? finish_task_switch.isra.0+0x153/0x700
[   13.213680]  ? __switch_to+0x5d9/0xf60
[   13.213708]  ? __pfx_read_tsc+0x10/0x10
[   13.213730]  ? ktime_get_ts64+0x86/0x230
[   13.213763]  kunit_try_run_case+0x1a6/0x480
[   13.213788]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.213808]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   13.213830]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.213870]  ? __kthread_parkme+0x82/0x160
[   13.213893]  ? preempt_count_sub+0x50/0x80
[   13.213916]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.213938]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.213963]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.213987]  kthread+0x324/0x6e0
[   13.214026]  ? trace_preempt_on+0x20/0xc0
[   13.214051]  ? __pfx_kthread+0x10/0x10
[   13.214073]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.214095]  ? calculate_sigpending+0x7b/0xa0
[   13.214117]  ? __pfx_kthread+0x10/0x10
[   13.214139]  ret_from_fork+0x41/0x80
[   13.214157]  ? __pfx_kthread+0x10/0x10
[   13.214178]  ret_from_fork_asm+0x1a/0x30
[   13.214210]  </TASK>
[   13.214221] 
[   13.227607] Allocated by task 221:
[   13.227975]  kasan_save_stack+0x45/0x70
[   13.228478]  kasan_save_track+0x18/0x40
[   13.228848]  kasan_save_alloc_info+0x3b/0x50
[   13.229336]  __kasan_slab_alloc+0x91/0xa0
[   13.229756]  kmem_cache_alloc_noprof+0x124/0x400
[   13.229937]  kmem_cache_rcu_uaf+0x156/0x510
[   13.230123]  kunit_try_run_case+0x1a6/0x480
[   13.230714]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.231301]  kthread+0x324/0x6e0
[   13.231642]  ret_from_fork+0x41/0x80
[   13.231986]  ret_from_fork_asm+0x1a/0x30
[   13.232429] 
[   13.232606] Freed by task 0:
[   13.232718]  kasan_save_stack+0x45/0x70
[   13.232867]  kasan_save_track+0x18/0x40
[   13.233040]  kasan_save_free_info+0x3f/0x60
[   13.233420]  __kasan_slab_free+0x56/0x70
[   13.233784]  slab_free_after_rcu_debug+0xe4/0x310
[   13.234359]  rcu_core+0x680/0x1d70
[   13.234714]  rcu_core_si+0x12/0x20
[   13.235147]  handle_softirqs+0x209/0x730
[   13.235296]  __irq_exit_rcu+0xc9/0x110
[   13.235430]  irq_exit_rcu+0x12/0x20
[   13.235559]  sysvec_apic_timer_interrupt+0x81/0x90
[   13.235719]  asm_sysvec_apic_timer_interrupt+0x1f/0x30
[   13.235911] 
[   13.236001] Last potentially related work creation:
[   13.236294]  kasan_save_stack+0x45/0x70
[   13.236506]  kasan_record_aux_stack+0xb2/0xc0
[   13.236655]  kmem_cache_free+0x132/0x420
[   13.236922]  kmem_cache_rcu_uaf+0x195/0x510
[   13.237482]  kunit_try_run_case+0x1a6/0x480
[   13.237646]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.237829]  kthread+0x324/0x6e0
[   13.238028]  ret_from_fork+0x41/0x80
[   13.238227]  ret_from_fork_asm+0x1a/0x30
[   13.238434] 
[   13.238530] The buggy address belongs to the object at ffff888102ae7000
[   13.238530]  which belongs to the cache test_cache of size 200
[   13.239011] The buggy address is located 0 bytes inside of
[   13.239011]  freed 200-byte region [ffff888102ae7000, ffff888102ae70c8)
[   13.239574] 
[   13.239653] The buggy address belongs to the physical page:
[   13.239898] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102ae7
[   13.240330] flags: 0x200000000000000(node=0|zone=2)
[   13.240571] page_type: f5(slab)
[   13.240726] raw: 0200000000000000 ffff8881011e9c80 dead000000000122 0000000000000000
[   13.241047] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   13.241396] page dumped because: kasan: bad access detected
[   13.241600] 
[   13.241694] Memory state around the buggy address:
[   13.241914]  ffff888102ae6f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.242135]  ffff888102ae6f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.242388] >ffff888102ae7000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   13.242856]                    ^
[   13.243021]  ffff888102ae7080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
[   13.243291]  ffff888102ae7100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.243943] ==================================================================