Hay
Date
Nov. 28, 2024, 2:36 a.m.

Environment
qemu-x86_64

[   28.578119] ==================================================================
[   28.579283] BUG: KASAN: slab-out-of-bounds in _copy_from_user+0x33/0xa0
[   28.580032] Write of size 121 at addr ffff888101b6b500 by task kunit_try_catch/293
[   28.581110] 
[   28.581347] CPU: 1 UID: 0 PID: 293 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241128 #1
[   28.582223] Tainted: [B]=BAD_PAGE, [N]=TEST
[   28.582597] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   28.583187] Call Trace:
[   28.583780]  <TASK>
[   28.584355]  dump_stack_lvl+0x73/0xb0
[   28.584747]  print_report+0xd1/0x640
[   28.585160]  ? __virt_addr_valid+0x1db/0x2d0
[   28.585527]  ? kasan_complete_mode_report_info+0x2a/0x200
[   28.586159]  kasan_report+0x102/0x140
[   28.586487]  ? _copy_from_user+0x33/0xa0
[   28.586966]  ? _copy_from_user+0x33/0xa0
[   28.587491]  kasan_check_range+0x10c/0x1c0
[   28.587904]  __kasan_check_write+0x18/0x20
[   28.588396]  _copy_from_user+0x33/0xa0
[   28.588847]  copy_user_test_oob+0x2bf/0x10f0
[   28.589454]  ? __pfx_copy_user_test_oob+0x10/0x10
[   28.589840]  ? finish_task_switch.isra.0+0x153/0x700
[   28.590406]  ? __switch_to+0x5d9/0xf60
[   28.590901]  ? __schedule+0xc3e/0x2790
[   28.591319]  ? __pfx_read_tsc+0x10/0x10
[   28.591635]  ? ktime_get_ts64+0x84/0x230
[   28.592188]  kunit_try_run_case+0x1b3/0x490
[   28.592703]  ? __pfx_kunit_try_run_case+0x10/0x10
[   28.593176]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   28.593767]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   28.594712]  ? __kthread_parkme+0x82/0x160
[   28.595188]  ? preempt_count_sub+0x50/0x80
[   28.595838]  ? __pfx_kunit_try_run_case+0x10/0x10
[   28.596484]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   28.597295]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.597937]  kthread+0x257/0x310
[   28.598830]  ? __pfx_kthread+0x10/0x10
[   28.599203]  ret_from_fork+0x41/0x80
[   28.599912]  ? __pfx_kthread+0x10/0x10
[   28.600715]  ret_from_fork_asm+0x1a/0x30
[   28.601199]  </TASK>
[   28.601472] 
[   28.601703] Allocated by task 293:
[   28.602083]  kasan_save_stack+0x3d/0x60
[   28.602499]  kasan_save_track+0x18/0x40
[   28.602783]  kasan_save_alloc_info+0x3b/0x50
[   28.603371]  __kasan_kmalloc+0xb7/0xc0
[   28.604049]  __kmalloc_noprof+0x1c4/0x500
[   28.604551]  kunit_kmalloc_array+0x25/0x60
[   28.605192]  copy_user_test_oob+0xac/0x10f0
[   28.605748]  kunit_try_run_case+0x1b3/0x490
[   28.606409]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.607189]  kthread+0x257/0x310
[   28.607654]  ret_from_fork+0x41/0x80
[   28.608225]  ret_from_fork_asm+0x1a/0x30
[   28.608904] 
[   28.609196] The buggy address belongs to the object at ffff888101b6b500
[   28.609196]  which belongs to the cache kmalloc-128 of size 128
[   28.610404] The buggy address is located 0 bytes inside of
[   28.610404]  allocated 120-byte region [ffff888101b6b500, ffff888101b6b578)
[   28.611598] 
[   28.611890] The buggy address belongs to the physical page:
[   28.612467] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101b6b
[   28.613392] flags: 0x200000000000000(node=0|zone=2)
[   28.614073] page_type: f5(slab)
[   28.614403] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   28.615388] raw: 0000000000000000 0000000080100010 00000001f5000000 0000000000000000
[   28.616179] page dumped because: kasan: bad access detected
[   28.616838] 
[   28.617041] Memory state around the buggy address:
[   28.617981]  ffff888101b6b400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   28.618736]  ffff888101b6b480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.619485] >ffff888101b6b500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   28.620076]                                                                 ^
[   28.620675]  ffff888101b6b580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.621182]  ffff888101b6b600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.622011] ==================================================================