Hay
Date
May 15, 2025, 10:38 a.m.

Environment
qemu-x86_64

[   17.967315] ==================================================================
[   17.968019] BUG: KASAN: slab-out-of-bounds in _copy_from_user+0x32/0x90
[   17.968375] Write of size 121 at addr ffff888102b5b800 by task kunit_try_catch/303
[   17.968584] 
[   17.968671] CPU: 0 UID: 0 PID: 303 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT(voluntary) 
[   17.968731] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.968746] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   17.968772] Call Trace:
[   17.968789]  <TASK>
[   17.968814]  dump_stack_lvl+0x73/0xb0
[   17.968850]  print_report+0xd1/0x650
[   17.968878]  ? __virt_addr_valid+0x1db/0x2d0
[   17.968906]  ? _copy_from_user+0x32/0x90
[   17.968926]  ? kasan_complete_mode_report_info+0x2a/0x200
[   17.968951]  ? _copy_from_user+0x32/0x90
[   17.968971]  kasan_report+0x141/0x180
[   17.968994]  ? _copy_from_user+0x32/0x90
[   17.969019]  kasan_check_range+0x10c/0x1c0
[   17.969044]  __kasan_check_write+0x18/0x20
[   17.969064]  _copy_from_user+0x32/0x90
[   17.969085]  copy_user_test_oob+0x2be/0x10f0
[   17.969111]  ? __pfx_copy_user_test_oob+0x10/0x10
[   17.969136]  ? finish_task_switch.isra.0+0x153/0x700
[   17.969161]  ? __switch_to+0x47/0xf50
[   17.969191]  ? __schedule+0x10cc/0x2b60
[   17.969214]  ? __pfx_read_tsc+0x10/0x10
[   17.969250]  ? ktime_get_ts64+0x86/0x230
[   17.969277]  kunit_try_run_case+0x1a5/0x480
[   17.969303]  ? __pfx_kunit_try_run_case+0x10/0x10
[   17.969324]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   17.969349]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   17.969372]  ? __kthread_parkme+0x82/0x180
[   17.969394]  ? preempt_count_sub+0x50/0x80
[   17.969418]  ? __pfx_kunit_try_run_case+0x10/0x10
[   17.969442]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   17.969465]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   17.969489]  kthread+0x337/0x6f0
[   17.969509]  ? trace_preempt_on+0x20/0xc0
[   17.969536]  ? __pfx_kthread+0x10/0x10
[   17.969557]  ? _raw_spin_unlock_irq+0x47/0x80
[   17.969578]  ? calculate_sigpending+0x7b/0xa0
[   17.969606]  ? __pfx_kthread+0x10/0x10
[   17.969627]  ret_from_fork+0x116/0x1d0
[   17.969647]  ? __pfx_kthread+0x10/0x10
[   17.969667]  ret_from_fork_asm+0x1a/0x30
[   17.969701]  </TASK>
[   17.969715] 
[   17.975347] Allocated by task 303:
[   17.975514]  kasan_save_stack+0x45/0x70
[   17.975693]  kasan_save_track+0x18/0x40
[   17.975838]  kasan_save_alloc_info+0x3b/0x50
[   17.976001]  __kasan_kmalloc+0xb7/0xc0
[   17.976176]  __kmalloc_noprof+0x1c9/0x500
[   17.976352]  kunit_kmalloc_array+0x25/0x60
[   17.976535]  copy_user_test_oob+0xab/0x10f0
[   17.976679]  kunit_try_run_case+0x1a5/0x480
[   17.976835]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   17.977045]  kthread+0x337/0x6f0
[   17.977230]  ret_from_fork+0x116/0x1d0
[   17.977405]  ret_from_fork_asm+0x1a/0x30
[   17.977552] 
[   17.977645] The buggy address belongs to the object at ffff888102b5b800
[   17.977645]  which belongs to the cache kmalloc-128 of size 128
[   17.977973] The buggy address is located 0 bytes inside of
[   17.977973]  allocated 120-byte region [ffff888102b5b800, ffff888102b5b878)
[   17.978170] 
[   17.978235] The buggy address belongs to the physical page:
[   17.978539] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b5b
[   17.979013] flags: 0x200000000000000(node=0|zone=2)
[   17.979168] page_type: f5(slab)
[   17.979276] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   17.979421] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   17.979848] page dumped because: kasan: bad access detected
[   17.980134] 
[   17.980199] Memory state around the buggy address:
[   17.980310]  ffff888102b5b700: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   17.980439]  ffff888102b5b780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.980565] >ffff888102b5b800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   17.980686]                                                                 ^
[   17.980809]  ffff888102b5b880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.980932]  ffff888102b5b900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.981051] ==================================================================