Hay
Date
July 5, 2025, 11:09 a.m.

Environment
qemu-x86_64

[   15.876467] ==================================================================
[   15.876927] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   15.877304] Read of size 1 at addr ffff8881038e5fd0 by task kunit_try_catch/277
[   15.877624] 
[   15.877746] CPU: 0 UID: 0 PID: 277 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   15.877921] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.877938] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   15.877965] Call Trace:
[   15.877988]  <TASK>
[   15.878011]  dump_stack_lvl+0x73/0xb0
[   15.878045]  print_report+0xd1/0x650
[   15.878071]  ? __virt_addr_valid+0x1db/0x2d0
[   15.878099]  ? strnlen+0x73/0x80
[   15.878120]  ? kasan_complete_mode_report_info+0x64/0x200
[   15.878147]  ? strnlen+0x73/0x80
[   15.878168]  kasan_report+0x141/0x180
[   15.878194]  ? strnlen+0x73/0x80
[   15.878246]  __asan_report_load1_noabort+0x18/0x20
[   15.878275]  strnlen+0x73/0x80
[   15.878298]  kasan_strings+0x615/0xe80
[   15.878321]  ? trace_hardirqs_on+0x37/0xe0
[   15.878350]  ? __pfx_kasan_strings+0x10/0x10
[   15.878374]  ? finish_task_switch.isra.0+0x153/0x700
[   15.878416]  ? __switch_to+0x47/0xf50
[   15.878453]  ? __schedule+0x10cc/0x2b60
[   15.878480]  ? __pfx_read_tsc+0x10/0x10
[   15.878505]  ? ktime_get_ts64+0x86/0x230
[   15.878534]  kunit_try_run_case+0x1a5/0x480
[   15.878562]  ? __pfx_kunit_try_run_case+0x10/0x10
[   15.878588]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   15.878616]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   15.878656]  ? __kthread_parkme+0x82/0x180
[   15.878681]  ? preempt_count_sub+0x50/0x80
[   15.878708]  ? __pfx_kunit_try_run_case+0x10/0x10
[   15.878736]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   15.878999]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   15.879069]  kthread+0x337/0x6f0
[   15.879093]  ? trace_preempt_on+0x20/0xc0
[   15.879120]  ? __pfx_kthread+0x10/0x10
[   15.879148]  ? _raw_spin_unlock_irq+0x47/0x80
[   15.879173]  ? calculate_sigpending+0x7b/0xa0
[   15.879203]  ? __pfx_kthread+0x10/0x10
[   15.879229]  ret_from_fork+0x116/0x1d0
[   15.879251]  ? __pfx_kthread+0x10/0x10
[   15.879274]  ret_from_fork_asm+0x1a/0x30
[   15.879310]  </TASK>
[   15.879324] 
[   15.889480] Allocated by task 277:
[   15.889663]  kasan_save_stack+0x45/0x70
[   15.890015]  kasan_save_track+0x18/0x40
[   15.890256]  kasan_save_alloc_info+0x3b/0x50
[   15.890514]  __kasan_kmalloc+0xb7/0xc0
[   15.890689]  __kmalloc_cache_noprof+0x189/0x420
[   15.891188]  kasan_strings+0xc0/0xe80
[   15.891434]  kunit_try_run_case+0x1a5/0x480
[   15.891705]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   15.892030]  kthread+0x337/0x6f0
[   15.892205]  ret_from_fork+0x116/0x1d0
[   15.892437]  ret_from_fork_asm+0x1a/0x30
[   15.892939] 
[   15.893090] Freed by task 277:
[   15.893248]  kasan_save_stack+0x45/0x70
[   15.893482]  kasan_save_track+0x18/0x40
[   15.893727]  kasan_save_free_info+0x3f/0x60
[   15.894078]  __kasan_slab_free+0x56/0x70
[   15.894330]  kfree+0x222/0x3f0
[   15.894522]  kasan_strings+0x2aa/0xe80
[   15.894780]  kunit_try_run_case+0x1a5/0x480
[   15.895215]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   15.895430]  kthread+0x337/0x6f0
[   15.895626]  ret_from_fork+0x116/0x1d0
[   15.895999]  ret_from_fork_asm+0x1a/0x30
[   15.896246] 
[   15.896350] The buggy address belongs to the object at ffff8881038e5fc0
[   15.896350]  which belongs to the cache kmalloc-32 of size 32
[   15.897097] The buggy address is located 16 bytes inside of
[   15.897097]  freed 32-byte region [ffff8881038e5fc0, ffff8881038e5fe0)
[   15.897684] 
[   15.897867] The buggy address belongs to the physical page:
[   15.898180] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1038e5
[   15.898633] flags: 0x200000000000000(node=0|zone=2)
[   15.899186] page_type: f5(slab)
[   15.899401] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   15.899943] raw: 0000000000000000 0000000000400040 00000000f5000000 0000000000000000
[   15.900358] page dumped because: kasan: bad access detected
[   15.900608] 
[   15.900724] Memory state around the buggy address:
[   15.900957]  ffff8881038e5e80: fa fb fb fb fc fc fc fc 00 00 07 fc fc fc fc fc
[   15.901278]  ffff8881038e5f00: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   15.901588] >ffff8881038e5f80: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   15.902056]                                                  ^
[   15.902439]  ffff8881038e6000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   15.902858]  ffff8881038e6080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.903386] ==================================================================