Hay
Date
June 17, 2025, 3:40 p.m.

Environment
qemu-x86_64

[   26.737897] ==================================================================
[   26.738697] BUG: KASAN: slab-out-of-bounds in _copy_to_user+0x4a/0x70
[   26.739363] Read of size 121 at addr ffff888102ed7700 by task kunit_try_catch/305
[   26.739969] 
[   26.740224] CPU: 1 UID: 0 PID: 305 Comm: kunit_try_catch Tainted: G    B            N  6.15.3-rc1 #1 PREEMPT(voluntary) 
[   26.740323] Tainted: [B]=BAD_PAGE, [N]=TEST
[   26.740348] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   26.740382] Call Trace:
[   26.740409]  <TASK>
[   26.740436]  dump_stack_lvl+0x73/0xb0
[   26.740483]  print_report+0xd1/0x650
[   26.740526]  ? __virt_addr_valid+0x1db/0x2d0
[   26.740562]  ? _copy_to_user+0x4a/0x70
[   26.740594]  ? kasan_complete_mode_report_info+0x2a/0x200
[   26.740633]  ? _copy_to_user+0x4a/0x70
[   26.740663]  kasan_report+0x141/0x180
[   26.740701]  ? _copy_to_user+0x4a/0x70
[   26.740738]  kasan_check_range+0x10c/0x1c0
[   26.740772]  __kasan_check_read+0x15/0x20
[   26.740809]  _copy_to_user+0x4a/0x70
[   26.740841]  copy_user_test_oob+0x364/0x10f0
[   26.740877]  ? __pfx_copy_user_test_oob+0x10/0x10
[   26.740909]  ? finish_task_switch.isra.0+0x153/0x700
[   26.740948]  ? __switch_to+0x5d9/0xf60
[   26.740981]  ? dequeue_task_fair+0x166/0x4e0
[   26.741019]  ? __schedule+0x10cc/0x2b60
[   26.741083]  ? __pfx_read_tsc+0x10/0x10
[   26.741124]  ? ktime_get_ts64+0x86/0x230
[   26.741165]  kunit_try_run_case+0x1a5/0x480
[   26.741207]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.741245]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   26.741283]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   26.741454]  ? __kthread_parkme+0x82/0x180
[   26.741531]  ? preempt_count_sub+0x50/0x80
[   26.741616]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.741698]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.741781]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   26.741864]  kthread+0x337/0x6f0
[   26.741936]  ? trace_preempt_on+0x20/0xc0
[   26.742021]  ? __pfx_kthread+0x10/0x10
[   26.742180]  ? _raw_spin_unlock_irq+0x47/0x80
[   26.742257]  ? calculate_sigpending+0x7b/0xa0
[   26.742359]  ? __pfx_kthread+0x10/0x10
[   26.742431]  ret_from_fork+0x41/0x80
[   26.742504]  ? __pfx_kthread+0x10/0x10
[   26.742572]  ret_from_fork_asm+0x1a/0x30
[   26.742670]  </TASK>
[   26.742710] 
[   26.758449] Allocated by task 305:
[   26.758876]  kasan_save_stack+0x45/0x70
[   26.759445]  kasan_save_track+0x18/0x40
[   26.759886]  kasan_save_alloc_info+0x3b/0x50
[   26.760363]  __kasan_kmalloc+0xb7/0xc0
[   26.760681]  __kmalloc_noprof+0x1c9/0x500
[   26.761098]  kunit_kmalloc_array+0x25/0x60
[   26.761584]  copy_user_test_oob+0xab/0x10f0
[   26.762082]  kunit_try_run_case+0x1a5/0x480
[   26.762560]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.763089]  kthread+0x337/0x6f0
[   26.763544]  ret_from_fork+0x41/0x80
[   26.763926]  ret_from_fork_asm+0x1a/0x30
[   26.764413] 
[   26.764665] The buggy address belongs to the object at ffff888102ed7700
[   26.764665]  which belongs to the cache kmalloc-128 of size 128
[   26.765555] The buggy address is located 0 bytes inside of
[   26.765555]  allocated 120-byte region [ffff888102ed7700, ffff888102ed7778)
[   26.766495] 
[   26.766701] The buggy address belongs to the physical page:
[   26.767345] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102ed7
[   26.768187] flags: 0x200000000000000(node=0|zone=2)
[   26.768625] page_type: f5(slab)
[   26.768935] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   26.769579] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   26.770382] page dumped because: kasan: bad access detected
[   26.770913] 
[   26.771199] Memory state around the buggy address:
[   26.771730]  ffff888102ed7600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   26.773325]  ffff888102ed7680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.773877] >ffff888102ed7700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   26.775502]                                                                 ^
[   26.776604]  ffff888102ed7780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.777363]  ffff888102ed7800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.778089] ==================================================================