Hay
Date
July 17, 2025, 11:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   17.854646] ==================================================================
[   17.854697] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   17.854745] Read of size 1 at addr fff00000c7940d90 by task kunit_try_catch/260
[   17.854797] 
[   17.854827] CPU: 0 UID: 0 PID: 260 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   17.854910] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.854939] Hardware name: linux,dummy-virt (DT)
[   17.854971] Call trace:
[   17.855230]  show_stack+0x20/0x38 (C)
[   17.855282]  dump_stack_lvl+0x8c/0xd0
[   17.855345]  print_report+0x118/0x5d0
[   17.855394]  kasan_report+0xdc/0x128
[   17.855444]  __asan_report_load1_noabort+0x20/0x30
[   17.855499]  strnlen+0x80/0x88
[   17.855540]  kasan_strings+0x478/0xb00
[   17.855584]  kunit_try_run_case+0x170/0x3f0
[   17.855641]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.855706]  kthread+0x328/0x630
[   17.855757]  ret_from_fork+0x10/0x20
[   17.855804] 
[   17.855824] Allocated by task 260:
[   17.855853]  kasan_save_stack+0x3c/0x68
[   17.855902]  kasan_save_track+0x20/0x40
[   17.855957]  kasan_save_alloc_info+0x40/0x58
[   17.856010]  __kasan_kmalloc+0xd4/0xd8
[   17.856049]  __kmalloc_cache_noprof+0x16c/0x3c0
[   17.856089]  kasan_strings+0xc8/0xb00
[   17.856127]  kunit_try_run_case+0x170/0x3f0
[   17.856166]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.856212]  kthread+0x328/0x630
[   17.856246]  ret_from_fork+0x10/0x20
[   17.856282] 
[   17.856302] Freed by task 260:
[   17.856330]  kasan_save_stack+0x3c/0x68
[   17.856368]  kasan_save_track+0x20/0x40
[   17.856415]  kasan_save_free_info+0x4c/0x78
[   17.856464]  __kasan_slab_free+0x6c/0x98
[   17.856513]  kfree+0x214/0x3c8
[   17.856548]  kasan_strings+0x24c/0xb00
[   17.856585]  kunit_try_run_case+0x170/0x3f0
[   17.856623]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.856669]  kthread+0x328/0x630
[   17.856701]  ret_from_fork+0x10/0x20
[   17.856739] 
[   17.856764] The buggy address belongs to the object at fff00000c7940d80
[   17.856764]  which belongs to the cache kmalloc-32 of size 32
[   17.856825] The buggy address is located 16 bytes inside of
[   17.856825]  freed 32-byte region [fff00000c7940d80, fff00000c7940da0)
[   17.856889] 
[   17.856910] The buggy address belongs to the physical page:
[   17.856943] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107940
[   17.857005] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.857053] page_type: f5(slab)
[   17.857341] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   17.857443] raw: 0000000000000000 0000000000400040 00000000f5000000 0000000000000000
[   17.857584] page dumped because: kasan: bad access detected
[   17.857644] 
[   17.857703] Memory state around the buggy address:
[   17.857818]  fff00000c7940c80: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   17.857945]  fff00000c7940d00: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   17.858043] >fff00000c7940d80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   17.858108]                          ^
[   17.858175]  fff00000c7940e00: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   17.858220]  fff00000c7940e80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   17.858260] ==================================================================

