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

Environment
qemu-x86_64

[   25.745908] ==================================================================
[   25.746326] BUG: KASAN: slab-out-of-bounds in _copy_to_user+0x3c/0x70
[   25.746620] Read of size 121 at addr ffff888102597c00 by task kunit_try_catch/314
[   25.747064] 
[   25.747196] CPU: 0 UID: 0 PID: 314 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250625 #1 PREEMPT(voluntary) 
[   25.747284] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.747299] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.747322] Call Trace:
[   25.747344]  <TASK>
[   25.747367]  dump_stack_lvl+0x73/0xb0
[   25.747397]  print_report+0xd1/0x650
[   25.747421]  ? __virt_addr_valid+0x1db/0x2d0
[   25.747445]  ? _copy_to_user+0x3c/0x70
[   25.747469]  ? kasan_complete_mode_report_info+0x2a/0x200
[   25.747496]  ? _copy_to_user+0x3c/0x70
[   25.747516]  kasan_report+0x141/0x180
[   25.747538]  ? _copy_to_user+0x3c/0x70
[   25.747562]  kasan_check_range+0x10c/0x1c0
[   25.747586]  __kasan_check_read+0x15/0x20
[   25.747608]  _copy_to_user+0x3c/0x70
[   25.747629]  copy_user_test_oob+0x364/0x10f0
[   25.747654]  ? __pfx_copy_user_test_oob+0x10/0x10
[   25.747676]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   25.747704]  ? __pfx_copy_user_test_oob+0x10/0x10
[   25.747730]  kunit_try_run_case+0x1a5/0x480
[   25.747755]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.747778]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.747798]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.747824]  ? __kthread_parkme+0x82/0x180
[   25.747845]  ? preempt_count_sub+0x50/0x80
[   25.747869]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.747893]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.747917]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.747955]  kthread+0x337/0x6f0
[   25.747997]  ? trace_preempt_on+0x20/0xc0
[   25.748023]  ? __pfx_kthread+0x10/0x10
[   25.748044]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.748067]  ? calculate_sigpending+0x7b/0xa0
[   25.748091]  ? __pfx_kthread+0x10/0x10
[   25.748113]  ret_from_fork+0x116/0x1d0
[   25.748145]  ? __pfx_kthread+0x10/0x10
[   25.748166]  ret_from_fork_asm+0x1a/0x30
[   25.748197]  </TASK>
[   25.748208] 
[   25.756885] Allocated by task 314:
[   25.757050]  kasan_save_stack+0x45/0x70
[   25.757393]  kasan_save_track+0x18/0x40
[   25.757659]  kasan_save_alloc_info+0x3b/0x50
[   25.757814]  __kasan_kmalloc+0xb7/0xc0
[   25.758160]  __kmalloc_noprof+0x1c9/0x500
[   25.758445]  kunit_kmalloc_array+0x25/0x60
[   25.758594]  copy_user_test_oob+0xab/0x10f0
[   25.758927]  kunit_try_run_case+0x1a5/0x480
[   25.759235]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.759427]  kthread+0x337/0x6f0
[   25.759676]  ret_from_fork+0x116/0x1d0
[   25.759842]  ret_from_fork_asm+0x1a/0x30
[   25.760028] 
[   25.760111] The buggy address belongs to the object at ffff888102597c00
[   25.760111]  which belongs to the cache kmalloc-128 of size 128
[   25.760601] The buggy address is located 0 bytes inside of
[   25.760601]  allocated 120-byte region [ffff888102597c00, ffff888102597c78)
[   25.761472] 
[   25.761568] The buggy address belongs to the physical page:
[   25.761879] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102597
[   25.762379] flags: 0x200000000000000(node=0|zone=2)
[   25.762687] page_type: f5(slab)
[   25.762815] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   25.763310] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   25.763679] page dumped because: kasan: bad access detected
[   25.764019] 
[   25.764096] Memory state around the buggy address:
[   25.764525]  ffff888102597b00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   25.764897]  ffff888102597b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.765339] >ffff888102597c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   25.765672]                                                                 ^
[   25.765962]  ffff888102597c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.766349]  ffff888102597d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.766766] ==================================================================