Hay
Date
Dec. 4, 2024, 3:07 p.m.

Environment
qemu-x86_64

[   30.560433] ==================================================================
[   30.562451] BUG: KASAN: slab-out-of-bounds in _copy_from_user+0x33/0xa0
[   30.563165] Write of size 121 at addr ffff8881029a4b00 by task kunit_try_catch/293
[   30.563937] 
[   30.564381] CPU: 1 UID: 0 PID: 293 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241204 #1
[   30.565672] Tainted: [B]=BAD_PAGE, [N]=TEST
[   30.566673] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   30.567440] Call Trace:
[   30.567731]  <TASK>
[   30.568031]  dump_stack_lvl+0x73/0xb0
[   30.568452]  print_report+0xd1/0x640
[   30.568971]  ? __virt_addr_valid+0x1db/0x2d0
[   30.569350]  ? kasan_complete_mode_report_info+0x2a/0x200
[   30.570218]  kasan_report+0x102/0x140
[   30.570783]  ? _copy_from_user+0x33/0xa0
[   30.571341]  ? _copy_from_user+0x33/0xa0
[   30.571810]  kasan_check_range+0x10c/0x1c0
[   30.572540]  __kasan_check_write+0x18/0x20
[   30.573186]  _copy_from_user+0x33/0xa0
[   30.573792]  copy_user_test_oob+0x2bf/0x10f0
[   30.574457]  ? __pfx_copy_user_test_oob+0x10/0x10
[   30.574862]  ? finish_task_switch.isra.0+0x153/0x700
[   30.575671]  ? __switch_to+0x5d9/0xf60
[   30.576275]  ? __schedule+0xc3e/0x2790
[   30.576927]  ? __pfx_read_tsc+0x10/0x10
[   30.577594]  ? ktime_get_ts64+0x86/0x230
[   30.577990]  kunit_try_run_case+0x1b3/0x490
[   30.578533]  ? __pfx_kunit_try_run_case+0x10/0x10
[   30.578906]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   30.579824]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   30.580577]  ? __kthread_parkme+0x82/0x160
[   30.580998]  ? preempt_count_sub+0x50/0x80
[   30.581423]  ? __pfx_kunit_try_run_case+0x10/0x10
[   30.581876]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   30.582685]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   30.583243]  kthread+0x257/0x310
[   30.583741]  ? __pfx_kthread+0x10/0x10
[   30.584327]  ret_from_fork+0x41/0x80
[   30.584778]  ? __pfx_kthread+0x10/0x10
[   30.585080]  ret_from_fork_asm+0x1a/0x30
[   30.585700]  </TASK>
[   30.586372] 
[   30.586556] Allocated by task 293:
[   30.586837]  kasan_save_stack+0x3d/0x60
[   30.587384]  kasan_save_track+0x18/0x40
[   30.588275]  kasan_save_alloc_info+0x3b/0x50
[   30.588656]  __kasan_kmalloc+0xb7/0xc0
[   30.589355]  __kmalloc_noprof+0x1c4/0x500
[   30.589764]  kunit_kmalloc_array+0x25/0x60
[   30.590638]  copy_user_test_oob+0xac/0x10f0
[   30.591144]  kunit_try_run_case+0x1b3/0x490
[   30.591714]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   30.593059]  kthread+0x257/0x310
[   30.593411]  ret_from_fork+0x41/0x80
[   30.593883]  ret_from_fork_asm+0x1a/0x30
[   30.594738] 
[   30.595035] The buggy address belongs to the object at ffff8881029a4b00
[   30.595035]  which belongs to the cache kmalloc-128 of size 128
[   30.596272] The buggy address is located 0 bytes inside of
[   30.596272]  allocated 120-byte region [ffff8881029a4b00, ffff8881029a4b78)
[   30.597785] 
[   30.598245] The buggy address belongs to the physical page:
[   30.598943] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1029a4
[   30.600158] flags: 0x200000000000000(node=0|zone=2)
[   30.600715] page_type: f5(slab)
[   30.601102] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   30.601953] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   30.602936] page dumped because: kasan: bad access detected
[   30.603494] 
[   30.603739] Memory state around the buggy address:
[   30.604204]  ffff8881029a4a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   30.605198]  ffff8881029a4a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.606031] >ffff8881029a4b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   30.606766]                                                                 ^
[   30.607539]  ffff8881029a4b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.608413]  ffff8881029a4c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.609031] ==================================================================