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

Environment
qemu-x86_64

[   14.209769] ==================================================================
[   14.210809] BUG: KASAN: slab-use-after-free in strcmp+0xb0/0xc0
[   14.211142] Read of size 1 at addr ffff888102746ad0 by task kunit_try_catch/276
[   14.211443] 
[   14.211645] CPU: 1 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   14.211693] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.211706] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.211727] Call Trace:
[   14.211738]  <TASK>
[   14.211753]  dump_stack_lvl+0x73/0xb0
[   14.211792]  print_report+0xd1/0x610
[   14.211816]  ? __virt_addr_valid+0x1db/0x2d0
[   14.211839]  ? strcmp+0xb0/0xc0
[   14.211868]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.211890]  ? strcmp+0xb0/0xc0
[   14.211916]  kasan_report+0x141/0x180
[   14.211938]  ? strcmp+0xb0/0xc0
[   14.211959]  __asan_report_load1_noabort+0x18/0x20
[   14.211994]  strcmp+0xb0/0xc0
[   14.212012]  kasan_strings+0x431/0xe80
[   14.212032]  ? trace_hardirqs_on+0x37/0xe0
[   14.212065]  ? __pfx_kasan_strings+0x10/0x10
[   14.212085]  ? finish_task_switch.isra.0+0x153/0x700
[   14.212106]  ? __switch_to+0x47/0xf50
[   14.212131]  ? __schedule+0x10cc/0x2b60
[   14.212156]  ? __pfx_read_tsc+0x10/0x10
[   14.212176]  ? ktime_get_ts64+0x86/0x230
[   14.212199]  kunit_try_run_case+0x1a5/0x480
[   14.212223]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.212246]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.212268]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.212291]  ? __kthread_parkme+0x82/0x180
[   14.212312]  ? preempt_count_sub+0x50/0x80
[   14.212334]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.212449]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.212475]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.212498]  kthread+0x337/0x6f0
[   14.212517]  ? trace_preempt_on+0x20/0xc0
[   14.212539]  ? __pfx_kthread+0x10/0x10
[   14.212560]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.212669]  ? calculate_sigpending+0x7b/0xa0
[   14.212698]  ? __pfx_kthread+0x10/0x10
[   14.212720]  ret_from_fork+0x116/0x1d0
[   14.212739]  ? __pfx_kthread+0x10/0x10
[   14.212759]  ret_from_fork_asm+0x1a/0x30
[   14.212788]  </TASK>
[   14.212798] 
[   14.221002] Allocated by task 276:
[   14.221142]  kasan_save_stack+0x45/0x70
[   14.221459]  kasan_save_track+0x18/0x40
[   14.221684]  kasan_save_alloc_info+0x3b/0x50
[   14.221938]  __kasan_kmalloc+0xb7/0xc0
[   14.222156]  __kmalloc_cache_noprof+0x189/0x420
[   14.222470]  kasan_strings+0xc0/0xe80
[   14.222638]  kunit_try_run_case+0x1a5/0x480
[   14.223003]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.223242]  kthread+0x337/0x6f0
[   14.223527]  ret_from_fork+0x116/0x1d0
[   14.223851]  ret_from_fork_asm+0x1a/0x30
[   14.224043] 
[   14.224163] Freed by task 276:
[   14.224305]  kasan_save_stack+0x45/0x70
[   14.224621]  kasan_save_track+0x18/0x40
[   14.224846]  kasan_save_free_info+0x3f/0x60
[   14.225073]  __kasan_slab_free+0x56/0x70
[   14.225260]  kfree+0x222/0x3f0
[   14.225640]  kasan_strings+0x2aa/0xe80
[   14.225817]  kunit_try_run_case+0x1a5/0x480
[   14.225976]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.226153]  kthread+0x337/0x6f0
[   14.226274]  ret_from_fork+0x116/0x1d0
[   14.226425]  ret_from_fork_asm+0x1a/0x30
[   14.226619] 
[   14.226714] The buggy address belongs to the object at ffff888102746ac0
[   14.226714]  which belongs to the cache kmalloc-32 of size 32
[   14.227560] The buggy address is located 16 bytes inside of
[   14.227560]  freed 32-byte region [ffff888102746ac0, ffff888102746ae0)
[   14.228076] 
[   14.228175] The buggy address belongs to the physical page:
[   14.228512] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102746
[   14.228848] flags: 0x200000000000000(node=0|zone=2)
[   14.229090] page_type: f5(slab)
[   14.229215] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   14.229687] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   14.230125] page dumped because: kasan: bad access detected
[   14.230531] 
[   14.230633] Memory state around the buggy address:
[   14.231056]  ffff888102746980: 00 00 00 fc fc fc fc fc 00 00 00 04 fc fc fc fc
[   14.231307]  ffff888102746a00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.231546] >ffff888102746a80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.231887]                                                  ^
[   14.232159]  ffff888102746b00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.232437]  ffff888102746b80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   14.232847] ==================================================================