Hay
Date
June 19, 2025, 12:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   33.371428] ==================================================================
[   33.371566] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   33.371693] Read of size 1 at addr fff00000c76d03d0 by task kunit_try_catch/270
[   33.371823] 
[   33.371961] CPU: 0 UID: 0 PID: 270 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250619 #1 PREEMPT 
[   33.372162] Tainted: [B]=BAD_PAGE, [N]=TEST
[   33.372230] Hardware name: linux,dummy-virt (DT)
[   33.372316] Call trace:
[   33.372414]  show_stack+0x20/0x38 (C)
[   33.372596]  dump_stack_lvl+0x8c/0xd0
[   33.372768]  print_report+0x118/0x608
[   33.372923]  kasan_report+0xdc/0x128
[   33.373046]  __asan_report_load1_noabort+0x20/0x30
[   33.373172]  strnlen+0x80/0x88
[   33.373277]  kasan_strings+0x478/0xb00
[   33.373396]  kunit_try_run_case+0x170/0x3f0
[   33.373585]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.373906]  kthread+0x328/0x630
[   33.374025]  ret_from_fork+0x10/0x20
[   33.374151] 
[   33.374194] Allocated by task 270:
[   33.374258]  kasan_save_stack+0x3c/0x68
[   33.374383]  kasan_save_track+0x20/0x40
[   33.374454]  kasan_save_alloc_info+0x40/0x58
[   33.374538]  __kasan_kmalloc+0xd4/0xd8
[   33.374629]  __kmalloc_cache_noprof+0x16c/0x3c0
[   33.374774]  kasan_strings+0xc8/0xb00
[   33.374932]  kunit_try_run_case+0x170/0x3f0
[   33.375095]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.375772]  kthread+0x328/0x630
[   33.376131] Freed by task 270:
[   33.376528]  __kasan_slab_free+0x6c/0x98
[   33.377163]  ret_from_fork+0x10/0x20
[   33.377560] The buggy address is located 16 bytes inside of
[   33.377560]  freed 32-byte region [fff00000c76d03c0, fff00000c76d03e0)
[   33.378028] page_type: f5(slab)
[   33.378077] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   33.378223] 
[   33.378385] >fff00000c76d0380: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   33.387372]     not ok 62 kasan_strings
[   33.395957] Write of size 8 at addr fff00000c6135568 by task kunit_try_catch/272
[   33.397932]  print_report+0x118/0x608
[   33.399071]  kthread+0x328/0x630
[   33.399742] 
[   33.399796] Allocated by task 272:
[   33.399881]  kasan_save_stack+0x3c/0x68
[   33.399998]  kasan_save_track+0x20/0x40
[   33.400109]  kasan_save_alloc_info+0x40/0x58
[   33.400349]  __kmalloc_cache_noprof+0x16c/0x3c0
[   33.401499] The buggy address belongs to the object at fff00000c6135560
[   33.401499]  which belongs to the cache kmalloc-16 of size 16
[   33.402456] The buggy address belongs to the physical page:
[   33.404255] raw: fff00000c6135540 000000008080007f 00000000f5000000 0000000000000000
[   33.405273] ==================================================================

