Hay
Date
July 20, 2025, 11:12 a.m.

Environment
qemu-x86_64

[   14.258769] ==================================================================
[   14.259136] BUG: KASAN: slab-use-after-free in strlen+0x8f/0xb0
[   14.259537] Read of size 1 at addr ffff888102746ad0 by task kunit_try_catch/276
[   14.259889] 
[   14.260018] CPU: 1 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   14.260060] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.260072] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.260093] Call Trace:
[   14.260104]  <TASK>
[   14.260118]  dump_stack_lvl+0x73/0xb0
[   14.260144]  print_report+0xd1/0x610
[   14.260166]  ? __virt_addr_valid+0x1db/0x2d0
[   14.260189]  ? strlen+0x8f/0xb0
[   14.260207]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.260229]  ? strlen+0x8f/0xb0
[   14.260246]  kasan_report+0x141/0x180
[   14.260267]  ? strlen+0x8f/0xb0
[   14.260289]  __asan_report_load1_noabort+0x18/0x20
[   14.260313]  strlen+0x8f/0xb0
[   14.260330]  kasan_strings+0x57b/0xe80
[   14.260393]  ? trace_hardirqs_on+0x37/0xe0
[   14.260416]  ? __pfx_kasan_strings+0x10/0x10
[   14.260437]  ? finish_task_switch.isra.0+0x153/0x700
[   14.260521]  ? __switch_to+0x47/0xf50
[   14.260547]  ? __schedule+0x10cc/0x2b60
[   14.260580]  ? __pfx_read_tsc+0x10/0x10
[   14.260599]  ? ktime_get_ts64+0x86/0x230
[   14.260623]  kunit_try_run_case+0x1a5/0x480
[   14.260659]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.260681]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.260703]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.260726]  ? __kthread_parkme+0x82/0x180
[   14.260746]  ? preempt_count_sub+0x50/0x80
[   14.260778]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.260801]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.260825]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.260859]  kthread+0x337/0x6f0
[   14.260878]  ? trace_preempt_on+0x20/0xc0
[   14.260900]  ? __pfx_kthread+0x10/0x10
[   14.260930]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.260950]  ? calculate_sigpending+0x7b/0xa0
[   14.260973]  ? __pfx_kthread+0x10/0x10
[   14.260994]  ret_from_fork+0x116/0x1d0
[   14.261012]  ? __pfx_kthread+0x10/0x10
[   14.261031]  ret_from_fork_asm+0x1a/0x30
[   14.261061]  </TASK>
[   14.261071] 
[   14.269794] Allocated by task 276:
[   14.269939]  kasan_save_stack+0x45/0x70
[   14.270191]  kasan_save_track+0x18/0x40
[   14.270432]  kasan_save_alloc_info+0x3b/0x50
[   14.270681]  __kasan_kmalloc+0xb7/0xc0
[   14.270920]  __kmalloc_cache_noprof+0x189/0x420
[   14.271159]  kasan_strings+0xc0/0xe80
[   14.271516]  kunit_try_run_case+0x1a5/0x480
[   14.271706]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.271969]  kthread+0x337/0x6f0
[   14.272114]  ret_from_fork+0x116/0x1d0
[   14.272302]  ret_from_fork_asm+0x1a/0x30
[   14.272539] 
[   14.272637] Freed by task 276:
[   14.272863]  kasan_save_stack+0x45/0x70
[   14.273085]  kasan_save_track+0x18/0x40
[   14.273274]  kasan_save_free_info+0x3f/0x60
[   14.273574]  __kasan_slab_free+0x56/0x70
[   14.273807]  kfree+0x222/0x3f0
[   14.273972]  kasan_strings+0x2aa/0xe80
[   14.274156]  kunit_try_run_case+0x1a5/0x480
[   14.274444]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.274683]  kthread+0x337/0x6f0
[   14.274854]  ret_from_fork+0x116/0x1d0
[   14.275037]  ret_from_fork_asm+0x1a/0x30
[   14.275242] 
[   14.275339] The buggy address belongs to the object at ffff888102746ac0
[   14.275339]  which belongs to the cache kmalloc-32 of size 32
[   14.276165] The buggy address is located 16 bytes inside of
[   14.276165]  freed 32-byte region [ffff888102746ac0, ffff888102746ae0)
[   14.276806] 
[   14.276964] The buggy address belongs to the physical page:
[   14.277136] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102746
[   14.277374] flags: 0x200000000000000(node=0|zone=2)
[   14.277585] page_type: f5(slab)
[   14.277822] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   14.278073] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   14.278303] page dumped because: kasan: bad access detected
[   14.278689] 
[   14.278856] Memory state around the buggy address:
[   14.279329]  ffff888102746980: 00 00 00 fc fc fc fc fc 00 00 00 04 fc fc fc fc
[   14.280124]  ffff888102746a00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.280350] >ffff888102746a80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.280566]                                                  ^
[   14.280754]  ffff888102746b00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.281898]  ffff888102746b80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   14.282680] ==================================================================