Hay
Date
July 16, 2025, 3:10 p.m.

Environment
qemu-arm64
qemu-x86_64

[   18.844216] ==================================================================
[   18.844542] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   18.844606] Read of size 1 at addr fff00000c595c710 by task kunit_try_catch/259
[   18.844787] 
[   18.844832] CPU: 1 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   18.844926] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.845152] Hardware name: linux,dummy-virt (DT)
[   18.845387] Call trace:
[   18.845528]  show_stack+0x20/0x38 (C)
[   18.845594]  dump_stack_lvl+0x8c/0xd0
[   18.846050]  print_report+0x118/0x5d0
[   18.846131]  kasan_report+0xdc/0x128
[   18.846182]  __asan_report_load1_noabort+0x20/0x30
[   18.846235]  strnlen+0x80/0x88
[   18.846695]  kasan_strings+0x478/0xb00
[   18.846786]  kunit_try_run_case+0x170/0x3f0
[   18.846843]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.846952]  kthread+0x328/0x630
[   18.847096]  ret_from_fork+0x10/0x20
[   18.847158] 
[   18.847178] Allocated by task 259:
[   18.847243]  kasan_save_stack+0x3c/0x68
[   18.847355]  kasan_save_track+0x20/0x40
[   18.847676]  kasan_save_alloc_info+0x40/0x58
[   18.847939]  __kasan_kmalloc+0xd4/0xd8
[   18.848033]  __kmalloc_cache_noprof+0x16c/0x3c0
[   18.848176]  kasan_strings+0xc8/0xb00
[   18.848537]  kunit_try_run_case+0x170/0x3f0
[   18.848658]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.848822]  kthread+0x328/0x630
[   18.848933]  ret_from_fork+0x10/0x20
[   18.849014] 
[   18.849164] Freed by task 259:
[   18.849229]  kasan_save_stack+0x3c/0x68
[   18.849279]  kasan_save_track+0x20/0x40
[   18.849468]  kasan_save_free_info+0x4c/0x78
[   18.849678]  __kasan_slab_free+0x6c/0x98
[   18.849850]  kfree+0x214/0x3c8
[   18.849952]  kasan_strings+0x24c/0xb00
[   18.850065]  kunit_try_run_case+0x170/0x3f0
[   18.850414]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.850507]  kthread+0x328/0x630
[   18.850623]  ret_from_fork+0x10/0x20
[   18.850763] 
[   18.850834] The buggy address belongs to the object at fff00000c595c700
[   18.850834]  which belongs to the cache kmalloc-32 of size 32
[   18.850937] The buggy address is located 16 bytes inside of
[   18.850937]  freed 32-byte region [fff00000c595c700, fff00000c595c720)
[   18.851094] 
[   18.851137] The buggy address belongs to the physical page:
[   18.851427] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10595c
[   18.851689] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.851790] page_type: f5(slab)
[   18.851952] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   18.852034] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   18.852212] page dumped because: kasan: bad access detected
[   18.852255] 
[   18.852419] Memory state around the buggy address:
[   18.852600]  fff00000c595c600: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   18.852782]  fff00000c595c680: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   18.852910] >fff00000c595c700: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   18.853235]                          ^
[   18.853321]  fff00000c595c780: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   18.853400]  fff00000c595c800: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   18.853605] ==================================================================

