Hay
Date
July 16, 2025, 12:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   33.006333] ==================================================================
[   33.006422] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   33.006749] Read of size 1 at addr fff00000c9bb4890 by task kunit_try_catch/290
[   33.006918] 
[   33.007067] CPU: 0 UID: 0 PID: 290 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250716 #1 PREEMPT 
[   33.007183] Tainted: [B]=BAD_PAGE, [N]=TEST
[   33.007218] Hardware name: linux,dummy-virt (DT)
[   33.007287] Call trace:
[   33.007313]  show_stack+0x20/0x38 (C)
[   33.007535]  dump_stack_lvl+0x8c/0xd0
[   33.007589]  print_report+0x118/0x5d0
[   33.007910]  kasan_report+0xdc/0x128
[   33.008023]  __asan_report_load1_noabort+0x20/0x30
[   33.008173]  strnlen+0x80/0x88
[   33.008298]  kasan_strings+0x478/0xb00
[   33.008350]  kunit_try_run_case+0x170/0x3f0
[   33.008734]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.008882]  kthread+0x328/0x630
[   33.008999]  ret_from_fork+0x10/0x20
[   33.009169] 
[   33.009290] Allocated by task 290:
[   33.009365]  kasan_save_stack+0x3c/0x68
[   33.009449]  kasan_save_track+0x20/0x40
[   33.009680]  kasan_save_alloc_info+0x40/0x58
[   33.009935]  __kasan_kmalloc+0xd4/0xd8
[   33.010074]  __kmalloc_cache_noprof+0x16c/0x3c0
[   33.010204]  kasan_strings+0xc8/0xb00
[   33.010334]  kunit_try_run_case+0x170/0x3f0
[   33.010582]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.010753]  kthread+0x328/0x630
[   33.010975]  ret_from_fork+0x10/0x20
[   33.011080] 
[   33.011169] Freed by task 290:
[   33.011311]  kasan_save_stack+0x3c/0x68
[   33.011382]  kasan_save_track+0x20/0x40
[   33.011648]  kasan_save_free_info+0x4c/0x78
[   33.011817]  __kasan_slab_free+0x6c/0x98
[   33.011936]  kfree+0x214/0x3c8
[   33.012016]  kasan_strings+0x24c/0xb00
[   33.012058]  kunit_try_run_case+0x170/0x3f0
[   33.012097]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.012337]  kthread+0x328/0x630
[   33.012686]  ret_from_fork+0x10/0x20
[   33.012829] 
[   33.013114] The buggy address belongs to the object at fff00000c9bb4880
[   33.013114]  which belongs to the cache kmalloc-32 of size 32
[   33.013251] The buggy address is located 16 bytes inside of
[   33.013251]  freed 32-byte region [fff00000c9bb4880, fff00000c9bb48a0)
[   33.013632] 
[   33.013762] The buggy address belongs to the physical page:
[   33.013889] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109bb4
[   33.014236] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   33.014438] page_type: f5(slab)
[   33.014516] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   33.014695] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   33.014768] page dumped because: kasan: bad access detected
[   33.014999] 
[   33.015184] Memory state around the buggy address:
[   33.015344]  fff00000c9bb4780: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   33.015418]  fff00000c9bb4800: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   33.015564] >fff00000c9bb4880: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   33.015639]                          ^
[   33.015674]  fff00000c9bb4900: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   33.016140]  fff00000c9bb4980: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   33.016201] ==================================================================

