Hay
Date
June 25, 2025, 8:08 a.m.

Environment
qemu-arm64
qemu-x86_64

[   28.882155] ==================================================================
[   28.882207] BUG: KASAN: slab-use-after-free in strcmp+0xc0/0xc8
[   28.882263] Read of size 1 at addr fff00000c785da90 by task kunit_try_catch/271
[   28.882314] 
[   28.882351] CPU: 0 UID: 0 PID: 271 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250625 #1 PREEMPT 
[   28.882460] Tainted: [B]=BAD_PAGE, [N]=TEST
[   28.882490] Hardware name: linux,dummy-virt (DT)
[   28.882524] Call trace:
[   28.882905]  show_stack+0x20/0x38 (C)
[   28.883008]  dump_stack_lvl+0x8c/0xd0
[   28.883103]  print_report+0x118/0x608
[   28.883156]  kasan_report+0xdc/0x128
[   28.883223]  __asan_report_load1_noabort+0x20/0x30
[   28.883307]  strcmp+0xc0/0xc8
[   28.883350]  kasan_strings+0x340/0xb00
[   28.883415]  kunit_try_run_case+0x170/0x3f0
[   28.883465]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   28.883519]  kthread+0x328/0x630
[   28.883562]  ret_from_fork+0x10/0x20
[   28.883791] 
[   28.883846] Allocated by task 271:
[   28.883912]  kasan_save_stack+0x3c/0x68
[   28.883960]  kasan_save_track+0x20/0x40
[   28.884033]  kasan_save_alloc_info+0x40/0x58
[   28.884252]  __kasan_kmalloc+0xd4/0xd8
[   28.884341]  __kmalloc_cache_noprof+0x16c/0x3c0
[   28.884383]  kasan_strings+0xc8/0xb00
[   28.884471]  kunit_try_run_case+0x170/0x3f0
[   28.884558]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   28.884604]  kthread+0x328/0x630
[   28.884664]  ret_from_fork+0x10/0x20
[   28.884759] 
[   28.884782] Freed by task 271:
[   28.884811]  kasan_save_stack+0x3c/0x68
[   28.884859]  kasan_save_track+0x20/0x40
[   28.884899]  kasan_save_free_info+0x4c/0x78
[   28.884956]  __kasan_slab_free+0x6c/0x98
[   28.884996]  kfree+0x214/0x3c8
[   28.885030]  kasan_strings+0x24c/0xb00
[   28.885068]  kunit_try_run_case+0x170/0x3f0
[   28.885268]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   28.885325]  kthread+0x328/0x630
[   28.885359]  ret_from_fork+0x10/0x20
[   28.885408] 
[   28.885866] The buggy address belongs to the object at fff00000c785da80
[   28.885866]  which belongs to the cache kmalloc-32 of size 32
[   28.885934] The buggy address is located 16 bytes inside of
[   28.885934]  freed 32-byte region [fff00000c785da80, fff00000c785daa0)
[   28.886020] 
[   28.886079] The buggy address belongs to the physical page:
[   28.886183] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10785d
[   28.886252] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   28.886493] page_type: f5(slab)
[   28.886676] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   28.886776] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   28.886849] page dumped because: kasan: bad access detected
[   28.886929] 
[   28.887002] Memory state around the buggy address:
[   28.887094]  fff00000c785d980: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   28.887158]  fff00000c785da00: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   28.887242] >fff00000c785da80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   28.887333]                          ^
[   28.887368]  fff00000c785db00: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   28.887423]  fff00000c785db80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   28.887465] ==================================================================

