Hay
Date
June 7, 2025, 10:40 a.m.

Environment
qemu-x86_64

[   23.729072] ==================================================================
[   23.729642] BUG: KASAN: slab-out-of-bounds in _copy_to_user+0x4a/0x70
[   23.730224] Read of size 121 at addr ffff888102c74500 by task kunit_try_catch/293
[   23.730959] 
[   23.731275] CPU: 0 UID: 0 PID: 293 Comm: kunit_try_catch Tainted: G    B            N 6.14.11-rc1 #1
[   23.731427] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.731462] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   23.731519] Call Trace:
[   23.731572]  <TASK>
[   23.731617]  dump_stack_lvl+0x73/0xb0
[   23.731727]  print_report+0xd1/0x650
[   23.731825]  ? __virt_addr_valid+0x1db/0x2d0
[   23.731905]  ? _copy_to_user+0x4a/0x70
[   23.731963]  ? kasan_complete_mode_report_info+0x2a/0x200
[   23.732035]  ? _copy_to_user+0x4a/0x70
[   23.732090]  kasan_report+0x140/0x180
[   23.732150]  ? _copy_to_user+0x4a/0x70
[   23.732208]  kasan_check_range+0x10c/0x1c0
[   23.732247]  __kasan_check_read+0x15/0x20
[   23.732279]  _copy_to_user+0x4a/0x70
[   23.732336]  copy_user_test_oob+0x365/0x10f0
[   23.732372]  ? __pfx_copy_user_test_oob+0x10/0x10
[   23.732402]  ? finish_task_switch.isra.0+0x153/0x700
[   23.732436]  ? __switch_to+0x5d9/0xf60
[   23.732472]  ? __schedule+0xce8/0x2840
[   23.732505]  ? __pfx_read_tsc+0x10/0x10
[   23.732534]  ? ktime_get_ts64+0x86/0x230
[   23.732568]  kunit_try_run_case+0x1a6/0x480
[   23.732599]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.732627]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   23.732657]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   23.732689]  ? __kthread_parkme+0x82/0x160
[   23.732720]  ? preempt_count_sub+0x50/0x80
[   23.732752]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.732783]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.732816]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   23.732872]  kthread+0x324/0x6e0
[   23.732901]  ? trace_preempt_on+0x20/0xc0
[   23.732934]  ? __pfx_kthread+0x10/0x10
[   23.732965]  ? _raw_spin_unlock_irq+0x47/0x80
[   23.732995]  ? calculate_sigpending+0x7b/0xa0
[   23.733025]  ? __pfx_kthread+0x10/0x10
[   23.733055]  ret_from_fork+0x41/0x80
[   23.733080]  ? __pfx_kthread+0x10/0x10
[   23.733110]  ret_from_fork_asm+0x1a/0x30
[   23.733150]  </TASK>
[   23.733167] 
[   23.747928] Allocated by task 293:
[   23.748331]  kasan_save_stack+0x45/0x70
[   23.748922]  kasan_save_track+0x18/0x40
[   23.749431]  kasan_save_alloc_info+0x3b/0x50
[   23.749913]  __kasan_kmalloc+0xb7/0xc0
[   23.750446]  __kmalloc_noprof+0x1ca/0x500
[   23.750929]  kunit_kmalloc_array+0x25/0x60
[   23.751472]  copy_user_test_oob+0xac/0x10f0
[   23.751957]  kunit_try_run_case+0x1a6/0x480
[   23.752256]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.752832]  kthread+0x324/0x6e0
[   23.753126]  ret_from_fork+0x41/0x80
[   23.753578]  ret_from_fork_asm+0x1a/0x30
[   23.753935] 
[   23.754181] The buggy address belongs to the object at ffff888102c74500
[   23.754181]  which belongs to the cache kmalloc-128 of size 128
[   23.754873] The buggy address is located 0 bytes inside of
[   23.754873]  allocated 120-byte region [ffff888102c74500, ffff888102c74578)
[   23.755817] 
[   23.756065] The buggy address belongs to the physical page:
[   23.756519] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102c74
[   23.757218] flags: 0x200000000000000(node=0|zone=2)
[   23.757609] page_type: f5(slab)
[   23.757999] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   23.758584] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   23.759136] page dumped because: kasan: bad access detected
[   23.759635] 
[   23.759902] Memory state around the buggy address:
[   23.760252]  ffff888102c74400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   23.760787]  ffff888102c74480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.761425] >ffff888102c74500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   23.761948]                                                                 ^
[   23.762488]  ffff888102c74580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.763026]  ffff888102c74600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.763589] ==================================================================