Hay
Date
Dec. 6, 2024, 3:11 p.m.

Environment
qemu-x86_64

[   31.728883] ==================================================================
[   31.730487] BUG: KASAN: slab-out-of-bounds in _copy_from_user+0x33/0xa0
[   31.730848] Write of size 121 at addr ffff888102933c00 by task kunit_try_catch/293
[   31.731708] 
[   31.731965] CPU: 0 UID: 0 PID: 293 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241206 #1
[   31.733657] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.734397] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   31.735256] Call Trace:
[   31.735406]  <TASK>
[   31.735542]  dump_stack_lvl+0x73/0xb0
[   31.735750]  print_report+0xd1/0x640
[   31.736008]  ? __virt_addr_valid+0x1db/0x2d0
[   31.736448]  ? kasan_complete_mode_report_info+0x2a/0x200
[   31.737873]  kasan_report+0x102/0x140
[   31.738401]  ? _copy_from_user+0x33/0xa0
[   31.738977]  ? _copy_from_user+0x33/0xa0
[   31.739444]  kasan_check_range+0x10c/0x1c0
[   31.740530]  __kasan_check_write+0x18/0x20
[   31.740998]  _copy_from_user+0x33/0xa0
[   31.741534]  copy_user_test_oob+0x2bf/0x10f0
[   31.742025]  ? __pfx_copy_user_test_oob+0x10/0x10
[   31.743031]  ? finish_task_switch.isra.0+0x153/0x700
[   31.743659]  ? __switch_to+0x5d9/0xf60
[   31.744150]  ? __schedule+0xc70/0x27e0
[   31.744602]  ? __pfx_read_tsc+0x10/0x10
[   31.745104]  ? ktime_get_ts64+0x86/0x230
[   31.745683]  kunit_try_run_case+0x1b3/0x490
[   31.746183]  ? __pfx_kunit_try_run_case+0x10/0x10
[   31.746754]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   31.747402]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   31.747972]  ? __kthread_parkme+0x82/0x160
[   31.748618]  ? preempt_count_sub+0x50/0x80
[   31.749051]  ? __pfx_kunit_try_run_case+0x10/0x10
[   31.749689]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   31.750498]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   31.751126]  kthread+0x257/0x310
[   31.751482]  ? __pfx_kthread+0x10/0x10
[   31.751912]  ret_from_fork+0x41/0x80
[   31.752429]  ? __pfx_kthread+0x10/0x10
[   31.752824]  ret_from_fork_asm+0x1a/0x30
[   31.753596]  </TASK>
[   31.753831] 
[   31.754197] Allocated by task 293:
[   31.754551]  kasan_save_stack+0x3d/0x60
[   31.755123]  kasan_save_track+0x18/0x40
[   31.755670]  kasan_save_alloc_info+0x3b/0x50
[   31.756255]  __kasan_kmalloc+0xb7/0xc0
[   31.756811]  __kmalloc_noprof+0x1c4/0x500
[   31.757391]  kunit_kmalloc_array+0x25/0x60
[   31.757903]  copy_user_test_oob+0xac/0x10f0
[   31.758455]  kunit_try_run_case+0x1b3/0x490
[   31.759038]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   31.759755]  kthread+0x257/0x310
[   31.760690]  ret_from_fork+0x41/0x80
[   31.761400]  ret_from_fork_asm+0x1a/0x30
[   31.761892] 
[   31.762084] The buggy address belongs to the object at ffff888102933c00
[   31.762084]  which belongs to the cache kmalloc-128 of size 128
[   31.763654] The buggy address is located 0 bytes inside of
[   31.763654]  allocated 120-byte region [ffff888102933c00, ffff888102933c78)
[   31.765186] 
[   31.765680] The buggy address belongs to the physical page:
[   31.766443] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102933
[   31.767622] flags: 0x200000000000000(node=0|zone=2)
[   31.768488] page_type: f5(slab)
[   31.769073] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   31.770048] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   31.770816] page dumped because: kasan: bad access detected
[   31.771736] 
[   31.772135] Memory state around the buggy address:
[   31.773312]  ffff888102933b00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   31.774235]  ffff888102933b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.774714] >ffff888102933c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   31.775768]                                                                 ^
[   31.776498]  ffff888102933c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.777284]  ffff888102933d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.778017] ==================================================================