Hay
Date
June 2, 2025, 2:13 p.m.

Environment
qemu-x86_64

[   16.729518] ==================================================================
[   16.730192] BUG: KASAN: slab-out-of-bounds in _copy_from_user+0x32/0x90
[   16.730487] Write of size 121 at addr ffff888102a2cf00 by task kunit_try_catch/293
[   16.730847] 
[   16.731067] CPU: 0 UID: 0 PID: 293 Comm: kunit_try_catch Tainted: G    B            N 6.14.10-rc1 #1
[   16.731117] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.731129] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   16.731153] Call Trace:
[   16.731166]  <TASK>
[   16.731185]  dump_stack_lvl+0x73/0xb0
[   16.731219]  print_report+0xd1/0x650
[   16.731262]  ? __virt_addr_valid+0x1db/0x2d0
[   16.731294]  ? _copy_from_user+0x32/0x90
[   16.731331]  ? kasan_complete_mode_report_info+0x2a/0x200
[   16.731364]  ? _copy_from_user+0x32/0x90
[   16.731390]  kasan_report+0x140/0x180
[   16.731416]  ? _copy_from_user+0x32/0x90
[   16.731445]  kasan_check_range+0x10c/0x1c0
[   16.731473]  __kasan_check_write+0x18/0x20
[   16.731501]  _copy_from_user+0x32/0x90
[   16.731536]  copy_user_test_oob+0x2bf/0x10f0
[   16.731566]  ? __pfx_copy_user_test_oob+0x10/0x10
[   16.731603]  ? finish_task_switch.isra.0+0x153/0x700
[   16.731632]  ? __switch_to+0x5d9/0xf60
[   16.731664]  ? __schedule+0xce8/0x2840
[   16.731693]  ? __pfx_read_tsc+0x10/0x10
[   16.731814]  ? ktime_get_ts64+0x86/0x230
[   16.731850]  kunit_try_run_case+0x1a6/0x480
[   16.731878]  ? __pfx_kunit_try_run_case+0x10/0x10
[   16.731904]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   16.731934]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   16.731962]  ? __kthread_parkme+0x82/0x160
[   16.731989]  ? preempt_count_sub+0x50/0x80
[   16.732028]  ? __pfx_kunit_try_run_case+0x10/0x10
[   16.732056]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   16.732088]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   16.732118]  kthread+0x324/0x6e0
[   16.732144]  ? trace_preempt_on+0x20/0xc0
[   16.732174]  ? __pfx_kthread+0x10/0x10
[   16.732201]  ? _raw_spin_unlock_irq+0x47/0x80
[   16.732229]  ? calculate_sigpending+0x7b/0xa0
[   16.732256]  ? __pfx_kthread+0x10/0x10
[   16.732283]  ret_from_fork+0x41/0x80
[   16.732307]  ? __pfx_kthread+0x10/0x10
[   16.732334]  ret_from_fork_asm+0x1a/0x30
[   16.732369]  </TASK>
[   16.732382] 
[   16.743749] Allocated by task 293:
[   16.743943]  kasan_save_stack+0x45/0x70
[   16.744385]  kasan_save_track+0x18/0x40
[   16.744749]  kasan_save_alloc_info+0x3b/0x50
[   16.744989]  __kasan_kmalloc+0xb7/0xc0
[   16.745269]  __kmalloc_noprof+0x1ca/0x500
[   16.745637]  kunit_kmalloc_array+0x25/0x60
[   16.745921]  copy_user_test_oob+0xac/0x10f0
[   16.746371]  kunit_try_run_case+0x1a6/0x480
[   16.746574]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   16.747031]  kthread+0x324/0x6e0
[   16.747256]  ret_from_fork+0x41/0x80
[   16.747591]  ret_from_fork_asm+0x1a/0x30
[   16.747811] 
[   16.747888] The buggy address belongs to the object at ffff888102a2cf00
[   16.747888]  which belongs to the cache kmalloc-128 of size 128
[   16.748884] The buggy address is located 0 bytes inside of
[   16.748884]  allocated 120-byte region [ffff888102a2cf00, ffff888102a2cf78)
[   16.749598] 
[   16.749705] The buggy address belongs to the physical page:
[   16.750133] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a2c
[   16.750680] flags: 0x200000000000000(node=0|zone=2)
[   16.750992] page_type: f5(slab)
[   16.751168] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   16.751457] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   16.751989] page dumped because: kasan: bad access detected
[   16.752226] 
[   16.752328] Memory state around the buggy address:
[   16.752778]  ffff888102a2ce00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   16.753162]  ffff888102a2ce80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.753575] >ffff888102a2cf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   16.754102]                                                                 ^
[   16.754532]  ffff888102a2cf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.754983]  ffff888102a2d000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   16.755413] ==================================================================