[   15.065859] ==================================================================
[   15.066164] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   15.066583] Read of size 1 at addr ffff888102a5ed10 by task kunit_try_catch/276
[   15.066889] 
[   15.066990] CPU: 1 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   15.067033] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.067045] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   15.067068] Call Trace:
[   15.067082]  <TASK>
[   15.067096]  dump_stack_lvl+0x73/0xb0
[   15.067123]  print_report+0xd1/0x610
[   15.067145]  ? __virt_addr_valid+0x1db/0x2d0
[   15.067168]  ? strnlen+0x73/0x80
[   15.067186]  ? kasan_complete_mode_report_info+0x64/0x200
[   15.067209]  ? strnlen+0x73/0x80
[   15.067228]  kasan_report+0x141/0x180
[   15.067414]  ? strnlen+0x73/0x80
[   15.067439]  __asan_report_load1_noabort+0x18/0x20
[   15.067465]  strnlen+0x73/0x80
[   15.067485]  kasan_strings+0x615/0xe80
[   15.067504]  ? trace_hardirqs_on+0x37/0xe0
[   15.067529]  ? __pfx_kasan_strings+0x10/0x10
[   15.067565]  ? finish_task_switch.isra.0+0x153/0x700
[   15.067589]  ? __switch_to+0x47/0xf50
[   15.067614]  ? __schedule+0x10cc/0x2b60
[   15.067637]  ? __pfx_read_tsc+0x10/0x10
[   15.067659]  ? ktime_get_ts64+0x86/0x230
[   15.067683]  kunit_try_run_case+0x1a5/0x480
[   15.067708]  ? __pfx_kunit_try_run_case+0x10/0x10
[   15.067732]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   15.067756]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   15.067781]  ? __kthread_parkme+0x82/0x180
[   15.067802]  ? preempt_count_sub+0x50/0x80
[   15.067826]  ? __pfx_kunit_try_run_case+0x10/0x10
[   15.067851]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   15.067876]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   15.067902]  kthread+0x337/0x6f0
[   15.067921]  ? trace_preempt_on+0x20/0xc0
[   15.067944]  ? __pfx_kthread+0x10/0x10
[   15.067965]  ? _raw_spin_unlock_irq+0x47/0x80
[   15.067987]  ? calculate_sigpending+0x7b/0xa0
[   15.068011]  ? __pfx_kthread+0x10/0x10
[   15.068033]  ret_from_fork+0x116/0x1d0
[   15.068057]  ? __pfx_kthread+0x10/0x10
[   15.068078]  ret_from_fork_asm+0x1a/0x30
[   15.068108]  </TASK>
[   15.068119] 
[   15.076154] Allocated by task 276:
[   15.076462]  kasan_save_stack+0x45/0x70
[   15.076691]  kasan_save_track+0x18/0x40
[   15.076868]  kasan_save_alloc_info+0x3b/0x50
[   15.077105]  __kasan_kmalloc+0xb7/0xc0
[   15.077386]  __kmalloc_cache_noprof+0x189/0x420
[   15.077633]  kasan_strings+0xc0/0xe80
[   15.077853]  kunit_try_run_case+0x1a5/0x480
[   15.078002]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   15.078178]  kthread+0x337/0x6f0
[   15.078365]  ret_from_fork+0x116/0x1d0
[   15.078523]  ret_from_fork_asm+0x1a/0x30
[   15.078728] 
[   15.078847] Freed by task 276:
[   15.079002]  kasan_save_stack+0x45/0x70
[   15.079193]  kasan_save_track+0x18/0x40
[   15.079593]  kasan_save_free_info+0x3f/0x60
[   15.079810]  __kasan_slab_free+0x56/0x70
[   15.080007]  kfree+0x222/0x3f0
[   15.080196]  kasan_strings+0x2aa/0xe80
[   15.080493]  kunit_try_run_case+0x1a5/0x480
[   15.080737]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   15.081006]  kthread+0x337/0x6f0
[   15.081134]  ret_from_fork+0x116/0x1d0
[   15.081349]  ret_from_fork_asm+0x1a/0x30
[   15.081521] 
[   15.081628] The buggy address belongs to the object at ffff888102a5ed00
[   15.081628]  which belongs to the cache kmalloc-32 of size 32
[   15.082189] The buggy address is located 16 bytes inside of
[   15.082189]  freed 32-byte region [ffff888102a5ed00, ffff888102a5ed20)
[   15.082824] 
[   15.082923] The buggy address belongs to the physical page:
[   15.083196] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a5e
[   15.083768] flags: 0x200000000000000(node=0|zone=2)
[   15.084001] page_type: f5(slab)
[   15.084176] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   15.084614] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   15.084924] page dumped because: kasan: bad access detected
[   15.085178] 
[   15.085332] Memory state around the buggy address:
[   15.085599]  ffff888102a5ec00: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   15.085924]  ffff888102a5ec80: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   15.086303] >ffff888102a5ed00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   15.086668]                          ^
[   15.086841]  ffff888102a5ed80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   15.087057]  ffff888102a5ee00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   15.087459] ==================================================================