Hay
Date
July 8, 2025, 11:10 a.m.

Environment
qemu-x86_64

[   25.390513] ==================================================================
[   25.390976] BUG: KASAN: slab-use-after-free in strlen+0x8f/0xb0
[   25.391262] Read of size 1 at addr ffff88810627a650 by task kunit_try_catch/307
[   25.391561] 
[   25.391651] CPU: 1 UID: 0 PID: 307 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250708 #1 PREEMPT(voluntary) 
[   25.391700] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.391713] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.391735] Call Trace:
[   25.391753]  <TASK>
[   25.391771]  dump_stack_lvl+0x73/0xb0
[   25.391799]  print_report+0xd1/0x610
[   25.392024]  ? __virt_addr_valid+0x1db/0x2d0
[   25.392057]  ? strlen+0x8f/0xb0
[   25.392080]  ? kasan_complete_mode_report_info+0x64/0x200
[   25.392110]  ? strlen+0x8f/0xb0
[   25.392134]  kasan_report+0x141/0x180
[   25.392157]  ? strlen+0x8f/0xb0
[   25.392183]  __asan_report_load1_noabort+0x18/0x20
[   25.392211]  strlen+0x8f/0xb0
[   25.392234]  kasan_strings+0x57b/0xe80
[   25.392268]  ? trace_hardirqs_on+0x37/0xe0
[   25.392295]  ? __pfx_kasan_strings+0x10/0x10
[   25.392318]  ? __kasan_check_write+0x18/0x20
[   25.392344]  ? queued_spin_lock_slowpath+0x116/0xb40
[   25.392367]  ? irqentry_exit+0x2a/0x60
[   25.392387]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   25.392411]  ? trace_hardirqs_on+0x37/0xe0
[   25.392434]  ? __pfx_read_tsc+0x10/0x10
[   25.392460]  ? ktime_get_ts64+0x86/0x230
[   25.392486]  kunit_try_run_case+0x1a5/0x480
[   25.392510]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.392533]  ? queued_spin_lock_slowpath+0x116/0xb40
[   25.392554]  ? __kthread_parkme+0x82/0x180
[   25.392575]  ? preempt_count_sub+0x50/0x80
[   25.392599]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.392621]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.392648]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.392675]  kthread+0x337/0x6f0
[   25.392697]  ? trace_preempt_on+0x20/0xc0
[   25.392721]  ? __pfx_kthread+0x10/0x10
[   25.392744]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.392772]  ? calculate_sigpending+0x7b/0xa0
[   25.392799]  ? __pfx_kthread+0x10/0x10
[   25.392823]  ret_from_fork+0x116/0x1d0
[   25.392843]  ? __pfx_kthread+0x10/0x10
[   25.392866]  ret_from_fork_asm+0x1a/0x30
[   25.392899]  </TASK>
[   25.392911] 
[   25.400603] Allocated by task 307:
[   25.400783]  kasan_save_stack+0x45/0x70
[   25.400997]  kasan_save_track+0x18/0x40
[   25.401127]  kasan_save_alloc_info+0x3b/0x50
[   25.401318]  __kasan_kmalloc+0xb7/0xc0
[   25.401504]  __kmalloc_cache_noprof+0x189/0x420
[   25.401716]  kasan_strings+0xc0/0xe80
[   25.401890]  kunit_try_run_case+0x1a5/0x480
[   25.402057]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.402407]  kthread+0x337/0x6f0
[   25.402563]  ret_from_fork+0x116/0x1d0
[   25.402725]  ret_from_fork_asm+0x1a/0x30
[   25.402931] 
[   25.403004] Freed by task 307:
[   25.403154]  kasan_save_stack+0x45/0x70
[   25.403313]  kasan_save_track+0x18/0x40
[   25.403498]  kasan_save_free_info+0x3f/0x60
[   25.403675]  __kasan_slab_free+0x56/0x70
[   25.403805]  kfree+0x222/0x3f0
[   25.403917]  kasan_strings+0x2aa/0xe80
[   25.404044]  kunit_try_run_case+0x1a5/0x480
[   25.404182]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.404569]  kthread+0x337/0x6f0
[   25.404733]  ret_from_fork+0x116/0x1d0
[   25.405318]  ret_from_fork_asm+0x1a/0x30
[   25.405745] 
[   25.405915] The buggy address belongs to the object at ffff88810627a640
[   25.405915]  which belongs to the cache kmalloc-32 of size 32
[   25.406358] The buggy address is located 16 bytes inside of
[   25.406358]  freed 32-byte region [ffff88810627a640, ffff88810627a660)
[   25.406698] 
[   25.406867] The buggy address belongs to the physical page:
[   25.407391] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10627a
[   25.407751] flags: 0x200000000000000(node=0|zone=2)
[   25.408279] page_type: f5(slab)
[   25.408420] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   25.408728] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   25.409166] page dumped because: kasan: bad access detected
[   25.409424] 
[   25.409499] Memory state around the buggy address:
[   25.409662]  ffff88810627a500: fa fb fb fb fc fc fc fc 00 00 07 fc fc fc fc fc
[   25.410115]  ffff88810627a580: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   25.410412] >ffff88810627a600: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   25.410700]                                                  ^
[   25.411397]  ffff88810627a680: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   25.411618]  ffff88810627a700: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   25.411827] ==================================================================