Hay
Date
June 25, 2025, 8:08 a.m.

Environment
qemu-x86_64

[   25.878926] ==================================================================
[   25.879535] BUG: KASAN: slab-out-of-bounds in strncpy_from_user+0x1a5/0x1d0
[   25.880221] Write of size 1 at addr ffff888102597c78 by task kunit_try_catch/314
[   25.880483] 
[   25.880595] CPU: 0 UID: 0 PID: 314 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250625 #1 PREEMPT(voluntary) 
[   25.880643] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.880698] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.880743] Call Trace:
[   25.880764]  <TASK>
[   25.880782]  dump_stack_lvl+0x73/0xb0
[   25.880810]  print_report+0xd1/0x650
[   25.880833]  ? __virt_addr_valid+0x1db/0x2d0
[   25.880858]  ? strncpy_from_user+0x1a5/0x1d0
[   25.880883]  ? kasan_complete_mode_report_info+0x2a/0x200
[   25.880951]  ? strncpy_from_user+0x1a5/0x1d0
[   25.880976]  kasan_report+0x141/0x180
[   25.880997]  ? strncpy_from_user+0x1a5/0x1d0
[   25.881025]  __asan_report_store1_noabort+0x1b/0x30
[   25.881080]  strncpy_from_user+0x1a5/0x1d0
[   25.881107]  copy_user_test_oob+0x760/0x10f0
[   25.881133]  ? __pfx_copy_user_test_oob+0x10/0x10
[   25.881155]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   25.881182]  ? __pfx_copy_user_test_oob+0x10/0x10
[   25.881239]  kunit_try_run_case+0x1a5/0x480
[   25.881266]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.881289]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.881311]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.881336]  ? __kthread_parkme+0x82/0x180
[   25.881387]  ? preempt_count_sub+0x50/0x80
[   25.881411]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.881436]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.881459]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.881483]  kthread+0x337/0x6f0
[   25.881532]  ? trace_preempt_on+0x20/0xc0
[   25.881557]  ? __pfx_kthread+0x10/0x10
[   25.881578]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.881601]  ? calculate_sigpending+0x7b/0xa0
[   25.881625]  ? __pfx_kthread+0x10/0x10
[   25.881646]  ret_from_fork+0x116/0x1d0
[   25.881696]  ? __pfx_kthread+0x10/0x10
[   25.881716]  ret_from_fork_asm+0x1a/0x30
[   25.881746]  </TASK>
[   25.881758] 
[   25.888946] Allocated by task 314:
[   25.889171]  kasan_save_stack+0x45/0x70
[   25.889382]  kasan_save_track+0x18/0x40
[   25.889510]  kasan_save_alloc_info+0x3b/0x50
[   25.889746]  __kasan_kmalloc+0xb7/0xc0
[   25.889926]  __kmalloc_noprof+0x1c9/0x500
[   25.890129]  kunit_kmalloc_array+0x25/0x60
[   25.890368]  copy_user_test_oob+0xab/0x10f0
[   25.890566]  kunit_try_run_case+0x1a5/0x480
[   25.890791]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.891074]  kthread+0x337/0x6f0
[   25.891278]  ret_from_fork+0x116/0x1d0
[   25.891453]  ret_from_fork_asm+0x1a/0x30
[   25.891677] 
[   25.891747] The buggy address belongs to the object at ffff888102597c00
[   25.891747]  which belongs to the cache kmalloc-128 of size 128
[   25.892336] The buggy address is located 0 bytes to the right of
[   25.892336]  allocated 120-byte region [ffff888102597c00, ffff888102597c78)
[   25.892852] 
[   25.892986] The buggy address belongs to the physical page:
[   25.893288] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102597
[   25.893637] flags: 0x200000000000000(node=0|zone=2)
[   25.893870] page_type: f5(slab)
[   25.894022] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   25.894434] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   25.894745] page dumped because: kasan: bad access detected
[   25.895000] 
[   25.895092] Memory state around the buggy address:
[   25.895343]  ffff888102597b00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   25.895741]  ffff888102597b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.895959] >ffff888102597c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   25.896164]                                                                 ^
[   25.896403]  ffff888102597c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.896705]  ffff888102597d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.897044] ==================================================================
[   25.860778] ==================================================================
[   25.861133] BUG: KASAN: slab-out-of-bounds in strncpy_from_user+0x2e/0x1d0
[   25.861545] Write of size 121 at addr ffff888102597c00 by task kunit_try_catch/314
[   25.861883] 
[   25.862009] CPU: 0 UID: 0 PID: 314 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250625 #1 PREEMPT(voluntary) 
[   25.862061] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.862075] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.862097] Call Trace:
[   25.862119]  <TASK>
[   25.862140]  dump_stack_lvl+0x73/0xb0
[   25.862167]  print_report+0xd1/0x650
[   25.862190]  ? __virt_addr_valid+0x1db/0x2d0
[   25.862215]  ? strncpy_from_user+0x2e/0x1d0
[   25.862253]  ? kasan_complete_mode_report_info+0x2a/0x200
[   25.862279]  ? strncpy_from_user+0x2e/0x1d0
[   25.862303]  kasan_report+0x141/0x180
[   25.862362]  ? strncpy_from_user+0x2e/0x1d0
[   25.862389]  kasan_check_range+0x10c/0x1c0
[   25.862413]  __kasan_check_write+0x18/0x20
[   25.862436]  strncpy_from_user+0x2e/0x1d0
[   25.862458]  ? __kasan_check_read+0x15/0x20
[   25.862509]  copy_user_test_oob+0x760/0x10f0
[   25.862535]  ? __pfx_copy_user_test_oob+0x10/0x10
[   25.862557]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   25.862585]  ? __pfx_copy_user_test_oob+0x10/0x10
[   25.862611]  kunit_try_run_case+0x1a5/0x480
[   25.862639]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.862662]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.862684]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.862710]  ? __kthread_parkme+0x82/0x180
[   25.862731]  ? preempt_count_sub+0x50/0x80
[   25.862755]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.862780]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.862803]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.862827]  kthread+0x337/0x6f0
[   25.862847]  ? trace_preempt_on+0x20/0xc0
[   25.862870]  ? __pfx_kthread+0x10/0x10
[   25.862891]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.862914]  ? calculate_sigpending+0x7b/0xa0
[   25.862948]  ? __pfx_kthread+0x10/0x10
[   25.862969]  ret_from_fork+0x116/0x1d0
[   25.862989]  ? __pfx_kthread+0x10/0x10
[   25.863010]  ret_from_fork_asm+0x1a/0x30
[   25.863041]  </TASK>
[   25.863052] 
[   25.870000] Allocated by task 314:
[   25.870279]  kasan_save_stack+0x45/0x70
[   25.870538]  kasan_save_track+0x18/0x40
[   25.870675]  kasan_save_alloc_info+0x3b/0x50
[   25.870834]  __kasan_kmalloc+0xb7/0xc0
[   25.871016]  __kmalloc_noprof+0x1c9/0x500
[   25.871332]  kunit_kmalloc_array+0x25/0x60
[   25.871499]  copy_user_test_oob+0xab/0x10f0
[   25.871635]  kunit_try_run_case+0x1a5/0x480
[   25.871776]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.872029]  kthread+0x337/0x6f0
[   25.872360]  ret_from_fork+0x116/0x1d0
[   25.872525]  ret_from_fork_asm+0x1a/0x30
[   25.872723] 
[   25.872799] The buggy address belongs to the object at ffff888102597c00
[   25.872799]  which belongs to the cache kmalloc-128 of size 128
[   25.873473] The buggy address is located 0 bytes inside of
[   25.873473]  allocated 120-byte region [ffff888102597c00, ffff888102597c78)
[   25.873992] 
[   25.874108] The buggy address belongs to the physical page:
[   25.874346] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102597
[   25.874718] flags: 0x200000000000000(node=0|zone=2)
[   25.874962] page_type: f5(slab)
[   25.875113] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   25.875445] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   25.875787] page dumped because: kasan: bad access detected
[   25.876041] 
[   25.876133] Memory state around the buggy address:
[   25.876364]  ffff888102597b00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   25.876649]  ffff888102597b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.876856] >ffff888102597c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   25.877134]                                                                 ^
[   25.877432]  ffff888102597c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.877911]  ffff888102597d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.878242] ==================================================================