Hay
Date
July 19, 2025, 11:11 a.m.

Environment
qemu-arm64
qemu-x86_64

[   17.560135] ==================================================================
[   17.560253] BUG: KASAN: slab-use-after-free in strlen+0xa8/0xb0
[   17.560646] Read of size 1 at addr fff00000c77dfad0 by task kunit_try_catch/260
[   17.560731] 
[   17.560805] CPU: 1 UID: 0 PID: 260 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   17.560894] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.561099] Hardware name: linux,dummy-virt (DT)
[   17.561244] Call trace:
[   17.561310]  show_stack+0x20/0x38 (C)
[   17.561385]  dump_stack_lvl+0x8c/0xd0
[   17.561435]  print_report+0x118/0x5d0
[   17.561683]  kasan_report+0xdc/0x128
[   17.561768]  __asan_report_load1_noabort+0x20/0x30
[   17.562126]  strlen+0xa8/0xb0
[   17.562296]  kasan_strings+0x418/0xb00
[   17.562561]  kunit_try_run_case+0x170/0x3f0
[   17.562630]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.562688]  kthread+0x328/0x630
[   17.562732]  ret_from_fork+0x10/0x20
[   17.562927] 
[   17.562959] Allocated by task 260:
[   17.562993]  kasan_save_stack+0x3c/0x68
[   17.563038]  kasan_save_track+0x20/0x40
[   17.563092]  kasan_save_alloc_info+0x40/0x58
[   17.563136]  __kasan_kmalloc+0xd4/0xd8
[   17.563173]  __kmalloc_cache_noprof+0x16c/0x3c0
[   17.563214]  kasan_strings+0xc8/0xb00
[   17.563249]  kunit_try_run_case+0x170/0x3f0
[   17.563291]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.563336]  kthread+0x328/0x630
[   17.563371]  ret_from_fork+0x10/0x20
[   17.563409] 
[   17.563439] Freed by task 260:
[   17.563474]  kasan_save_stack+0x3c/0x68
[   17.563542]  kasan_save_track+0x20/0x40
[   17.563582]  kasan_save_free_info+0x4c/0x78
[   17.563623]  __kasan_slab_free+0x6c/0x98
[   17.563671]  kfree+0x214/0x3c8
[   17.563707]  kasan_strings+0x24c/0xb00
[   17.563751]  kunit_try_run_case+0x170/0x3f0
[   17.563798]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.563842]  kthread+0x328/0x630
[   17.563901]  ret_from_fork+0x10/0x20
[   17.563937] 
[   17.563967] The buggy address belongs to the object at fff00000c77dfac0
[   17.563967]  which belongs to the cache kmalloc-32 of size 32
[   17.564027] The buggy address is located 16 bytes inside of
[   17.564027]  freed 32-byte region [fff00000c77dfac0, fff00000c77dfae0)
[   17.564091] 
[   17.564117] The buggy address belongs to the physical page:
[   17.564160] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1077df
[   17.564232] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.564289] page_type: f5(slab)
[   17.564329] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   17.564406] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   17.564462] page dumped because: kasan: bad access detected
[   17.564497] 
[   17.565004] Memory state around the buggy address:
[   17.565442]  fff00000c77df980: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   17.565641]  fff00000c77dfa00: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   17.565863] >fff00000c77dfa80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   17.566131]                                                  ^
[   17.566178]  fff00000c77dfb00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   17.566385]  fff00000c77dfb80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   17.566562] ==================================================================

