Hay
Date
July 22, 2025, 2:40 p.m.

Environment
qemu-x86_64

[   13.156384] ==================================================================
[   13.156956] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   13.157254] Read of size 1 at addr ffff8881028ca790 by task kunit_try_catch/279
[   13.157577] 
[   13.157684] CPU: 1 UID: 0 PID: 279 Comm: kunit_try_catch Tainted: G    B            N  6.15.8-rc1 #1 PREEMPT(voluntary) 
[   13.157728] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.157741] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.157761] Call Trace:
[   13.157776]  <TASK>
[   13.157810]  dump_stack_lvl+0x73/0xb0
[   13.157834]  print_report+0xd1/0x610
[   13.157857]  ? __virt_addr_valid+0x1db/0x2d0
[   13.157878]  ? strnlen+0x73/0x80
[   13.157896]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.157919]  ? strnlen+0x73/0x80
[   13.157938]  kasan_report+0x141/0x180
[   13.157960]  ? strnlen+0x73/0x80
[   13.157983]  __asan_report_load1_noabort+0x18/0x20
[   13.158004]  strnlen+0x73/0x80
[   13.158023]  kasan_strings+0x615/0xe80
[   13.158043]  ? trace_hardirqs_on+0x37/0xe0
[   13.158065]  ? __pfx_kasan_strings+0x10/0x10
[   13.158106]  ? __kasan_check_write+0x18/0x20
[   13.158126]  ? queued_spin_lock_slowpath+0x116/0xb40
[   13.158148]  ? __pfx_queued_spin_lock_slowpath+0x10/0x10
[   13.158169]  ? __pfx_read_tsc+0x10/0x10
[   13.158188]  ? ktime_get_ts64+0x86/0x230
[   13.158213]  kunit_try_run_case+0x1a5/0x480
[   13.158244]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.158263]  ? _raw_spin_lock_irqsave+0xf9/0x100
[   13.158298]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.158321]  ? __kthread_parkme+0x82/0x180
[   13.158366]  ? preempt_count_sub+0x50/0x80
[   13.158390]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.158411]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.158434]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.158457]  kthread+0x337/0x6f0
[   13.158473]  ? trace_preempt_on+0x20/0xc0
[   13.158495]  ? __pfx_kthread+0x10/0x10
[   13.158513]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.158535]  ? calculate_sigpending+0x7b/0xa0
[   13.158556]  ? __pfx_kthread+0x10/0x10
[   13.158590]  ret_from_fork+0x41/0x80
[   13.158610]  ? __pfx_kthread+0x10/0x10
[   13.158641]  ret_from_fork_asm+0x1a/0x30
[   13.158685]  </TASK>
[   13.158696] 
[   13.166043] Allocated by task 279:
[   13.166249]  kasan_save_stack+0x45/0x70
[   13.166476]  kasan_save_track+0x18/0x40
[   13.166668]  kasan_save_alloc_info+0x3b/0x50
[   13.166859]  __kasan_kmalloc+0xb7/0xc0
[   13.167053]  __kmalloc_cache_noprof+0x189/0x420
[   13.167245]  kasan_strings+0xc0/0xe80
[   13.167451]  kunit_try_run_case+0x1a5/0x480
[   13.167627]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.167876]  kthread+0x337/0x6f0
[   13.168023]  ret_from_fork+0x41/0x80
[   13.168187]  ret_from_fork_asm+0x1a/0x30
[   13.168440] 
[   13.168531] Freed by task 279:
[   13.168694]  kasan_save_stack+0x45/0x70
[   13.168909]  kasan_save_track+0x18/0x40
[   13.169073]  kasan_save_free_info+0x3f/0x60
[   13.169212]  __kasan_slab_free+0x56/0x70
[   13.169453]  kfree+0x222/0x3f0
[   13.169610]  kasan_strings+0x2aa/0xe80
[   13.169790]  kunit_try_run_case+0x1a5/0x480
[   13.169983]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.170220]  kthread+0x337/0x6f0
[   13.170407]  ret_from_fork+0x41/0x80
[   13.170591]  ret_from_fork_asm+0x1a/0x30
[   13.170780] 
[   13.170871] The buggy address belongs to the object at ffff8881028ca780
[   13.170871]  which belongs to the cache kmalloc-32 of size 32
[   13.171341] The buggy address is located 16 bytes inside of
[   13.171341]  freed 32-byte region [ffff8881028ca780, ffff8881028ca7a0)
[   13.171748] 
[   13.171816] The buggy address belongs to the physical page:
[   13.172060] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1028ca
[   13.172463] flags: 0x200000000000000(node=0|zone=2)
[   13.172697] page_type: f5(slab)
[   13.172875] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.173182] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   13.173541] page dumped because: kasan: bad access detected
[   13.173798] 
[   13.173869] Memory state around the buggy address:
[   13.174086]  ffff8881028ca680: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.174375]  ffff8881028ca700: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.174670] >ffff8881028ca780: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.174963]                          ^
[   13.175098]  ffff8881028ca800: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   13.175448]  ffff8881028ca880: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.175728] ==================================================================