[   29.436926] ==================================================================
[   29.439646] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   29.440165] Read of size 1 at addr ffff8881024dbb10 by task kunit_try_catch/288
[   29.440491] 
[   29.440638] CPU: 1 UID: 0 PID: 288 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250619 #1 PREEMPT(voluntary) 
[   29.440745] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.440772] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   29.440817] Call Trace:
[   29.440861]  <TASK>
[   29.440904]  dump_stack_lvl+0x73/0xb0
[   29.440964]  print_report+0xd1/0x650
[   29.442038]  ? __virt_addr_valid+0x1db/0x2d0
[   29.442123]  ? strnlen+0x73/0x80
[   29.442169]  ? kasan_complete_mode_report_info+0x64/0x200
[   29.442228]  ? strnlen+0x73/0x80
[   29.442272]  kasan_report+0x141/0x180
[   29.442324]  ? strnlen+0x73/0x80
[   29.442378]  __asan_report_load1_noabort+0x18/0x20
[   29.442432]  strnlen+0x73/0x80
[   29.442477]  kasan_strings+0x615/0xe80
[   29.442524]  ? trace_hardirqs_on+0x37/0xe0
[   29.442577]  ? __pfx_kasan_strings+0x10/0x10
[   29.442621]  ? finish_task_switch.isra.0+0x153/0x700
[   29.442668]  ? __switch_to+0x47/0xf50
[   29.442724]  ? __schedule+0x10cc/0x2b60
[   29.442777]  ? __pfx_read_tsc+0x10/0x10
[   29.442823]  ? ktime_get_ts64+0x86/0x230
[   29.442878]  kunit_try_run_case+0x1a5/0x480
[   29.442935]  ? __pfx_kunit_try_run_case+0x10/0x10
[   29.442983]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   29.443032]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   29.443086]  ? __kthread_parkme+0x82/0x180
[   29.443145]  ? preempt_count_sub+0x50/0x80
[   29.443248]  ? __pfx_kunit_try_run_case+0x10/0x10
[   29.443407]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   29.443462]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   29.443517]  kthread+0x337/0x6f0
[   29.443565]  ? trace_preempt_on+0x20/0xc0
[   29.443617]  ? __pfx_kthread+0x10/0x10
[   29.443661]  ? _raw_spin_unlock_irq+0x47/0x80
[   29.443690]  ? calculate_sigpending+0x7b/0xa0
[   29.443717]  ? __pfx_kthread+0x10/0x10
[   29.443739]  ret_from_fork+0x116/0x1d0
[   29.443761]  ? __pfx_kthread+0x10/0x10
[   29.443783]  ret_from_fork_asm+0x1a/0x30
[   29.443816]  </TASK>
[   29.443830] 
[   29.456638] Allocated by task 288:
[   29.457209]  kasan_save_stack+0x45/0x70
[   29.457629]  kasan_save_track+0x18/0x40
[   29.457896]  kasan_save_alloc_info+0x3b/0x50
[   29.458668]  __kasan_kmalloc+0xb7/0xc0
[   29.458903]  __kmalloc_cache_noprof+0x189/0x420
[   29.459191]  kasan_strings+0xc0/0xe80
[   29.459383]  kunit_try_run_case+0x1a5/0x480
[   29.459591]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   29.459827]  kthread+0x337/0x6f0
[   29.461302]  ret_from_fork+0x116/0x1d0
[   29.461532]  ret_from_fork_asm+0x1a/0x30
[   29.461720] 
[   29.461826] Freed by task 288:
[   29.462679]  kasan_save_stack+0x45/0x70
[   29.463167]  kasan_save_track+0x18/0x40
[   29.463472]  kasan_save_free_info+0x3f/0x60
[   29.463710]  __kasan_slab_free+0x56/0x70
[   29.464053]  kfree+0x222/0x3f0
[   29.464284]  kasan_strings+0x2aa/0xe80
[   29.464453]  kunit_try_run_case+0x1a5/0x480
[   29.464710]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   29.465129]  kthread+0x337/0x6f0
[   29.465294]  ret_from_fork+0x116/0x1d0
[   29.465464]  ret_from_fork_asm+0x1a/0x30
[   29.465859] 
[   29.466024] The buggy address belongs to the object at ffff8881024dbb00
[   29.466024]  which belongs to the cache kmalloc-32 of size 32
[   29.466823] The buggy address is located 16 bytes inside of
[   29.466823]  freed 32-byte region [ffff8881024dbb00, ffff8881024dbb20)
[   29.468469] 
[   29.468665] The buggy address belongs to the physical page:
[   29.469063] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1024db
[   29.469547] flags: 0x200000000000000(node=0|zone=2)
[   29.469770] page_type: f5(slab)
[   29.469942] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   29.470835] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   29.471203] page dumped because: kasan: bad access detected
[   29.471511] 
[   29.471693] Memory state around the buggy address:
[   29.472162]  ffff8881024dba00: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   29.472415]  ffff8881024dba80: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   29.472987] >ffff8881024dbb00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   29.473486]                          ^
[   29.473808]  ffff8881024dbb80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   29.475201]  ffff8881024dbc00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   29.475616] ==================================================================