Hay
Date
July 11, 2025, 11:09 p.m.

Environment
qemu-arm64
qemu-x86_64

[   19.048698] ==================================================================
[   19.048781] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   19.048891] Read of size 1 at addr fff00000c5908250 by task kunit_try_catch/260
[   19.048945] 
[   19.048980] CPU: 1 UID: 0 PID: 260 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   19.049192] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.049230] Hardware name: linux,dummy-virt (DT)
[   19.049264] Call trace:
[   19.049327]  show_stack+0x20/0x38 (C)
[   19.049377]  dump_stack_lvl+0x8c/0xd0
[   19.049426]  print_report+0x118/0x608
[   19.049602]  kasan_report+0xdc/0x128
[   19.049708]  __asan_report_load1_noabort+0x20/0x30
[   19.049764]  strnlen+0x80/0x88
[   19.049809]  kasan_strings+0x478/0xb00
[   19.049976]  kunit_try_run_case+0x170/0x3f0
[   19.050062]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.050116]  kthread+0x328/0x630
[   19.050161]  ret_from_fork+0x10/0x20
[   19.050214] 
[   19.050263] Allocated by task 260:
[   19.050308]  kasan_save_stack+0x3c/0x68
[   19.050352]  kasan_save_track+0x20/0x40
[   19.050390]  kasan_save_alloc_info+0x40/0x58
[   19.050432]  __kasan_kmalloc+0xd4/0xd8
[   19.050606]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.050885]  kthread+0x328/0x630
[   19.052562] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   19.058073]     not ok 62 kasan_strings
[   19.061539]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.062073]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.062598] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.063685]  fff00000c5857e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.065323] CPU: 1 UID: 0 PID: 262 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   19.067259]  kasan_bitops_generic+0xa0/0x1c8
[   19.068797] page_type: f5(slab)
[   19.070427]                                               ^
[   19.072051] Call trace:
[   19.074532] 
[   19.075277] page dumped because: kasan: bad access detected
[   19.075499]                                               ^
[   19.076210] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.076295]  show_stack+0x20/0x38 (C)
[   19.076774]  kthread+0x328/0x630
[   19.076921] Allocated by task 262:
[   19.077108]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.077432] The buggy address is located 8 bytes inside of
[   19.077432]  allocated 9-byte region [fff00000c5857dc0, fff00000c5857dc9)
[   19.077804] page dumped because: kasan: bad access detected
[   19.079289]                                               ^
[   19.079363]  fff00000c5857e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.080565] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.080618] Hardware name: linux,dummy-virt (DT)
[   19.080902]  kasan_report+0xdc/0x128
[   19.081590]  kthread+0x328/0x630
[   19.081965]  kasan_save_stack+0x3c/0x68
[   19.082435]  kthread+0x328/0x630
[   19.083048] 
[   19.083125] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105857
[   19.083901]  fff00000c5857c80: 00 04 fc fc 00 04 fc fc fa fb fc fc 00 05 fc fc
[   19.084333] >fff00000c5857d80: 00 00 fc fc fa fb fc fc 00 01 fc fc fc fc fc fc
[   19.084436]                                               ^
[   19.084512]  fff00000c5857e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.085497] 
[   19.085956] Call trace:
[   19.086437]  __kasan_check_write+0x20/0x30
[   19.086816]  ret_from_fork+0x10/0x20
[   19.089809] >fff00000c5857d80: 00 00 fc fc fa fb fc fc 00 01 fc fc fc fc fc fc
[   19.090069]  fff00000c5857e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.091241] ==================================================================