[   25.315204] ==================================================================
[   25.316533] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   25.317781] Read of size 1 at addr ffff8881053b8d50 by task kunit_try_catch/308
[   25.318915] 
[   25.319153] CPU: 0 UID: 0 PID: 308 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250716 #1 PREEMPT(voluntary) 
[   25.319330] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.319347] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.319371] Call Trace:
[   25.319394]  <TASK>
[   25.319425]  dump_stack_lvl+0x73/0xb0
[   25.319462]  print_report+0xd1/0x610
[   25.319486]  ? __virt_addr_valid+0x1db/0x2d0
[   25.319511]  ? strnlen+0x73/0x80
[   25.319534]  ? kasan_complete_mode_report_info+0x64/0x200
[   25.319560]  ? strnlen+0x73/0x80
[   25.319657]  kasan_report+0x141/0x180
[   25.319681]  ? strnlen+0x73/0x80
[   25.319708]  __asan_report_load1_noabort+0x18/0x20
[   25.319733]  strnlen+0x73/0x80
[   25.319755]  kasan_strings+0x615/0xe80
[   25.319775]  ? trace_hardirqs_on+0x37/0xe0
[   25.319800]  ? __pfx_kasan_strings+0x10/0x10
[   25.319819]  ? finish_task_switch.isra.0+0x153/0x700
[   25.319841]  ? __switch_to+0x47/0xf80
[   25.319928]  ? __schedule+0x10c6/0x2b60
[   25.319956]  ? __pfx_read_tsc+0x10/0x10
[   25.319979]  ? ktime_get_ts64+0x86/0x230
[   25.320007]  kunit_try_run_case+0x1a5/0x480
[   25.320033]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.320055]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.320078]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.320100]  ? __kthread_parkme+0x82/0x180
[   25.320121]  ? preempt_count_sub+0x50/0x80
[   25.320143]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.320167]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.320193]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.320220]  kthread+0x337/0x6f0
[   25.320239]  ? trace_preempt_on+0x20/0xc0
[   25.320261]  ? __pfx_kthread+0x10/0x10
[   25.320282]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.320314]  ? calculate_sigpending+0x7b/0xa0
[   25.320339]  ? __pfx_kthread+0x10/0x10
[   25.320359]  ret_from_fork+0x116/0x1d0
[   25.320380]  ? __pfx_kthread+0x10/0x10
[   25.320399]  ret_from_fork_asm+0x1a/0x30
[   25.320431]  </TASK>
[   25.320443] 
[   25.333822] Allocated by task 308:
[   25.334330]  kasan_save_stack+0x45/0x70
[   25.334710]  kasan_save_track+0x18/0x40
[   25.335117]  kasan_save_alloc_info+0x3b/0x50
[   25.335576]  __kasan_kmalloc+0xb7/0xc0
[   25.335827]  __kmalloc_cache_noprof+0x189/0x420
[   25.336245]  kasan_strings+0xc0/0xe80
[   25.336441]  kunit_try_run_case+0x1a5/0x480
[   25.336587]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.337103]  kthread+0x337/0x6f0
[   25.337448]  ret_from_fork+0x116/0x1d0
[   25.337888]  ret_from_fork_asm+0x1a/0x30
[   25.338375] 
[   25.338451] Freed by task 308:
[   25.338560]  kasan_save_stack+0x45/0x70
[   25.338919]  kasan_save_track+0x18/0x40
[   25.339334]  kasan_save_free_info+0x3f/0x60
[   25.339741]  __kasan_slab_free+0x56/0x70
[   25.340146]  kfree+0x222/0x3f0
[   25.340439]  kasan_strings+0x2aa/0xe80
[   25.340568]  kunit_try_run_case+0x1a5/0x480
[   25.340952]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.341476]  kthread+0x337/0x6f0
[   25.341648]  ret_from_fork+0x116/0x1d0
[   25.341777]  ret_from_fork_asm+0x1a/0x30
[   25.342139] 
[   25.342322] The buggy address belongs to the object at ffff8881053b8d40
[   25.342322]  which belongs to the cache kmalloc-32 of size 32
[   25.343511] The buggy address is located 16 bytes inside of
[   25.343511]  freed 32-byte region [ffff8881053b8d40, ffff8881053b8d60)
[   25.344356] 
[   25.344498] The buggy address belongs to the physical page:
[   25.344703] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1053b8
[   25.345480] flags: 0x200000000000000(node=0|zone=2)
[   25.346082] page_type: f5(slab)
[   25.346346] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   25.346573] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   25.347272] page dumped because: kasan: bad access detected
[   25.347865] 
[   25.348058] Memory state around the buggy address:
[   25.348381]  ffff8881053b8c00: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   25.348630]  ffff8881053b8c80: fa fb fb fb fc fc fc fc 00 00 07 fc fc fc fc fc
[   25.349320] >ffff8881053b8d00: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   25.349946]                                                  ^
[   25.350419]  ffff8881053b8d80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   25.350669]  ffff8881053b8e00: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   25.350884] ==================================================================