Hay
Date
July 3, 2025, 6:13 p.m.

Environment
qemu-arm64
qemu-x86_64

[   19.167006] ==================================================================
[   19.168105] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   19.168192] Read of size 1 at addr fff00000c7832b50 by task kunit_try_catch/259
[   19.168259] 
[   19.168293] CPU: 1 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   19.168375] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.168415] Hardware name: linux,dummy-virt (DT)
[   19.168456] Call trace:
[   19.168480]  show_stack+0x20/0x38 (C)
[   19.168748]  dump_stack_lvl+0x8c/0xd0
[   19.168871]  print_report+0x118/0x608
[   19.168955]  kasan_report+0xdc/0x128
[   19.169110]  __asan_report_load1_noabort+0x20/0x30
[   19.169319]  strnlen+0x80/0x88
[   19.169741]  kasan_strings+0x478/0xb00
[   19.169836]  kunit_try_run_case+0x170/0x3f0
[   19.169908]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.170260]  kthread+0x328/0x630
[   19.170462]  ret_from_fork+0x10/0x20
[   19.170831] 
[   19.170954] Allocated by task 259:
[   19.171332]  kasan_save_stack+0x3c/0x68
[   19.171936]  kasan_save_track+0x20/0x40
[   19.172096]  kasan_save_alloc_info+0x40/0x58
[   19.172342]  __kasan_kmalloc+0xd4/0xd8
[   19.172479]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.172771]  kasan_strings+0xc8/0xb00
[   19.172964]  kunit_try_run_case+0x170/0x3f0
[   19.173072]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.173308]  kthread+0x328/0x630
[   19.173354]  ret_from_fork+0x10/0x20
[   19.173566] 
[   19.173677] Freed by task 259:
[   19.173713]  kasan_save_stack+0x3c/0x68
[   19.174089]  kasan_save_track+0x20/0x40
[   19.174272]  kasan_save_free_info+0x4c/0x78
[   19.174426]  __kasan_slab_free+0x6c/0x98
[   19.174469]  kfree+0x214/0x3c8
[   19.174549]  kasan_strings+0x24c/0xb00
[   19.174749]  kunit_try_run_case+0x170/0x3f0
[   19.174918]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.175110]  kthread+0x328/0x630
[   19.175242]  ret_from_fork+0x10/0x20
[   19.175359] 
[   19.175429] The buggy address belongs to the object at fff00000c7832b40
[   19.175429]  which belongs to the cache kmalloc-32 of size 32
[   19.175639] The buggy address is located 16 bytes inside of
[   19.175639]  freed 32-byte region [fff00000c7832b40, fff00000c7832b60)
[   19.175843] 
[   19.175934] The buggy address belongs to the physical page:
[   19.176067] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107832
[   19.176196] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.176273] page_type: f5(slab)
[   19.176489] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   19.176778] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   19.176975] page dumped because: kasan: bad access detected
[   19.177130] 
[   19.177211] Memory state around the buggy address:
[   19.177275]  fff00000c7832a00: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   19.177501]  fff00000c7832a80: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   19.177707] >fff00000c7832b00: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   19.177868]                                                  ^
[   19.177965]  fff00000c7832b80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   19.178098]  fff00000c7832c00: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   19.178192] ==================================================================

