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

Environment
qemu-x86_64

[   16.759103] ==================================================================
[   16.759423] BUG: KASAN: slab-out-of-bounds in _copy_to_user+0x4a/0x70
[   16.759902] Read of size 121 at addr ffff888102a2cf00 by task kunit_try_catch/293
[   16.760238] 
[   16.760340] CPU: 0 UID: 0 PID: 293 Comm: kunit_try_catch Tainted: G    B            N 6.14.10-rc1 #1
[   16.760381] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.760394] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   16.760416] Call Trace:
[   16.760429]  <TASK>
[   16.760446]  dump_stack_lvl+0x73/0xb0
[   16.760478]  print_report+0xd1/0x650
[   16.760508]  ? __virt_addr_valid+0x1db/0x2d0
[   16.760537]  ? _copy_to_user+0x4a/0x70
[   16.760562]  ? kasan_complete_mode_report_info+0x2a/0x200
[   16.760593]  ? _copy_to_user+0x4a/0x70
[   16.760618]  kasan_report+0x140/0x180
[   16.760646]  ? _copy_to_user+0x4a/0x70
[   16.760675]  kasan_check_range+0x10c/0x1c0
[   16.760743]  __kasan_check_read+0x15/0x20
[   16.760772]  _copy_to_user+0x4a/0x70
[   16.760809]  copy_user_test_oob+0x365/0x10f0
[   16.760840]  ? __pfx_copy_user_test_oob+0x10/0x10
[   16.760866]  ? finish_task_switch.isra.0+0x153/0x700
[   16.760895]  ? __switch_to+0x5d9/0xf60
[   16.760925]  ? __schedule+0xce8/0x2840
[   16.760954]  ? __pfx_read_tsc+0x10/0x10
[   16.760980]  ? ktime_get_ts64+0x86/0x230
[   16.761011]  kunit_try_run_case+0x1a6/0x480
[   16.761047]  ? __pfx_kunit_try_run_case+0x10/0x10
[   16.761073]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   16.761103]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   16.761131]  ? __kthread_parkme+0x82/0x160
[   16.761159]  ? preempt_count_sub+0x50/0x80
[   16.761188]  ? __pfx_kunit_try_run_case+0x10/0x10
[   16.761216]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   16.761248]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   16.761278]  kthread+0x324/0x6e0
[   16.761305]  ? trace_preempt_on+0x20/0xc0
[   16.761334]  ? __pfx_kthread+0x10/0x10
[   16.761361]  ? _raw_spin_unlock_irq+0x47/0x80
[   16.761389]  ? calculate_sigpending+0x7b/0xa0
[   16.761416]  ? __pfx_kthread+0x10/0x10
[   16.761443]  ret_from_fork+0x41/0x80
[   16.761467]  ? __pfx_kthread+0x10/0x10
[   16.761494]  ret_from_fork_asm+0x1a/0x30
[   16.761529]  </TASK>
[   16.761540] 
[   16.770100] Allocated by task 293:
[   16.770297]  kasan_save_stack+0x45/0x70
[   16.770652]  kasan_save_track+0x18/0x40
[   16.770914]  kasan_save_alloc_info+0x3b/0x50
[   16.771082]  __kasan_kmalloc+0xb7/0xc0
[   16.771269]  __kmalloc_noprof+0x1ca/0x500
[   16.771471]  kunit_kmalloc_array+0x25/0x60
[   16.771898]  copy_user_test_oob+0xac/0x10f0
[   16.772089]  kunit_try_run_case+0x1a6/0x480
[   16.772359]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   16.772638]  kthread+0x324/0x6e0
[   16.772948]  ret_from_fork+0x41/0x80
[   16.773127]  ret_from_fork_asm+0x1a/0x30
[   16.773451] 
[   16.773527] The buggy address belongs to the object at ffff888102a2cf00
[   16.773527]  which belongs to the cache kmalloc-128 of size 128
[   16.774189] The buggy address is located 0 bytes inside of
[   16.774189]  allocated 120-byte region [ffff888102a2cf00, ffff888102a2cf78)
[   16.774740] 
[   16.774918] The buggy address belongs to the physical page:
[   16.775159] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a2c
[   16.775652] flags: 0x200000000000000(node=0|zone=2)
[   16.775831] page_type: f5(slab)
[   16.776004] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   16.776452] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   16.776821] page dumped because: kasan: bad access detected
[   16.777077] 
[   16.777165] Memory state around the buggy address:
[   16.777376]  ffff888102a2ce00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   16.777645]  ffff888102a2ce80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.778027] >ffff888102a2cf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   16.778341]                                                                 ^
[   16.778616]  ffff888102a2cf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.778968]  ffff888102a2d000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   16.779266] ==================================================================