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

Environment
qemu-x86_64

[   17.156999] ==================================================================
[   17.157663] BUG: KASAN: slab-out-of-bounds in _copy_from_user+0x32/0x90
[   17.157950] Write of size 121 at addr ffff8881025ccc00 by task kunit_try_catch/302
[   17.158247] 
[   17.158371] CPU: 1 UID: 0 PID: 302 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   17.158435] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.158449] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   17.158474] Call Trace:
[   17.158489]  <TASK>
[   17.158531]  dump_stack_lvl+0x73/0xb0
[   17.158577]  print_report+0xd1/0x610
[   17.158622]  ? __virt_addr_valid+0x1db/0x2d0
[   17.158647]  ? _copy_from_user+0x32/0x90
[   17.158668]  ? kasan_complete_mode_report_info+0x2a/0x200
[   17.158694]  ? _copy_from_user+0x32/0x90
[   17.158715]  kasan_report+0x141/0x180
[   17.158739]  ? _copy_from_user+0x32/0x90
[   17.158764]  kasan_check_range+0x10c/0x1c0
[   17.158790]  __kasan_check_write+0x18/0x20
[   17.158812]  _copy_from_user+0x32/0x90
[   17.158833]  copy_user_test_oob+0x2be/0x10f0
[   17.158862]  ? __pfx_copy_user_test_oob+0x10/0x10
[   17.158889]  ? __kasan_check_write+0x18/0x20
[   17.158911]  ? queued_spin_lock_slowpath+0x116/0xb40
[   17.158938]  ? irqentry_exit+0x2a/0x60
[   17.158980]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   17.159010]  ? trace_hardirqs_on+0x37/0xe0
[   17.159036]  ? __pfx_read_tsc+0x10/0x10
[   17.159059]  ? ktime_get_ts64+0x86/0x230
[   17.159088]  kunit_try_run_case+0x1a5/0x480
[   17.159114]  ? __pfx_kunit_try_run_case+0x10/0x10
[   17.159141]  ? queued_spin_lock_slowpath+0x116/0xb40
[   17.159168]  ? __kthread_parkme+0x82/0x180
[   17.159191]  ? preempt_count_sub+0x50/0x80
[   17.159217]  ? __pfx_kunit_try_run_case+0x10/0x10
[   17.159243]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   17.159271]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   17.159298]  kthread+0x337/0x6f0
[   17.159319]  ? trace_preempt_on+0x20/0xc0
[   17.159342]  ? __pfx_kthread+0x10/0x10
[   17.159365]  ? _raw_spin_unlock_irq+0x47/0x80
[   17.159389]  ? calculate_sigpending+0x7b/0xa0
[   17.159425]  ? __pfx_kthread+0x10/0x10
[   17.159448]  ret_from_fork+0x116/0x1d0
[   17.159468]  ? __pfx_kthread+0x10/0x10
[   17.159490]  ret_from_fork_asm+0x1a/0x30
[   17.159523]  </TASK>
[   17.159536] 
[   17.167100] Allocated by task 302:
[   17.167230]  kasan_save_stack+0x45/0x70
[   17.167422]  kasan_save_track+0x18/0x40
[   17.167626]  kasan_save_alloc_info+0x3b/0x50
[   17.167863]  __kasan_kmalloc+0xb7/0xc0
[   17.168028]  __kmalloc_noprof+0x1c9/0x500
[   17.168174]  kunit_kmalloc_array+0x25/0x60
[   17.168320]  copy_user_test_oob+0xab/0x10f0
[   17.168502]  kunit_try_run_case+0x1a5/0x480
[   17.168724]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   17.168989]  kthread+0x337/0x6f0
[   17.169298]  ret_from_fork+0x116/0x1d0
[   17.169438]  ret_from_fork_asm+0x1a/0x30
[   17.169593] 
[   17.169728] The buggy address belongs to the object at ffff8881025ccc00
[   17.169728]  which belongs to the cache kmalloc-128 of size 128
[   17.170244] The buggy address is located 0 bytes inside of
[   17.170244]  allocated 120-byte region [ffff8881025ccc00, ffff8881025ccc78)
[   17.170876] 
[   17.170952] The buggy address belongs to the physical page:
[   17.171190] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1025cc
[   17.171588] flags: 0x200000000000000(node=0|zone=2)
[   17.171757] page_type: f5(slab)
[   17.171881] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   17.172133] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   17.172542] page dumped because: kasan: bad access detected
[   17.172833] 
[   17.172930] Memory state around the buggy address:
[   17.173161]  ffff8881025ccb00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   17.173396]  ffff8881025ccb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.173723] >ffff8881025ccc00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   17.174104]                                                                 ^
[   17.174355]  ffff8881025ccc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.174847]  ffff8881025ccd00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.175206] ==================================================================