Hay
Date
May 15, 2025, 10:38 a.m.

Environment
qemu-x86_64

[   17.985791] ==================================================================
[   17.986122] BUG: KASAN: slab-out-of-bounds in _copy_to_user+0x3c/0x70
[   17.986379] Read of size 121 at addr ffff888102b5b800 by task kunit_try_catch/303
[   17.986730] 
[   17.986921] CPU: 0 UID: 0 PID: 303 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT(voluntary) 
[   17.986986] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.987002] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   17.987025] Call Trace:
[   17.987044]  <TASK>
[   17.987065]  dump_stack_lvl+0x73/0xb0
[   17.987107]  print_report+0xd1/0x650
[   17.987134]  ? __virt_addr_valid+0x1db/0x2d0
[   17.987175]  ? _copy_to_user+0x3c/0x70
[   17.987195]  ? kasan_complete_mode_report_info+0x2a/0x200
[   17.987237]  ? _copy_to_user+0x3c/0x70
[   17.987260]  kasan_report+0x141/0x180
[   17.987285]  ? _copy_to_user+0x3c/0x70
[   17.987309]  kasan_check_range+0x10c/0x1c0
[   17.987335]  __kasan_check_read+0x15/0x20
[   17.987356]  _copy_to_user+0x3c/0x70
[   17.987376]  copy_user_test_oob+0x364/0x10f0
[   17.987416]  ? __pfx_copy_user_test_oob+0x10/0x10
[   17.987441]  ? finish_task_switch.isra.0+0x153/0x700
[   17.987478]  ? __switch_to+0x47/0xf50
[   17.987506]  ? __schedule+0x10cc/0x2b60
[   17.987543]  ? __pfx_read_tsc+0x10/0x10
[   17.987569]  ? ktime_get_ts64+0x86/0x230
[   17.987596]  kunit_try_run_case+0x1a5/0x480
[   17.987624]  ? __pfx_kunit_try_run_case+0x10/0x10
[   17.987647]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   17.987672]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   17.987696]  ? __kthread_parkme+0x82/0x180
[   17.987719]  ? preempt_count_sub+0x50/0x80
[   17.987743]  ? __pfx_kunit_try_run_case+0x10/0x10
[   17.987768]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   17.987791]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   17.987815]  kthread+0x337/0x6f0
[   17.987836]  ? trace_preempt_on+0x20/0xc0
[   17.987864]  ? __pfx_kthread+0x10/0x10
[   17.987885]  ? _raw_spin_unlock_irq+0x47/0x80
[   17.987907]  ? calculate_sigpending+0x7b/0xa0
[   17.987933]  ? __pfx_kthread+0x10/0x10
[   17.987955]  ret_from_fork+0x116/0x1d0
[   17.987974]  ? __pfx_kthread+0x10/0x10
[   17.987995]  ret_from_fork_asm+0x1a/0x30
[   17.988028]  </TASK>
[   17.988041] 
[   17.993176] Allocated by task 303:
[   17.993271]  kasan_save_stack+0x45/0x70
[   17.993365]  kasan_save_track+0x18/0x40
[   17.993454]  kasan_save_alloc_info+0x3b/0x50
[   17.993542]  __kasan_kmalloc+0xb7/0xc0
[   17.993701]  __kmalloc_noprof+0x1c9/0x500
[   17.993944]  kunit_kmalloc_array+0x25/0x60
[   17.994226]  copy_user_test_oob+0xab/0x10f0
[   17.994491]  kunit_try_run_case+0x1a5/0x480
[   17.994771]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   17.995037]  kthread+0x337/0x6f0
[   17.995121]  ret_from_fork+0x116/0x1d0
[   17.995209]  ret_from_fork_asm+0x1a/0x30
[   17.995312] 
[   17.995366] The buggy address belongs to the object at ffff888102b5b800
[   17.995366]  which belongs to the cache kmalloc-128 of size 128
[   17.995817] The buggy address is located 0 bytes inside of
[   17.995817]  allocated 120-byte region [ffff888102b5b800, ffff888102b5b878)
[   17.996433] 
[   17.996557] The buggy address belongs to the physical page:
[   17.996748] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b5b
[   17.996997] flags: 0x200000000000000(node=0|zone=2)
[   17.997236] page_type: f5(slab)
[   17.997362] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   17.997579] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   17.997808] page dumped because: kasan: bad access detected
[   17.998032] 
[   17.998105] Memory state around the buggy address:
[   17.998283]  ffff888102b5b700: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   17.998470]  ffff888102b5b780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.998749] >ffff888102b5b800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   17.998968]                                                                 ^
[   17.999193]  ffff888102b5b880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.999477]  ffff888102b5b900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.999618] ==================================================================