Hay
Date
July 12, 2025, 11:09 a.m.

Environment
qemu-arm64
qemu-x86_64

[   22.327758] ==================================================================
[   22.327887] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   22.327996] Read of size 1 at addr fff00000c5941f90 by task kunit_try_catch/260
[   22.328118] 
[   22.328190] CPU: 1 UID: 0 PID: 260 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   22.328379] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.328444] Hardware name: linux,dummy-virt (DT)
[   22.328516] Call trace:
[   22.328575]  show_stack+0x20/0x38 (C)
[   22.328684]  dump_stack_lvl+0x8c/0xd0
[   22.328785]  print_report+0x118/0x608
[   22.328897]  kasan_report+0xdc/0x128
[   22.328999]  __asan_report_load1_noabort+0x20/0x30
[   22.330237]  strnlen+0x80/0x88
[   22.330481]  kasan_strings+0x478/0xb00
[   22.331291]  kunit_try_run_case+0x170/0x3f0
[   22.331437]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.331558]  kthread+0x328/0x630
[   22.332341]  ret_from_fork+0x10/0x20
[   22.332492] 
[   22.332543] Allocated by task 260:
[   22.332607]  kasan_save_stack+0x3c/0x68
[   22.333052]  kasan_save_track+0x20/0x40
[   22.333306]  kasan_save_alloc_info+0x40/0x58
[   22.333553]  __kasan_kmalloc+0xd4/0xd8
[   22.333651]  __kmalloc_cache_noprof+0x16c/0x3c0
[   22.333749]  kasan_strings+0xc8/0xb00
[   22.333835]  kunit_try_run_case+0x170/0x3f0
[   22.333911]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.334385]  kthread+0x328/0x630
[   22.335397]  ret_from_fork+0x10/0x20
[   22.335485] 
[   22.335518] Freed by task 260:
[   22.335555]  kasan_save_stack+0x3c/0x68
[   22.335623]  kasan_save_track+0x20/0x40
[   22.335681]  kasan_save_free_info+0x4c/0x78
[   22.335729]  __kasan_slab_free+0x6c/0x98
[   22.335773]  kfree+0x214/0x3c8
[   22.335817]  kasan_strings+0x24c/0xb00
[   22.335923]  kunit_try_run_case+0x170/0x3f0
[   22.336205]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.336406]  kthread+0x328/0x630
[   22.336577]  ret_from_fork+0x10/0x20
[   22.336776] 
[   22.336851] The buggy address belongs to the object at fff00000c5941f80
[   22.336851]  which belongs to the cache kmalloc-32 of size 32
[   22.337553] The buggy address is located 16 bytes inside of
[   22.337553]  freed 32-byte region [fff00000c5941f80, fff00000c5941fa0)
[   22.337885] 
[   22.337954] The buggy address belongs to the physical page:
[   22.338023] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105941
[   22.338124] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   22.339278] page_type: f5(slab)
[   22.339458] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   22.339577] raw: 0000000000000000 0000000000400040 00000000f5000000 0000000000000000
[   22.339679] page dumped because: kasan: bad access detected
[   22.339789] 
[   22.339850] Memory state around the buggy address:
[   22.339937]  fff00000c5941e80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   22.340046]  fff00000c5941f00: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   22.340151] >fff00000c5941f80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   22.340244]                          ^
[   22.340318]  fff00000c5942000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   22.340423]  fff00000c5942080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.340518] ==================================================================