[   14.598292] ==================================================================
[   14.598958] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   14.599280] Read of size 1 at addr ffff888103a5c550 by task kunit_try_catch/276
[   14.599685] 
[   14.599783] CPU: 0 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   14.599826] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.599837] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.599859] Call Trace:
[   14.599874]  <TASK>
[   14.599888]  dump_stack_lvl+0x73/0xb0
[   14.599916]  print_report+0xd1/0x610
[   14.599938]  ? __virt_addr_valid+0x1db/0x2d0
[   14.599962]  ? strnlen+0x73/0x80
[   14.600035]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.600061]  ? strnlen+0x73/0x80
[   14.600081]  kasan_report+0x141/0x180
[   14.600105]  ? strnlen+0x73/0x80
[   14.600128]  __asan_report_load1_noabort+0x18/0x20
[   14.600155]  strnlen+0x73/0x80
[   14.600174]  kasan_strings+0x615/0xe80
[   14.600195]  ? trace_hardirqs_on+0x37/0xe0
[   14.600220]  ? __pfx_kasan_strings+0x10/0x10
[   14.600242]  ? finish_task_switch.isra.0+0x153/0x700
[   14.600267]  ? __switch_to+0x47/0xf50
[   14.600293]  ? __schedule+0x10cc/0x2b60
[   14.600316]  ? __pfx_read_tsc+0x10/0x10
[   14.600337]  ? ktime_get_ts64+0x86/0x230
[   14.600362]  kunit_try_run_case+0x1a5/0x480
[   14.600387]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.600412]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.600451]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.600476]  ? __kthread_parkme+0x82/0x180
[   14.600497]  ? preempt_count_sub+0x50/0x80
[   14.600521]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.600548]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.600573]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.600599]  kthread+0x337/0x6f0
[   14.600619]  ? trace_preempt_on+0x20/0xc0
[   14.600641]  ? __pfx_kthread+0x10/0x10
[   14.600662]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.600686]  ? calculate_sigpending+0x7b/0xa0
[   14.600711]  ? __pfx_kthread+0x10/0x10
[   14.600732]  ret_from_fork+0x116/0x1d0
[   14.600752]  ? __pfx_kthread+0x10/0x10
[   14.600787]  ret_from_fork_asm+0x1a/0x30
[   14.600818]  </TASK>
[   14.600828] 
[   14.608624] Allocated by task 276:
[   14.608811]  kasan_save_stack+0x45/0x70
[   14.609153]  kasan_save_track+0x18/0x40
[   14.609351]  kasan_save_alloc_info+0x3b/0x50
[   14.609621]  __kasan_kmalloc+0xb7/0xc0
[   14.609813]  __kmalloc_cache_noprof+0x189/0x420
[   14.610034]  kasan_strings+0xc0/0xe80
[   14.610229]  kunit_try_run_case+0x1a5/0x480
[   14.610426]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.610618]  kthread+0x337/0x6f0
[   14.610741]  ret_from_fork+0x116/0x1d0
[   14.610945]  ret_from_fork_asm+0x1a/0x30
[   14.611198] 
[   14.611300] Freed by task 276:
[   14.611467]  kasan_save_stack+0x45/0x70
[   14.611646]  kasan_save_track+0x18/0x40
[   14.611830]  kasan_save_free_info+0x3f/0x60
[   14.612054]  __kasan_slab_free+0x56/0x70
[   14.612226]  kfree+0x222/0x3f0
[   14.612346]  kasan_strings+0x2aa/0xe80
[   14.612582]  kunit_try_run_case+0x1a5/0x480
[   14.612806]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.613195]  kthread+0x337/0x6f0
[   14.613362]  ret_from_fork+0x116/0x1d0
[   14.613655]  ret_from_fork_asm+0x1a/0x30
[   14.613836] 
[   14.613939] The buggy address belongs to the object at ffff888103a5c540
[   14.613939]  which belongs to the cache kmalloc-32 of size 32
[   14.614436] The buggy address is located 16 bytes inside of
[   14.614436]  freed 32-byte region [ffff888103a5c540, ffff888103a5c560)
[   14.614804] 
[   14.614901] The buggy address belongs to the physical page:
[   14.615212] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103a5c
[   14.615575] flags: 0x200000000000000(node=0|zone=2)
[   14.615794] page_type: f5(slab)
[   14.615948] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   14.616285] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   14.616693] page dumped because: kasan: bad access detected
[   14.616928] 
[   14.617171] Memory state around the buggy address:
[   14.617376]  ffff888103a5c400: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.617731]  ffff888103a5c480: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.618097] >ffff888103a5c500: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   14.618378]                                                  ^
[   14.618643]  ffff888103a5c580: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.618946]  ffff888103a5c600: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   14.619242] ==================================================================