[   14.411535] ==================================================================
[   14.412181] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   14.412623] Read of size 1 at addr ffff888102a16ad0 by task kunit_try_catch/276
[   14.412844] 
[   14.412999] CPU: 1 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   14.413132] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.413145] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.413164] Call Trace:
[   14.413177]  <TASK>
[   14.413191]  dump_stack_lvl+0x73/0xb0
[   14.413219]  print_report+0xd1/0x650
[   14.413240]  ? __virt_addr_valid+0x1db/0x2d0
[   14.413264]  ? strnlen+0x73/0x80
[   14.413280]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.413304]  ? strnlen+0x73/0x80
[   14.413322]  kasan_report+0x141/0x180
[   14.413344]  ? strnlen+0x73/0x80
[   14.413367]  __asan_report_load1_noabort+0x18/0x20
[   14.413391]  strnlen+0x73/0x80
[   14.413409]  kasan_strings+0x615/0xe80
[   14.413428]  ? trace_hardirqs_on+0x37/0xe0
[   14.413451]  ? __pfx_kasan_strings+0x10/0x10
[   14.413471]  ? finish_task_switch.isra.0+0x153/0x700
[   14.413493]  ? __switch_to+0x47/0xf50
[   14.413517]  ? __schedule+0x10cc/0x2b60
[   14.413609]  ? __pfx_read_tsc+0x10/0x10
[   14.413631]  ? ktime_get_ts64+0x86/0x230
[   14.413655]  kunit_try_run_case+0x1a5/0x480
[   14.413680]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.413703]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.413726]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.413769]  ? __kthread_parkme+0x82/0x180
[   14.413789]  ? preempt_count_sub+0x50/0x80
[   14.413812]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.413870]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.413895]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.413929]  kthread+0x337/0x6f0
[   14.413948]  ? trace_preempt_on+0x20/0xc0
[   14.413970]  ? __pfx_kthread+0x10/0x10
[   14.414089]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.414114]  ? calculate_sigpending+0x7b/0xa0
[   14.414139]  ? __pfx_kthread+0x10/0x10
[   14.414161]  ret_from_fork+0x116/0x1d0
[   14.414180]  ? __pfx_kthread+0x10/0x10
[   14.414201]  ret_from_fork_asm+0x1a/0x30
[   14.414232]  </TASK>
[   14.414241] 
[   14.422678] Allocated by task 276:
[   14.422899]  kasan_save_stack+0x45/0x70
[   14.423184]  kasan_save_track+0x18/0x40
[   14.423409]  kasan_save_alloc_info+0x3b/0x50
[   14.423621]  __kasan_kmalloc+0xb7/0xc0
[   14.423851]  __kmalloc_cache_noprof+0x189/0x420
[   14.424284]  kasan_strings+0xc0/0xe80
[   14.424431]  kunit_try_run_case+0x1a5/0x480
[   14.424573]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.424883]  kthread+0x337/0x6f0
[   14.425196]  ret_from_fork+0x116/0x1d0
[   14.425385]  ret_from_fork_asm+0x1a/0x30
[   14.425600] 
[   14.425695] Freed by task 276:
[   14.425887]  kasan_save_stack+0x45/0x70
[   14.426192]  kasan_save_track+0x18/0x40
[   14.426421]  kasan_save_free_info+0x3f/0x60
[   14.426650]  __kasan_slab_free+0x56/0x70
[   14.426877]  kfree+0x222/0x3f0
[   14.427138]  kasan_strings+0x2aa/0xe80
[   14.427344]  kunit_try_run_case+0x1a5/0x480
[   14.427569]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.427854]  kthread+0x337/0x6f0
[   14.428231]  ret_from_fork+0x116/0x1d0
[   14.428390]  ret_from_fork_asm+0x1a/0x30
[   14.428623] 
[   14.428712] The buggy address belongs to the object at ffff888102a16ac0
[   14.428712]  which belongs to the cache kmalloc-32 of size 32
[   14.429385] The buggy address is located 16 bytes inside of
[   14.429385]  freed 32-byte region [ffff888102a16ac0, ffff888102a16ae0)
[   14.429973] 
[   14.430165] The buggy address belongs to the physical page:
[   14.430417] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a16
[   14.430763] flags: 0x200000000000000(node=0|zone=2)
[   14.431050] page_type: f5(slab)
[   14.431221] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   14.431492] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   14.431836] page dumped because: kasan: bad access detected
[   14.432106] 
[   14.432191] Memory state around the buggy address:
[   14.432404]  ffff888102a16980: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.432705]  ffff888102a16a00: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.433227] >ffff888102a16a80: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   14.433570]                                                  ^
[   14.433804]  ffff888102a16b00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.434173]  ffff888102a16b80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   14.434544] ==================================================================