Hay
Date
June 26, 2025, 9:10 a.m.

Environment
qemu-x86_64

[   26.045334] ==================================================================
[   26.045902] BUG: KASAN: slab-out-of-bounds in _copy_from_user+0x32/0x90
[   26.046487] Write of size 121 at addr ffff8881024e1b00 by task kunit_try_catch/314
[   26.046801] 
[   26.046907] CPU: 0 UID: 0 PID: 314 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250626 #1 PREEMPT(voluntary) 
[   26.046965] Tainted: [B]=BAD_PAGE, [N]=TEST
[   26.046980] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   26.047008] Call Trace:
[   26.047054]  <TASK>
[   26.047080]  dump_stack_lvl+0x73/0xb0
[   26.047114]  print_report+0xd1/0x650
[   26.047141]  ? __virt_addr_valid+0x1db/0x2d0
[   26.047169]  ? _copy_from_user+0x32/0x90
[   26.047190]  ? kasan_complete_mode_report_info+0x2a/0x200
[   26.047228]  ? _copy_from_user+0x32/0x90
[   26.047249]  kasan_report+0x141/0x180
[   26.047272]  ? _copy_from_user+0x32/0x90
[   26.047297]  kasan_check_range+0x10c/0x1c0
[   26.047321]  __kasan_check_write+0x18/0x20
[   26.047345]  _copy_from_user+0x32/0x90
[   26.047367]  copy_user_test_oob+0x2be/0x10f0
[   26.047394]  ? __pfx_copy_user_test_oob+0x10/0x10
[   26.047418]  ? finish_task_switch.isra.0+0x153/0x700
[   26.047443]  ? __switch_to+0x47/0xf50
[   26.047619]  ? __schedule+0x10cc/0x2b60
[   26.047655]  ? __pfx_read_tsc+0x10/0x10
[   26.047681]  ? ktime_get_ts64+0x86/0x230
[   26.047708]  kunit_try_run_case+0x1a5/0x480
[   26.047734]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.047759]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   26.047785]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   26.047810]  ? __kthread_parkme+0x82/0x180
[   26.047833]  ? preempt_count_sub+0x50/0x80
[   26.047857]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.047883]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.047907]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   26.047932]  kthread+0x337/0x6f0
[   26.047952]  ? trace_preempt_on+0x20/0xc0
[   26.047979]  ? __pfx_kthread+0x10/0x10
[   26.048000]  ? _raw_spin_unlock_irq+0x47/0x80
[   26.048036]  ? calculate_sigpending+0x7b/0xa0
[   26.048063]  ? __pfx_kthread+0x10/0x10
[   26.048085]  ret_from_fork+0x116/0x1d0
[   26.048105]  ? __pfx_kthread+0x10/0x10
[   26.048126]  ret_from_fork_asm+0x1a/0x30
[   26.048160]  </TASK>
[   26.048174] 
[   26.057822] Allocated by task 314:
[   26.058021]  kasan_save_stack+0x45/0x70
[   26.058212]  kasan_save_track+0x18/0x40
[   26.058396]  kasan_save_alloc_info+0x3b/0x50
[   26.058580]  __kasan_kmalloc+0xb7/0xc0
[   26.058741]  __kmalloc_noprof+0x1c9/0x500
[   26.058922]  kunit_kmalloc_array+0x25/0x60
[   26.059700]  copy_user_test_oob+0xab/0x10f0
[   26.059890]  kunit_try_run_case+0x1a5/0x480
[   26.060296]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.060646]  kthread+0x337/0x6f0
[   26.060792]  ret_from_fork+0x116/0x1d0
[   26.061123]  ret_from_fork_asm+0x1a/0x30
[   26.061431] 
[   26.061521] The buggy address belongs to the object at ffff8881024e1b00
[   26.061521]  which belongs to the cache kmalloc-128 of size 128
[   26.062292] The buggy address is located 0 bytes inside of
[   26.062292]  allocated 120-byte region [ffff8881024e1b00, ffff8881024e1b78)
[   26.062967] 
[   26.063064] The buggy address belongs to the physical page:
[   26.063557] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1024e1
[   26.063981] flags: 0x200000000000000(node=0|zone=2)
[   26.064378] page_type: f5(slab)
[   26.064523] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   26.064931] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   26.065373] page dumped because: kasan: bad access detected
[   26.065714] 
[   26.065811] Memory state around the buggy address:
[   26.066203]  ffff8881024e1a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   26.066615]  ffff8881024e1a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.067023] >ffff8881024e1b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   26.067411]                                                                 ^
[   26.067799]  ffff8881024e1b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.068234]  ffff8881024e1c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.068609] ==================================================================