Hay
Date
May 30, 2025, 4:14 a.m.

Environment
qemu-x86_64

[   25.575521] ==================================================================
[   25.576650] BUG: KASAN: slab-out-of-bounds in _copy_from_user+0x32/0x90
[   25.577219] Write of size 121 at addr ffff8881022e0700 by task kunit_try_catch/302
[   25.577727] 
[   25.578224] CPU: 1 UID: 0 PID: 302 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250530 #1 PREEMPT(voluntary) 
[   25.578363] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.578405] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.578471] Call Trace:
[   25.578513]  <TASK>
[   25.578616]  dump_stack_lvl+0x73/0xb0
[   25.578712]  print_report+0xd1/0x650
[   25.578798]  ? __virt_addr_valid+0x1db/0x2d0
[   25.578909]  ? _copy_from_user+0x32/0x90
[   25.578993]  ? kasan_complete_mode_report_info+0x2a/0x200
[   25.579121]  ? _copy_from_user+0x32/0x90
[   25.579202]  kasan_report+0x141/0x180
[   25.579287]  ? _copy_from_user+0x32/0x90
[   25.579345]  kasan_check_range+0x10c/0x1c0
[   25.579387]  __kasan_check_write+0x18/0x20
[   25.579418]  _copy_from_user+0x32/0x90
[   25.579451]  copy_user_test_oob+0x2be/0x10f0
[   25.579486]  ? __pfx_copy_user_test_oob+0x10/0x10
[   25.579516]  ? finish_task_switch.isra.0+0x153/0x700
[   25.579603]  ? __switch_to+0x47/0xf50
[   25.579653]  ? __schedule+0x10cc/0x2b60
[   25.579693]  ? __pfx_read_tsc+0x10/0x10
[   25.579726]  ? ktime_get_ts64+0x86/0x230
[   25.579763]  kunit_try_run_case+0x1a5/0x480
[   25.579797]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.579848]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.579893]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.579932]  ? __kthread_parkme+0x82/0x180
[   25.579964]  ? preempt_count_sub+0x50/0x80
[   25.579996]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.580027]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.580067]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.580104]  kthread+0x337/0x6f0
[   25.580133]  ? trace_preempt_on+0x20/0xc0
[   25.580169]  ? __pfx_kthread+0x10/0x10
[   25.580200]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.580235]  ? calculate_sigpending+0x7b/0xa0
[   25.580272]  ? __pfx_kthread+0x10/0x10
[   25.580304]  ret_from_fork+0x116/0x1d0
[   25.580330]  ? __pfx_kthread+0x10/0x10
[   25.580361]  ret_from_fork_asm+0x1a/0x30
[   25.580404]  </TASK>
[   25.580422] 
[   25.601482] Allocated by task 302:
[   25.601940]  kasan_save_stack+0x45/0x70
[   25.602416]  kasan_save_track+0x18/0x40
[   25.602911]  kasan_save_alloc_info+0x3b/0x50
[   25.603382]  __kasan_kmalloc+0xb7/0xc0
[   25.603905]  __kmalloc_noprof+0x1c9/0x500
[   25.604332]  kunit_kmalloc_array+0x25/0x60
[   25.604887]  copy_user_test_oob+0xab/0x10f0
[   25.605304]  kunit_try_run_case+0x1a5/0x480
[   25.605777]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.606391]  kthread+0x337/0x6f0
[   25.606807]  ret_from_fork+0x116/0x1d0
[   25.607258]  ret_from_fork_asm+0x1a/0x30
[   25.607738] 
[   25.608045] The buggy address belongs to the object at ffff8881022e0700
[   25.608045]  which belongs to the cache kmalloc-128 of size 128
[   25.608952] The buggy address is located 0 bytes inside of
[   25.608952]  allocated 120-byte region [ffff8881022e0700, ffff8881022e0778)
[   25.609965] 
[   25.610264] The buggy address belongs to the physical page:
[   25.610846] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1022e0
[   25.611430] flags: 0x200000000000000(node=0|zone=2)
[   25.612025] page_type: f5(slab)
[   25.612422] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   25.613084] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   25.613839] page dumped because: kasan: bad access detected
[   25.614312] 
[   25.614628] Memory state around the buggy address:
[   25.615102]  ffff8881022e0600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   25.615843]  ffff8881022e0680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.616474] >ffff8881022e0700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   25.618224]                                                                 ^
[   25.619058]  ffff8881022e0780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.619571]  ffff8881022e0800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.621925] ==================================================================