Hay
Date
July 19, 2025, 11:11 a.m.

Environment
qemu-arm64
qemu-x86_64

[   17.567853] ==================================================================
[   17.567907] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   17.568291] Read of size 1 at addr fff00000c77dfad0 by task kunit_try_catch/260
[   17.568403] 
[   17.568477] CPU: 1 UID: 0 PID: 260 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   17.568573] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.568602] Hardware name: linux,dummy-virt (DT)
[   17.568634] Call trace:
[   17.568661]  show_stack+0x20/0x38 (C)
[   17.568714]  dump_stack_lvl+0x8c/0xd0
[   17.569123]  print_report+0x118/0x5d0
[   17.569207]  kasan_report+0xdc/0x128
[   17.569259]  __asan_report_load1_noabort+0x20/0x30
[   17.569689]  strnlen+0x80/0x88
[   17.569799]  kasan_strings+0x478/0xb00
[   17.569936]  kunit_try_run_case+0x170/0x3f0
[   17.570088]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.570191]  kthread+0x328/0x630
[   17.570281]  ret_from_fork+0x10/0x20
[   17.570438] 
[   17.570802] Allocated by task 260:
[   17.570951]  kasan_save_stack+0x3c/0x68
[   17.571112]  kasan_save_track+0x20/0x40
[   17.571228]  kasan_save_alloc_info+0x40/0x58
[   17.571348]  __kasan_kmalloc+0xd4/0xd8
[   17.571447]  __kmalloc_cache_noprof+0x16c/0x3c0
[   17.571718]  kasan_strings+0xc8/0xb00
[   17.571898]  kunit_try_run_case+0x170/0x3f0
[   17.571970]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.572154]  kthread+0x328/0x630
[   17.572202]  ret_from_fork+0x10/0x20
[   17.572388] 
[   17.572608] Freed by task 260:
[   17.572816]  kasan_save_stack+0x3c/0x68
[   17.572976]  kasan_save_track+0x20/0x40
[   17.573576]  kasan_save_free_info+0x4c/0x78
[   17.573797]  __kasan_slab_free+0x6c/0x98
[   17.573886]  kfree+0x214/0x3c8
[   17.573993]  kasan_strings+0x24c/0xb00
[   17.574034]  kunit_try_run_case+0x170/0x3f0
[   17.574074]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.574589]  kthread+0x328/0x630
[   17.574683]  ret_from_fork+0x10/0x20
[   17.574834] 
[   17.574892] The buggy address belongs to the object at fff00000c77dfac0
[   17.574892]  which belongs to the cache kmalloc-32 of size 32
[   17.575011] The buggy address is located 16 bytes inside of
[   17.575011]  freed 32-byte region [fff00000c77dfac0, fff00000c77dfae0)
[   17.575112] 
[   17.575537] The buggy address belongs to the physical page:
[   17.575653] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1077df
[   17.575748] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.575879] page_type: f5(slab)
[   17.575923] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   17.576008] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   17.576191] page dumped because: kasan: bad access detected
[   17.576406] 
[   17.576470] Memory state around the buggy address:
[   17.576863]  fff00000c77df980: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   17.577017]  fff00000c77dfa00: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   17.577104] >fff00000c77dfa80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   17.577237]                                                  ^
[   17.577498]  fff00000c77dfb00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   17.577683]  fff00000c77dfb80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   17.577771] ==================================================================

