Hay
Date
July 8, 2025, 11:09 p.m.

Environment
qemu-x86_64

[   14.478258] ==================================================================
[   14.478572] BUG: KASAN: slab-use-after-free in strlen+0x8f/0xb0
[   14.478870] Read of size 1 at addr ffff88810267d890 by task kunit_try_catch/277
[   14.479200] 
[   14.479290] CPU: 1 UID: 0 PID: 277 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   14.479332] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.479344] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.479389] Call Trace:
[   14.479407]  <TASK>
[   14.479424]  dump_stack_lvl+0x73/0xb0
[   14.479453]  print_report+0xd1/0x650
[   14.479476]  ? __virt_addr_valid+0x1db/0x2d0
[   14.479499]  ? strlen+0x8f/0xb0
[   14.479515]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.479555]  ? strlen+0x8f/0xb0
[   14.479573]  kasan_report+0x141/0x180
[   14.479595]  ? strlen+0x8f/0xb0
[   14.479629]  __asan_report_load1_noabort+0x18/0x20
[   14.479654]  strlen+0x8f/0xb0
[   14.479671]  kasan_strings+0x57b/0xe80
[   14.479705]  ? trace_hardirqs_on+0x37/0xe0
[   14.479729]  ? __pfx_kasan_strings+0x10/0x10
[   14.479750]  ? finish_task_switch.isra.0+0x153/0x700
[   14.479773]  ? __switch_to+0x47/0xf50
[   14.479799]  ? __schedule+0x10cc/0x2b60
[   14.479821]  ? __pfx_read_tsc+0x10/0x10
[   14.479841]  ? ktime_get_ts64+0x86/0x230
[   14.479866]  kunit_try_run_case+0x1a5/0x480
[   14.479891]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.479914]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.479939]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.479963]  ? __kthread_parkme+0x82/0x180
[   14.479984]  ? preempt_count_sub+0x50/0x80
[   14.480007]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.480032]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.480057]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.480081]  kthread+0x337/0x6f0
[   14.480100]  ? trace_preempt_on+0x20/0xc0
[   14.480122]  ? __pfx_kthread+0x10/0x10
[   14.480143]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.480164]  ? calculate_sigpending+0x7b/0xa0
[   14.480189]  ? __pfx_kthread+0x10/0x10
[   14.480211]  ret_from_fork+0x116/0x1d0
[   14.480228]  ? __pfx_kthread+0x10/0x10
[   14.480248]  ret_from_fork_asm+0x1a/0x30
[   14.480280]  </TASK>
[   14.480290] 
[   14.488547] Allocated by task 277:
[   14.488909]  kasan_save_stack+0x45/0x70
[   14.489076]  kasan_save_track+0x18/0x40
[   14.489212]  kasan_save_alloc_info+0x3b/0x50
[   14.489360]  __kasan_kmalloc+0xb7/0xc0
[   14.489751]  __kmalloc_cache_noprof+0x189/0x420
[   14.490147]  kasan_strings+0xc0/0xe80
[   14.490363]  kunit_try_run_case+0x1a5/0x480
[   14.490636]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.490881]  kthread+0x337/0x6f0
[   14.491114]  ret_from_fork+0x116/0x1d0
[   14.491314]  ret_from_fork_asm+0x1a/0x30
[   14.491494] 
[   14.491614] Freed by task 277:
[   14.491771]  kasan_save_stack+0x45/0x70
[   14.491972]  kasan_save_track+0x18/0x40
[   14.492239]  kasan_save_free_info+0x3f/0x60
[   14.492443]  __kasan_slab_free+0x56/0x70
[   14.492657]  kfree+0x222/0x3f0
[   14.492886]  kasan_strings+0x2aa/0xe80
[   14.493058]  kunit_try_run_case+0x1a5/0x480
[   14.493290]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.493457]  kthread+0x337/0x6f0
[   14.493571]  ret_from_fork+0x116/0x1d0
[   14.494021]  ret_from_fork_asm+0x1a/0x30
[   14.494224] 
[   14.494318] The buggy address belongs to the object at ffff88810267d880
[   14.494318]  which belongs to the cache kmalloc-32 of size 32
[   14.494896] The buggy address is located 16 bytes inside of
[   14.494896]  freed 32-byte region [ffff88810267d880, ffff88810267d8a0)
[   14.495968] 
[   14.496079] The buggy address belongs to the physical page:
[   14.496293] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10267d
[   14.496668] flags: 0x200000000000000(node=0|zone=2)
[   14.496882] page_type: f5(slab)
[   14.497195] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   14.497469] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   14.497867] page dumped because: kasan: bad access detected
[   14.498164] 
[   14.498230] Memory state around the buggy address:
[   14.498379]  ffff88810267d780: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.498584]  ffff88810267d800: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   14.498934] >ffff88810267d880: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.499247]                          ^
[   14.499425]  ffff88810267d900: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.500184]  ffff88810267d980: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.501193] ==================================================================