Hay
Date
July 8, 2025, 4:38 p.m.

Environment
qemu-x86_64

[   13.296691] ==================================================================
[   13.297191] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   13.297500] Read of size 1 at addr ffff88810360c050 by task kunit_try_catch/279
[   13.297900] 
[   13.298002] CPU: 0 UID: 0 PID: 279 Comm: kunit_try_catch Tainted: G    B            N  6.15.6-rc1 #1 PREEMPT(voluntary) 
[   13.298048] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.298061] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.298083] Call Trace:
[   13.298095]  <TASK>
[   13.298109]  dump_stack_lvl+0x73/0xb0
[   13.298134]  print_report+0xd1/0x650
[   13.298159]  ? __virt_addr_valid+0x1db/0x2d0
[   13.298182]  ? strnlen+0x73/0x80
[   13.298202]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.298225]  ? strnlen+0x73/0x80
[   13.298245]  kasan_report+0x141/0x180
[   13.298268]  ? strnlen+0x73/0x80
[   13.298292]  __asan_report_load1_noabort+0x18/0x20
[   13.298314]  strnlen+0x73/0x80
[   13.298334]  kasan_strings+0x615/0xe80
[   13.298355]  ? trace_hardirqs_on+0x37/0xe0
[   13.298379]  ? __pfx_kasan_strings+0x10/0x10
[   13.298400]  ? finish_task_switch.isra.0+0x153/0x700
[   13.298425]  ? __switch_to+0x5d9/0xf60
[   13.298447]  ? dequeue_task_fair+0x166/0x4e0
[   13.298471]  ? __schedule+0x10cc/0x2b60
[   13.298496]  ? __pfx_read_tsc+0x10/0x10
[   13.298515]  ? ktime_get_ts64+0x86/0x230
[   13.298542]  kunit_try_run_case+0x1a5/0x480
[   13.298564]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.298585]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.298610]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.298635]  ? __kthread_parkme+0x82/0x180
[   13.298657]  ? preempt_count_sub+0x50/0x80
[   13.298682]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.298703]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.298726]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.298751]  kthread+0x337/0x6f0
[   13.298768]  ? trace_preempt_on+0x20/0xc0
[   13.298790]  ? __pfx_kthread+0x10/0x10
[   13.298809]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.298831]  ? calculate_sigpending+0x7b/0xa0
[   13.298854]  ? __pfx_kthread+0x10/0x10
[   13.298883]  ret_from_fork+0x41/0x80
[   13.298904]  ? __pfx_kthread+0x10/0x10
[   13.298923]  ret_from_fork_asm+0x1a/0x30
[   13.298953]  </TASK>
[   13.299016] 
[   13.307418] Allocated by task 279:
[   13.307668]  kasan_save_stack+0x45/0x70
[   13.307952]  kasan_save_track+0x18/0x40
[   13.308112]  kasan_save_alloc_info+0x3b/0x50
[   13.308261]  __kasan_kmalloc+0xb7/0xc0
[   13.308419]  __kmalloc_cache_noprof+0x189/0x420
[   13.308641]  kasan_strings+0xc0/0xe80
[   13.309004]  kunit_try_run_case+0x1a5/0x480
[   13.309294]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.309476]  kthread+0x337/0x6f0
[   13.309651]  ret_from_fork+0x41/0x80
[   13.309839]  ret_from_fork_asm+0x1a/0x30
[   13.310053] 
[   13.310149] Freed by task 279:
[   13.310297]  kasan_save_stack+0x45/0x70
[   13.310437]  kasan_save_track+0x18/0x40
[   13.310574]  kasan_save_free_info+0x3f/0x60
[   13.310976]  __kasan_slab_free+0x56/0x70
[   13.311321]  kfree+0x222/0x3f0
[   13.311498]  kasan_strings+0x2aa/0xe80
[   13.311695]  kunit_try_run_case+0x1a5/0x480
[   13.311959]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.312147]  kthread+0x337/0x6f0
[   13.312269]  ret_from_fork+0x41/0x80
[   13.312404]  ret_from_fork_asm+0x1a/0x30
[   13.312562] 
[   13.312659] The buggy address belongs to the object at ffff88810360c040
[   13.312659]  which belongs to the cache kmalloc-32 of size 32
[   13.313201] The buggy address is located 16 bytes inside of
[   13.313201]  freed 32-byte region [ffff88810360c040, ffff88810360c060)
[   13.314017] 
[   13.314095] The buggy address belongs to the physical page:
[   13.314271] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10360c
[   13.314513] flags: 0x200000000000000(node=0|zone=2)
[   13.314685] page_type: f5(slab)
[   13.315010] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.315389] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   13.315738] page dumped because: kasan: bad access detected
[   13.316032] 
[   13.316269] Memory state around the buggy address:
[   13.316491]  ffff88810360bf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.316763]  ffff88810360bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.317001] >ffff88810360c000: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.317553]                                                  ^
[   13.317815]  ffff88810360c080: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.318129]  ffff88810360c100: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   13.318451] ==================================================================