[   14.022426] ==================================================================
[   14.022792] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   14.023007] Read of size 1 at addr ffff8881039fe2d0 by task kunit_try_catch/277
[   14.023464] 
[   14.023561] CPU: 1 UID: 0 PID: 277 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   14.023605] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.023617] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.023638] Call Trace:
[   14.023650]  <TASK>
[   14.023662]  dump_stack_lvl+0x73/0xb0
[   14.023689]  print_report+0xd1/0x610
[   14.023710]  ? __virt_addr_valid+0x1db/0x2d0
[   14.023732]  ? strnlen+0x73/0x80
[   14.023748]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.023771]  ? strnlen+0x73/0x80
[   14.023788]  kasan_report+0x141/0x180
[   14.023810]  ? strnlen+0x73/0x80
[   14.023831]  __asan_report_load1_noabort+0x18/0x20
[   14.023855]  strnlen+0x73/0x80
[   14.023874]  kasan_strings+0x615/0xe80
[   14.023892]  ? trace_hardirqs_on+0x37/0xe0
[   14.023915]  ? __pfx_kasan_strings+0x10/0x10
[   14.023935]  ? finish_task_switch.isra.0+0x153/0x700
[   14.023957]  ? __switch_to+0x47/0xf50
[   14.023981]  ? __schedule+0x10cc/0x2b60
[   14.024002]  ? __pfx_read_tsc+0x10/0x10
[   14.024023]  ? ktime_get_ts64+0x86/0x230
[   14.024046]  kunit_try_run_case+0x1a5/0x480
[   14.024069]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.024092]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.024115]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.024138]  ? __kthread_parkme+0x82/0x180
[   14.024158]  ? preempt_count_sub+0x50/0x80
[   14.024182]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.024206]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.024229]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.024254]  kthread+0x337/0x6f0
[   14.024272]  ? trace_preempt_on+0x20/0xc0
[   14.024294]  ? __pfx_kthread+0x10/0x10
[   14.024314]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.024335]  ? calculate_sigpending+0x7b/0xa0
[   14.024359]  ? __pfx_kthread+0x10/0x10
[   14.024379]  ret_from_fork+0x116/0x1d0
[   14.024397]  ? __pfx_kthread+0x10/0x10
[   14.024417]  ret_from_fork_asm+0x1a/0x30
[   14.024446]  </TASK>
[   14.024455] 
[   14.031811] Allocated by task 277:
[   14.031974]  kasan_save_stack+0x45/0x70
[   14.032161]  kasan_save_track+0x18/0x40
[   14.032337]  kasan_save_alloc_info+0x3b/0x50
[   14.032486]  __kasan_kmalloc+0xb7/0xc0
[   14.032630]  __kmalloc_cache_noprof+0x189/0x420
[   14.032786]  kasan_strings+0xc0/0xe80
[   14.032916]  kunit_try_run_case+0x1a5/0x480
[   14.033062]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.033239]  kthread+0x337/0x6f0
[   14.033358]  ret_from_fork+0x116/0x1d0
[   14.033491]  ret_from_fork_asm+0x1a/0x30
[   14.033694] 
[   14.033789] Freed by task 277:
[   14.033944]  kasan_save_stack+0x45/0x70
[   14.034142]  kasan_save_track+0x18/0x40
[   14.034554]  kasan_save_free_info+0x3f/0x60
[   14.034761]  __kasan_slab_free+0x56/0x70
[   14.034953]  kfree+0x222/0x3f0
[   14.035117]  kasan_strings+0x2aa/0xe80
[   14.035419]  kunit_try_run_case+0x1a5/0x480
[   14.035575]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.035749]  kthread+0x337/0x6f0
[   14.035866]  ret_from_fork+0x116/0x1d0
[   14.035997]  ret_from_fork_asm+0x1a/0x30
[   14.036133] 
[   14.036203] The buggy address belongs to the object at ffff8881039fe2c0
[   14.036203]  which belongs to the cache kmalloc-32 of size 32
[   14.036961] The buggy address is located 16 bytes inside of
[   14.036961]  freed 32-byte region [ffff8881039fe2c0, ffff8881039fe2e0)
[   14.037924] 
[   14.038020] The buggy address belongs to the physical page:
[   14.038415] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1039fe
[   14.038736] flags: 0x200000000000000(node=0|zone=2)
[   14.038901] page_type: f5(slab)
[   14.039026] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   14.039263] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   14.039491] page dumped because: kasan: bad access detected
[   14.039913] 
[   14.040002] Memory state around the buggy address:
[   14.040222]  ffff8881039fe180: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.040547]  ffff8881039fe200: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   14.041135] >ffff8881039fe280: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.041374]                                                  ^
[   14.041564]  ffff8881039fe300: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.041782]  ffff8881039fe380: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   14.042101] ==================================================================