Hay
Date
July 20, 2025, 8:11 p.m.

Environment
qemu-x86_64

[   17.047719] ==================================================================
[   17.048067] BUG: KASAN: slab-out-of-bounds in _copy_to_user+0x3c/0x70
[   17.048361] Read of size 121 at addr ffff8881029dff00 by task kunit_try_catch/303
[   17.048665] 
[   17.048787] CPU: 1 UID: 0 PID: 303 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   17.048837] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.048850] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   17.048874] Call Trace:
[   17.048895]  <TASK>
[   17.048914]  dump_stack_lvl+0x73/0xb0
[   17.048947]  print_report+0xd1/0x610
[   17.048974]  ? __virt_addr_valid+0x1db/0x2d0
[   17.048999]  ? _copy_to_user+0x3c/0x70
[   17.049020]  ? kasan_complete_mode_report_info+0x2a/0x200
[   17.049045]  ? _copy_to_user+0x3c/0x70
[   17.049065]  kasan_report+0x141/0x180
[   17.049089]  ? _copy_to_user+0x3c/0x70
[   17.049114]  kasan_check_range+0x10c/0x1c0
[   17.049139]  __kasan_check_read+0x15/0x20
[   17.049160]  _copy_to_user+0x3c/0x70
[   17.049181]  copy_user_test_oob+0x364/0x10f0
[   17.049209]  ? __pfx_copy_user_test_oob+0x10/0x10
[   17.049233]  ? finish_task_switch.isra.0+0x153/0x700
[   17.049258]  ? __switch_to+0x47/0xf50
[   17.049287]  ? __schedule+0x10c6/0x2b60
[   17.049312]  ? __pfx_read_tsc+0x10/0x10
[   17.049336]  ? ktime_get_ts64+0x86/0x230
[   17.049362]  kunit_try_run_case+0x1a5/0x480
[   17.049388]  ? __pfx_kunit_try_run_case+0x10/0x10
[   17.049412]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   17.049438]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   17.049464]  ? __kthread_parkme+0x82/0x180
[   17.049498]  ? preempt_count_sub+0x50/0x80
[   17.049523]  ? __pfx_kunit_try_run_case+0x10/0x10
[   17.049548]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   17.049574]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   17.049599]  kthread+0x337/0x6f0
[   17.049620]  ? trace_preempt_on+0x20/0xc0
[   17.049646]  ? __pfx_kthread+0x10/0x10
[   17.049668]  ? _raw_spin_unlock_irq+0x47/0x80
[   17.049692]  ? calculate_sigpending+0x7b/0xa0
[   17.049718]  ? __pfx_kthread+0x10/0x10
[   17.049741]  ret_from_fork+0x116/0x1d0
[   17.049762]  ? __pfx_kthread+0x10/0x10
[   17.049794]  ret_from_fork_asm+0x1a/0x30
[   17.049827]  </TASK>
[   17.049838] 
[   17.057268] Allocated by task 303:
[   17.057457]  kasan_save_stack+0x45/0x70
[   17.057681]  kasan_save_track+0x18/0x40
[   17.058021]  kasan_save_alloc_info+0x3b/0x50
[   17.058251]  __kasan_kmalloc+0xb7/0xc0
[   17.058453]  __kmalloc_noprof+0x1c9/0x500
[   17.058669]  kunit_kmalloc_array+0x25/0x60
[   17.058885]  copy_user_test_oob+0xab/0x10f0
[   17.059108]  kunit_try_run_case+0x1a5/0x480
[   17.059325]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   17.059533]  kthread+0x337/0x6f0
[   17.059662]  ret_from_fork+0x116/0x1d0
[   17.059803]  ret_from_fork_asm+0x1a/0x30
[   17.060061] 
[   17.060164] The buggy address belongs to the object at ffff8881029dff00
[   17.060164]  which belongs to the cache kmalloc-128 of size 128
[   17.060727] The buggy address is located 0 bytes inside of
[   17.060727]  allocated 120-byte region [ffff8881029dff00, ffff8881029dff78)
[   17.061228] 
[   17.061304] The buggy address belongs to the physical page:
[   17.061504] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1029df
[   17.061870] flags: 0x200000000000000(node=0|zone=2)
[   17.062121] page_type: f5(slab)
[   17.062427] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   17.062684] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   17.063127] page dumped because: kasan: bad access detected
[   17.063388] 
[   17.063493] Memory state around the buggy address:
[   17.063713]  ffff8881029dfe00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   17.063940]  ffff8881029dfe80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.064168] >ffff8881029dff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   17.064390]                                                                 ^
[   17.064739]  ffff8881029dff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.065066]  ffff8881029e0000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   17.065385] ==================================================================