Hay
Date
July 18, 2025, 1:09 p.m.

Environment
qemu-x86_64

[   26.844557] ==================================================================
[   26.844889] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   26.845182] Read of size 1 at addr ffff8881053c84d0 by task kunit_try_catch/307
[   26.845509] 
[   26.845618] CPU: 0 UID: 0 PID: 307 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250718 #1 PREEMPT(voluntary) 
[   26.845668] Tainted: [B]=BAD_PAGE, [N]=TEST
[   26.845680] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   26.845703] Call Trace:
[   26.845722]  <TASK>
[   26.845740]  dump_stack_lvl+0x73/0xb0
[   26.845770]  print_report+0xd1/0x640
[   26.845793]  ? __virt_addr_valid+0x1db/0x2d0
[   26.845816]  ? strnlen+0x73/0x80
[   26.845834]  ? kasan_complete_mode_report_info+0x64/0x200
[   26.845860]  ? strnlen+0x73/0x80
[   26.845878]  kasan_report+0x141/0x180
[   26.845899]  ? strnlen+0x73/0x80
[   26.845922]  __asan_report_load1_noabort+0x18/0x20
[   26.845946]  strnlen+0x73/0x80
[   26.845967]  kasan_strings+0x615/0xe80
[   26.845986]  ? trace_hardirqs_on+0x37/0xe0
[   26.846021]  ? __pfx_kasan_strings+0x10/0x10
[   26.846108]  ? finish_task_switch.isra.0+0x153/0x700
[   26.846134]  ? __switch_to+0x47/0xf80
[   26.846160]  ? __schedule+0x10da/0x2b60
[   26.846185]  ? __pfx_read_tsc+0x10/0x10
[   26.846205]  ? ktime_get_ts64+0x86/0x230
[   26.846230]  kunit_try_run_case+0x1a5/0x480
[   26.846254]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.846285]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   26.846320]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   26.846352]  ? __kthread_parkme+0x82/0x180
[   26.846371]  ? preempt_count_sub+0x50/0x80
[   26.846395]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.846418]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.846442]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   26.846464]  kthread+0x337/0x6f0
[   26.846483]  ? trace_preempt_on+0x20/0xc0
[   26.846505]  ? __pfx_kthread+0x10/0x10
[   26.846536]  ? _raw_spin_unlock_irq+0x47/0x80
[   26.846567]  ? calculate_sigpending+0x7b/0xa0
[   26.846603]  ? __pfx_kthread+0x10/0x10
[   26.846628]  ret_from_fork+0x116/0x1d0
[   26.846655]  ? __pfx_kthread+0x10/0x10
[   26.846677]  ret_from_fork_asm+0x1a/0x30
[   26.846717]  </TASK>
[   26.846728] 
[   26.854686] Allocated by task 307:
[   26.855014]  kasan_save_stack+0x45/0x70
[   26.855208]  kasan_save_track+0x18/0x40
[   26.855406]  kasan_save_alloc_info+0x3b/0x50
[   26.855783]  __kasan_kmalloc+0xb7/0xc0
[   26.856047]  __kmalloc_cache_noprof+0x189/0x420
[   26.856267]  kasan_strings+0xc0/0xe80
[   26.856405]  kunit_try_run_case+0x1a5/0x480
[   26.856581]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.856846]  kthread+0x337/0x6f0
[   26.857013]  ret_from_fork+0x116/0x1d0
[   26.857279]  ret_from_fork_asm+0x1a/0x30
[   26.857540] 
[   26.857617] Freed by task 307:
[   26.857729]  kasan_save_stack+0x45/0x70
[   26.858008]  kasan_save_track+0x18/0x40
[   26.858193]  kasan_save_free_info+0x3f/0x60
[   26.858391]  __kasan_slab_free+0x56/0x70
[   26.858596]  kfree+0x222/0x3f0
[   26.858750]  kasan_strings+0x2aa/0xe80
[   26.858946]  kunit_try_run_case+0x1a5/0x480
[   26.859195]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.859432]  kthread+0x337/0x6f0
[   26.859579]  ret_from_fork+0x116/0x1d0
[   26.859768]  ret_from_fork_asm+0x1a/0x30
[   26.860217] 
[   26.860325] The buggy address belongs to the object at ffff8881053c84c0
[   26.860325]  which belongs to the cache kmalloc-32 of size 32
[   26.860933] The buggy address is located 16 bytes inside of
[   26.860933]  freed 32-byte region [ffff8881053c84c0, ffff8881053c84e0)
[   26.861412] 
[   26.861527] The buggy address belongs to the physical page:
[   26.861696] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1053c8
[   26.861933] flags: 0x200000000000000(node=0|zone=2)
[   26.862089] page_type: f5(slab)
[   26.862206] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   26.862525] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   26.863062] page dumped because: kasan: bad access detected
[   26.863313] 
[   26.863397] Memory state around the buggy address:
[   26.863585]  ffff8881053c8380: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   26.863792]  ffff8881053c8400: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   26.863997] >ffff8881053c8480: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   26.864397]                                                  ^
[   26.864665]  ffff8881053c8500: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   26.865109]  ffff8881053c8580: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   26.865464] ==================================================================