[   23.737462] ==================================================================
[   23.738447] BUG: KASAN: slab-use-after-free in strcmp+0xb0/0xc0
[   23.738708] Read of size 1 at addr ffff888102596f90 by task kunit_try_catch/288
[   23.739037] 
[   23.739157] CPU: 0 UID: 0 PID: 288 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250625 #1 PREEMPT(voluntary) 
[   23.739228] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.739241] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   23.739262] Call Trace:
[   23.739274]  <TASK>
[   23.739292]  dump_stack_lvl+0x73/0xb0
[   23.739316]  print_report+0xd1/0x650
[   23.739338]  ? __virt_addr_valid+0x1db/0x2d0
[   23.739362]  ? strcmp+0xb0/0xc0
[   23.739381]  ? kasan_complete_mode_report_info+0x64/0x200
[   23.739406]  ? strcmp+0xb0/0xc0
[   23.739424]  kasan_report+0x141/0x180
[   23.739444]  ? strcmp+0xb0/0xc0
[   23.739466]  __asan_report_load1_noabort+0x18/0x20
[   23.739490]  strcmp+0xb0/0xc0
[   23.739509]  kasan_strings+0x431/0xe80
[   23.739528]  ? trace_hardirqs_on+0x37/0xe0
[   23.739550]  ? __pfx_kasan_strings+0x10/0x10
[   23.739569]  ? finish_task_switch.isra.0+0x153/0x700
[   23.739591]  ? __switch_to+0x47/0xf50
[   23.739615]  ? __schedule+0x10cc/0x2b60
[   23.739640]  ? __pfx_read_tsc+0x10/0x10
[   23.739660]  ? ktime_get_ts64+0x86/0x230
[   23.739684]  kunit_try_run_case+0x1a5/0x480
[   23.739709]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.739838]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   23.739860]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   23.739884]  ? __kthread_parkme+0x82/0x180
[   23.739904]  ? preempt_count_sub+0x50/0x80
[   23.739925]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.739959]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.739982]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   23.740006]  kthread+0x337/0x6f0
[   23.740024]  ? trace_preempt_on+0x20/0xc0
[   23.740044]  ? __pfx_kthread+0x10/0x10
[   23.740064]  ? _raw_spin_unlock_irq+0x47/0x80
[   23.740086]  ? calculate_sigpending+0x7b/0xa0
[   23.740108]  ? __pfx_kthread+0x10/0x10
[   23.740128]  ret_from_fork+0x116/0x1d0
[   23.740146]  ? __pfx_kthread+0x10/0x10
[   23.740164]  ret_from_fork_asm+0x1a/0x30
[   23.740193]  </TASK>
[   23.740203] 
[   23.747609] Allocated by task 288:
[   23.747798]  kasan_save_stack+0x45/0x70
[   23.748136]  kasan_save_track+0x18/0x40
[   23.748361]  kasan_save_alloc_info+0x3b/0x50
[   23.748648]  __kasan_kmalloc+0xb7/0xc0
[   23.748783]  __kmalloc_cache_noprof+0x189/0x420
[   23.748926]  kasan_strings+0xc0/0xe80
[   23.749110]  kunit_try_run_case+0x1a5/0x480
[   23.749567]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.750053]  kthread+0x337/0x6f0
[   23.750236]  ret_from_fork+0x116/0x1d0
[   23.750439]  ret_from_fork_asm+0x1a/0x30
[   23.750632] 
[   23.750727] Freed by task 288:
[   23.750991]  kasan_save_stack+0x45/0x70
[   23.751190]  kasan_save_track+0x18/0x40
[   23.751346]  kasan_save_free_info+0x3f/0x60
[   23.751484]  __kasan_slab_free+0x56/0x70
[   23.751611]  kfree+0x222/0x3f0
[   23.751750]  kasan_strings+0x2aa/0xe80
[   23.751926]  kunit_try_run_case+0x1a5/0x480
[   23.752164]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.752610]  kthread+0x337/0x6f0
[   23.752850]  ret_from_fork+0x116/0x1d0
[   23.753032]  ret_from_fork_asm+0x1a/0x30
[   23.753286] 
[   23.753375] The buggy address belongs to the object at ffff888102596f80
[   23.753375]  which belongs to the cache kmalloc-32 of size 32
[   23.753961] The buggy address is located 16 bytes inside of
[   23.753961]  freed 32-byte region [ffff888102596f80, ffff888102596fa0)
[   23.754309] 
[   23.754400] The buggy address belongs to the physical page:
[   23.754645] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102596
[   23.755101] flags: 0x200000000000000(node=0|zone=2)
[   23.755516] page_type: f5(slab)
[   23.755715] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   23.756141] raw: 0000000000000000 0000000000400040 00000000f5000000 0000000000000000
[   23.756457] page dumped because: kasan: bad access detected
[   23.756688] 
[   23.756756] Memory state around the buggy address:
[   23.757137]  ffff888102596e80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   23.757425]  ffff888102596f00: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   23.757697] >ffff888102596f80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   23.758011]                          ^
[   23.758138]  ffff888102597000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   23.758396]  ffff888102597080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.758721] ==================================================================