[   14.002139] ==================================================================
[   14.002452] BUG: KASAN: slab-use-after-free in strlen+0x8f/0xb0
[   14.002666] Read of size 1 at addr ffff8881039fe2d0 by task kunit_try_catch/277
[   14.002988] 
[   14.003304] CPU: 1 UID: 0 PID: 277 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   14.003352] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.003364] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.003384] Call Trace:
[   14.003399]  <TASK>
[   14.003414]  dump_stack_lvl+0x73/0xb0
[   14.003440]  print_report+0xd1/0x610
[   14.003461]  ? __virt_addr_valid+0x1db/0x2d0
[   14.003482]  ? strlen+0x8f/0xb0
[   14.003512]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.003534]  ? strlen+0x8f/0xb0
[   14.003552]  kasan_report+0x141/0x180
[   14.003573]  ? strlen+0x8f/0xb0
[   14.003594]  __asan_report_load1_noabort+0x18/0x20
[   14.003618]  strlen+0x8f/0xb0
[   14.003636]  kasan_strings+0x57b/0xe80
[   14.003655]  ? trace_hardirqs_on+0x37/0xe0
[   14.003677]  ? __pfx_kasan_strings+0x10/0x10
[   14.003696]  ? finish_task_switch.isra.0+0x153/0x700
[   14.003719]  ? __switch_to+0x47/0xf50
[   14.003744]  ? __schedule+0x10cc/0x2b60
[   14.003766]  ? __pfx_read_tsc+0x10/0x10
[   14.003788]  ? ktime_get_ts64+0x86/0x230
[   14.003812]  kunit_try_run_case+0x1a5/0x480
[   14.003836]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.003858]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.003881]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.003905]  ? __kthread_parkme+0x82/0x180
[   14.003924]  ? preempt_count_sub+0x50/0x80
[   14.003947]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.003970]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.003994]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.004018]  kthread+0x337/0x6f0
[   14.004036]  ? trace_preempt_on+0x20/0xc0
[   14.004217]  ? __pfx_kthread+0x10/0x10
[   14.004238]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.004259]  ? calculate_sigpending+0x7b/0xa0
[   14.004283]  ? __pfx_kthread+0x10/0x10
[   14.004304]  ret_from_fork+0x116/0x1d0
[   14.004322]  ? __pfx_kthread+0x10/0x10
[   14.004342]  ret_from_fork_asm+0x1a/0x30
[   14.004371]  </TASK>
[   14.004380] 
[   14.011754] Allocated by task 277:
[   14.011885]  kasan_save_stack+0x45/0x70
[   14.012031]  kasan_save_track+0x18/0x40
[   14.012168]  kasan_save_alloc_info+0x3b/0x50
[   14.012316]  __kasan_kmalloc+0xb7/0xc0
[   14.012449]  __kmalloc_cache_noprof+0x189/0x420
[   14.012670]  kasan_strings+0xc0/0xe80
[   14.012853]  kunit_try_run_case+0x1a5/0x480
[   14.013298]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.013556]  kthread+0x337/0x6f0
[   14.013720]  ret_from_fork+0x116/0x1d0
[   14.013904]  ret_from_fork_asm+0x1a/0x30
[   14.014095] 
[   14.014181] Freed by task 277:
[   14.014345]  kasan_save_stack+0x45/0x70
[   14.014548]  kasan_save_track+0x18/0x40
[   14.014840]  kasan_save_free_info+0x3f/0x60
[   14.014987]  __kasan_slab_free+0x56/0x70
[   14.015137]  kfree+0x222/0x3f0
[   14.015299]  kasan_strings+0x2aa/0xe80
[   14.015491]  kunit_try_run_case+0x1a5/0x480
[   14.015705]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.015959]  kthread+0x337/0x6f0
[   14.016132]  ret_from_fork+0x116/0x1d0
[   14.016309]  ret_from_fork_asm+0x1a/0x30
[   14.016515] 
[   14.016602] The buggy address belongs to the object at ffff8881039fe2c0
[   14.016602]  which belongs to the cache kmalloc-32 of size 32
[   14.017049] The buggy address is located 16 bytes inside of
[   14.017049]  freed 32-byte region [ffff8881039fe2c0, ffff8881039fe2e0)
[   14.017546] 
[   14.017643] The buggy address belongs to the physical page:
[   14.017864] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1039fe
[   14.018179] flags: 0x200000000000000(node=0|zone=2)
[   14.018380] page_type: f5(slab)
[   14.018551] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   14.018843] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   14.019143] page dumped because: kasan: bad access detected
[   14.019373] 
[   14.019445] Memory state around the buggy address:
[   14.019646]  ffff8881039fe180: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.019865]  ffff8881039fe200: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   14.020082] >ffff8881039fe280: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   14.020606]                                                  ^
[   14.020868]  ffff8881039fe300: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.021180]  ffff8881039fe380: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   14.021504] ==================================================================