[   13.419681] ==================================================================
[   13.420031] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   13.420459] Read of size 1 at addr ffff8881038e6250 by task kunit_try_catch/277
[   13.420795] 
[   13.420897] CPU: 0 UID: 0 PID: 277 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   13.420949] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.420962] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.420981] Call Trace:
[   13.421006]  <TASK>
[   13.421019]  dump_stack_lvl+0x73/0xb0
[   13.421045]  print_report+0xd1/0x650
[   13.421069]  ? __virt_addr_valid+0x1db/0x2d0
[   13.421109]  ? strnlen+0x73/0x80
[   13.421126]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.421148]  ? strnlen+0x73/0x80
[   13.421176]  kasan_report+0x141/0x180
[   13.421208]  ? strnlen+0x73/0x80
[   13.421229]  __asan_report_load1_noabort+0x18/0x20
[   13.421253]  strnlen+0x73/0x80
[   13.421271]  kasan_strings+0x615/0xe80
[   13.421290]  ? trace_hardirqs_on+0x37/0xe0
[   13.421356]  ? __pfx_kasan_strings+0x10/0x10
[   13.421390]  ? finish_task_switch.isra.0+0x153/0x700
[   13.421412]  ? __switch_to+0x47/0xf50
[   13.421435]  ? __schedule+0x10cc/0x2b60
[   13.421457]  ? __pfx_read_tsc+0x10/0x10
[   13.421477]  ? ktime_get_ts64+0x86/0x230
[   13.421500]  kunit_try_run_case+0x1a5/0x480
[   13.421524]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.421545]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.421568]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.421590]  ? __kthread_parkme+0x82/0x180
[   13.421609]  ? preempt_count_sub+0x50/0x80
[   13.421632]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.421655]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.421677]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.421702]  kthread+0x337/0x6f0
[   13.421720]  ? trace_preempt_on+0x20/0xc0
[   13.421742]  ? __pfx_kthread+0x10/0x10
[   13.421762]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.421783]  ? calculate_sigpending+0x7b/0xa0
[   13.421807]  ? __pfx_kthread+0x10/0x10
[   13.421828]  ret_from_fork+0x116/0x1d0
[   13.421846]  ? __pfx_kthread+0x10/0x10
[   13.421866]  ret_from_fork_asm+0x1a/0x30
[   13.421895]  </TASK>
[   13.421906] 
[   13.429986] Allocated by task 277:
[   13.430253]  kasan_save_stack+0x45/0x70
[   13.430449]  kasan_save_track+0x18/0x40
[   13.430661]  kasan_save_alloc_info+0x3b/0x50
[   13.430861]  __kasan_kmalloc+0xb7/0xc0
[   13.431041]  __kmalloc_cache_noprof+0x189/0x420
[   13.431512]  kasan_strings+0xc0/0xe80
[   13.431724]  kunit_try_run_case+0x1a5/0x480
[   13.431906]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.432223]  kthread+0x337/0x6f0
[   13.432437]  ret_from_fork+0x116/0x1d0
[   13.432615]  ret_from_fork_asm+0x1a/0x30
[   13.432757] 
[   13.432827] Freed by task 277:
[   13.432940]  kasan_save_stack+0x45/0x70
[   13.433076]  kasan_save_track+0x18/0x40
[   13.433225]  kasan_save_free_info+0x3f/0x60
[   13.433691]  __kasan_slab_free+0x56/0x70
[   13.433889]  kfree+0x222/0x3f0
[   13.434052]  kasan_strings+0x2aa/0xe80
[   13.434426]  kunit_try_run_case+0x1a5/0x480
[   13.434641]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.434893]  kthread+0x337/0x6f0
[   13.435105]  ret_from_fork+0x116/0x1d0
[   13.435349]  ret_from_fork_asm+0x1a/0x30
[   13.435550] 
[   13.435657] The buggy address belongs to the object at ffff8881038e6240
[   13.435657]  which belongs to the cache kmalloc-32 of size 32
[   13.436012] The buggy address is located 16 bytes inside of
[   13.436012]  freed 32-byte region [ffff8881038e6240, ffff8881038e6260)
[   13.436540] 
[   13.436650] The buggy address belongs to the physical page:
[   13.436852] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1038e6
[   13.437094] flags: 0x200000000000000(node=0|zone=2)
[   13.437267] page_type: f5(slab)
[   13.437388] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.437984] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   13.438358] page dumped because: kasan: bad access detected
[   13.438617] 
[   13.438712] Memory state around the buggy address:
[   13.439106]  ffff8881038e6100: 00 00 00 fc fc fc fc fc 00 00 00 04 fc fc fc fc
[   13.439677]  ffff8881038e6180: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   13.440000] >ffff8881038e6200: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   13.440402]                                                  ^
[   13.440585]  ffff8881038e6280: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.440906]  ffff8881038e6300: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   13.441329] ==================================================================