Hay
Date
July 11, 2025, 10:11 a.m.

Environment
qemu-x86_64

[   27.971343] ==================================================================
[   27.971985] BUG: KASAN: slab-out-of-bounds in _copy_from_user+0x32/0x90
[   27.972351] Write of size 121 at addr ffff88810622c200 by task kunit_try_catch/335
[   27.973092] 
[   27.973224] CPU: 0 UID: 0 PID: 335 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250711 #1 PREEMPT(voluntary) 
[   27.973286] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.973315] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   27.973480] Call Trace:
[   27.973498]  <TASK>
[   27.973522]  dump_stack_lvl+0x73/0xb0
[   27.973559]  print_report+0xd1/0x610
[   27.973586]  ? __virt_addr_valid+0x1db/0x2d0
[   27.973614]  ? _copy_from_user+0x32/0x90
[   27.973636]  ? kasan_complete_mode_report_info+0x2a/0x200
[   27.973665]  ? _copy_from_user+0x32/0x90
[   27.973689]  kasan_report+0x141/0x180
[   27.973714]  ? _copy_from_user+0x32/0x90
[   27.973755]  kasan_check_range+0x10c/0x1c0
[   27.973780]  __kasan_check_write+0x18/0x20
[   27.973804]  _copy_from_user+0x32/0x90
[   27.973828]  copy_user_test_oob+0x2be/0x10f0
[   27.973855]  ? __pfx_copy_user_test_oob+0x10/0x10
[   27.973879]  ? finish_task_switch.isra.0+0x153/0x700
[   27.973905]  ? __switch_to+0x47/0xf80
[   27.973934]  ? __schedule+0x10cc/0x2b60
[   27.973960]  ? __pfx_read_tsc+0x10/0x10
[   27.973983]  ? ktime_get_ts64+0x86/0x230
[   27.974011]  kunit_try_run_case+0x1a5/0x480
[   27.974035]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.974056]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   27.974080]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   27.974106]  ? __kthread_parkme+0x82/0x180
[   27.974129]  ? preempt_count_sub+0x50/0x80
[   27.974152]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.974176]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.974202]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   27.974229]  kthread+0x337/0x6f0
[   27.974251]  ? trace_preempt_on+0x20/0xc0
[   27.974276]  ? __pfx_kthread+0x10/0x10
[   27.974298]  ? _raw_spin_unlock_irq+0x47/0x80
[   27.974321]  ? calculate_sigpending+0x7b/0xa0
[   27.974348]  ? __pfx_kthread+0x10/0x10
[   27.974371]  ret_from_fork+0x116/0x1d0
[   27.974392]  ? __pfx_kthread+0x10/0x10
[   27.974414]  ret_from_fork_asm+0x1a/0x30
[   27.974447]  </TASK>
[   27.974460] 
[   27.984382] Allocated by task 335:
[   27.984803]  kasan_save_stack+0x45/0x70
[   27.985008]  kasan_save_track+0x18/0x40
[   27.985297]  kasan_save_alloc_info+0x3b/0x50
[   27.985625]  __kasan_kmalloc+0xb7/0xc0
[   27.985858]  __kmalloc_noprof+0x1c9/0x500
[   27.986166]  kunit_kmalloc_array+0x25/0x60
[   27.986378]  copy_user_test_oob+0xab/0x10f0
[   27.986756]  kunit_try_run_case+0x1a5/0x480
[   27.986967]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.987195]  kthread+0x337/0x6f0
[   27.987348]  ret_from_fork+0x116/0x1d0
[   27.987769]  ret_from_fork_asm+0x1a/0x30
[   27.987931] 
[   27.988041] The buggy address belongs to the object at ffff88810622c200
[   27.988041]  which belongs to the cache kmalloc-128 of size 128
[   27.988873] The buggy address is located 0 bytes inside of
[   27.988873]  allocated 120-byte region [ffff88810622c200, ffff88810622c278)
[   27.989496] 
[   27.989615] The buggy address belongs to the physical page:
[   27.989967] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10622c
[   27.990331] flags: 0x200000000000000(node=0|zone=2)
[   27.990760] page_type: f5(slab)
[   27.991034] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   27.991415] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   27.991851] page dumped because: kasan: bad access detected
[   27.992185] 
[   27.992303] Memory state around the buggy address:
[   27.992642]  ffff88810622c100: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   27.992951]  ffff88810622c180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.993253] >ffff88810622c200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   27.993710]                                                                 ^
[   27.994097]  ffff88810622c280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.994471]  ffff88810622c300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.994876] ==================================================================