[   14.645806] ==================================================================
[   14.646228] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   14.646486] Read of size 1 at addr ffff888103acf910 by task kunit_try_catch/277
[   14.647227] 
[   14.647347] CPU: 0 UID: 0 PID: 277 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   14.647390] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.647402] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.647422] Call Trace:
[   14.647437]  <TASK>
[   14.647452]  dump_stack_lvl+0x73/0xb0
[   14.647480]  print_report+0xd1/0x650
[   14.647502]  ? __virt_addr_valid+0x1db/0x2d0
[   14.647525]  ? strnlen+0x73/0x80
[   14.647542]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.647566]  ? strnlen+0x73/0x80
[   14.647584]  kasan_report+0x141/0x180
[   14.647606]  ? strnlen+0x73/0x80
[   14.647628]  __asan_report_load1_noabort+0x18/0x20
[   14.647653]  strnlen+0x73/0x80
[   14.647686]  kasan_strings+0x615/0xe80
[   14.647706]  ? trace_hardirqs_on+0x37/0xe0
[   14.647730]  ? __pfx_kasan_strings+0x10/0x10
[   14.647763]  ? finish_task_switch.isra.0+0x153/0x700
[   14.647785]  ? __switch_to+0x47/0xf50
[   14.647811]  ? __schedule+0x10cc/0x2b60
[   14.647832]  ? __pfx_read_tsc+0x10/0x10
[   14.647853]  ? ktime_get_ts64+0x86/0x230
[   14.647877]  kunit_try_run_case+0x1a5/0x480
[   14.647901]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.647925]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.647948]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.647972]  ? __kthread_parkme+0x82/0x180
[   14.647991]  ? preempt_count_sub+0x50/0x80
[   14.648014]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.648039]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.648064]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.648090]  kthread+0x337/0x6f0
[   14.648108]  ? trace_preempt_on+0x20/0xc0
[   14.648130]  ? __pfx_kthread+0x10/0x10
[   14.648150]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.648172]  ? calculate_sigpending+0x7b/0xa0
[   14.648196]  ? __pfx_kthread+0x10/0x10
[   14.648217]  ret_from_fork+0x116/0x1d0
[   14.648235]  ? __pfx_kthread+0x10/0x10
[   14.648255]  ret_from_fork_asm+0x1a/0x30
[   14.648285]  </TASK>
[   14.648294] 
[   14.656256] Allocated by task 277:
[   14.656449]  kasan_save_stack+0x45/0x70
[   14.656656]  kasan_save_track+0x18/0x40
[   14.656912]  kasan_save_alloc_info+0x3b/0x50
[   14.657167]  __kasan_kmalloc+0xb7/0xc0
[   14.657357]  __kmalloc_cache_noprof+0x189/0x420
[   14.657582]  kasan_strings+0xc0/0xe80
[   14.657833]  kunit_try_run_case+0x1a5/0x480
[   14.658020]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.658256]  kthread+0x337/0x6f0
[   14.658392]  ret_from_fork+0x116/0x1d0
[   14.658524]  ret_from_fork_asm+0x1a/0x30
[   14.658822] 
[   14.658923] Freed by task 277:
[   14.659081]  kasan_save_stack+0x45/0x70
[   14.659277]  kasan_save_track+0x18/0x40
[   14.659458]  kasan_save_free_info+0x3f/0x60
[   14.659870]  __kasan_slab_free+0x56/0x70
[   14.660034]  kfree+0x222/0x3f0
[   14.660152]  kasan_strings+0x2aa/0xe80
[   14.660285]  kunit_try_run_case+0x1a5/0x480
[   14.660430]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.660673]  kthread+0x337/0x6f0
[   14.661031]  ret_from_fork+0x116/0x1d0
[   14.661223]  ret_from_fork_asm+0x1a/0x30
[   14.661418] 
[   14.661510] The buggy address belongs to the object at ffff888103acf900
[   14.661510]  which belongs to the cache kmalloc-32 of size 32
[   14.662156] The buggy address is located 16 bytes inside of
[   14.662156]  freed 32-byte region [ffff888103acf900, ffff888103acf920)
[   14.662575] 
[   14.662646] The buggy address belongs to the physical page:
[   14.662955] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103acf
[   14.663293] flags: 0x200000000000000(node=0|zone=2)
[   14.663511] page_type: f5(slab)
[   14.663710] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   14.664023] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   14.664272] page dumped because: kasan: bad access detected
[   14.664459] 
[   14.664550] Memory state around the buggy address:
[   14.665031]  ffff888103acf800: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.665381]  ffff888103acf880: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.665729] >ffff888103acf900: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.665956]                          ^
[   14.666133]  ffff888103acf980: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.666457]  ffff888103acfa00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.666779] ==================================================================