Hay
Date
June 8, 2025, 11:09 p.m.

Environment
qemu-x86_64

[   26.688726] ==================================================================
[   26.689438] BUG: KASAN: slab-out-of-bounds in _copy_to_user+0x3c/0x70
[   26.690044] Read of size 121 at addr ffff8881039c8700 by task kunit_try_catch/303
[   26.690780] 
[   26.691004] CPU: 0 UID: 0 PID: 303 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc1 #1 PREEMPT(voluntary) 
[   26.691130] Tainted: [B]=BAD_PAGE, [N]=TEST
[   26.691172] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   26.691286] Call Trace:
[   26.691347]  <TASK>
[   26.691403]  dump_stack_lvl+0x73/0xb0
[   26.691662]  print_report+0xd1/0x650
[   26.691757]  ? __virt_addr_valid+0x1db/0x2d0
[   26.691841]  ? _copy_to_user+0x3c/0x70
[   26.691917]  ? kasan_complete_mode_report_info+0x2a/0x200
[   26.691989]  ? _copy_to_user+0x3c/0x70
[   26.692064]  kasan_report+0x141/0x180
[   26.692112]  ? _copy_to_user+0x3c/0x70
[   26.692154]  kasan_check_range+0x10c/0x1c0
[   26.692195]  __kasan_check_read+0x15/0x20
[   26.692257]  _copy_to_user+0x3c/0x70
[   26.692309]  copy_user_test_oob+0x364/0x10f0
[   26.692354]  ? __pfx_copy_user_test_oob+0x10/0x10
[   26.692391]  ? finish_task_switch.isra.0+0x153/0x700
[   26.692428]  ? __switch_to+0x47/0xf50
[   26.692466]  ? __schedule+0x10cc/0x2b60
[   26.692526]  ? __pfx_read_tsc+0x10/0x10
[   26.692565]  ? ktime_get_ts64+0x86/0x230
[   26.692603]  kunit_try_run_case+0x1a5/0x480
[   26.692644]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.692684]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   26.692724]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   26.692762]  ? __kthread_parkme+0x82/0x180
[   26.692793]  ? preempt_count_sub+0x50/0x80
[   26.692827]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.692866]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.692904]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   26.692943]  kthread+0x337/0x6f0
[   26.692973]  ? trace_preempt_on+0x20/0xc0
[   26.693010]  ? __pfx_kthread+0x10/0x10
[   26.693043]  ? _raw_spin_unlock_irq+0x47/0x80
[   26.693077]  ? calculate_sigpending+0x7b/0xa0
[   26.693113]  ? __pfx_kthread+0x10/0x10
[   26.693146]  ret_from_fork+0x116/0x1d0
[   26.693174]  ? __pfx_kthread+0x10/0x10
[   26.693204]  ret_from_fork_asm+0x1a/0x30
[   26.693286]  </TASK>
[   26.693309] 
[   26.719436] Allocated by task 303:
[   26.720982]  kasan_save_stack+0x45/0x70
[   26.721788]  kasan_save_track+0x18/0x40
[   26.722467]  kasan_save_alloc_info+0x3b/0x50
[   26.722824]  __kasan_kmalloc+0xb7/0xc0
[   26.723227]  __kmalloc_noprof+0x1c9/0x500
[   26.724067]  kunit_kmalloc_array+0x25/0x60
[   26.724760]  copy_user_test_oob+0xab/0x10f0
[   26.725141]  kunit_try_run_case+0x1a5/0x480
[   26.725991]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.726800]  kthread+0x337/0x6f0
[   26.727189]  ret_from_fork+0x116/0x1d0
[   26.727652]  ret_from_fork_asm+0x1a/0x30
[   26.728073] 
[   26.728326] The buggy address belongs to the object at ffff8881039c8700
[   26.728326]  which belongs to the cache kmalloc-128 of size 128
[   26.729551] The buggy address is located 0 bytes inside of
[   26.729551]  allocated 120-byte region [ffff8881039c8700, ffff8881039c8778)
[   26.730596] 
[   26.730881] The buggy address belongs to the physical page:
[   26.731523] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1039c8
[   26.732112] flags: 0x200000000000000(node=0|zone=2)
[   26.732685] page_type: f5(slab)
[   26.733129] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   26.733801] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   26.734539] page dumped because: kasan: bad access detected
[   26.734942] 
[   26.735214] Memory state around the buggy address:
[   26.735791]  ffff8881039c8600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   26.736513]  ffff8881039c8680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.737166] >ffff8881039c8700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   26.737842]                                                                 ^
[   26.738554]  ffff8881039c8780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.739206]  ffff8881039c8800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.739865] ==================================================================

[   25.090125] ==================================================================
[   25.090672] BUG: KASAN: slab-out-of-bounds in _copy_to_user+0x3c/0x70
[   25.091354] Read of size 121 at addr ffff8881038d5f00 by task kunit_try_catch/303
[   25.091983] 
[   25.092250] CPU: 1 UID: 0 PID: 303 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc1 #1 PREEMPT(voluntary) 
[   25.092377] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.092420] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.092482] Call Trace:
[   25.092532]  <TASK>
[   25.092612]  dump_stack_lvl+0x73/0xb0
[   25.092707]  print_report+0xd1/0x650
[   25.092786]  ? __virt_addr_valid+0x1db/0x2d0
[   25.092868]  ? _copy_to_user+0x3c/0x70
[   25.092958]  ? kasan_complete_mode_report_info+0x2a/0x200
[   25.093035]  ? _copy_to_user+0x3c/0x70
[   25.093107]  kasan_report+0x141/0x180
[   25.093181]  ? _copy_to_user+0x3c/0x70
[   25.093221]  kasan_check_range+0x10c/0x1c0
[   25.093258]  __kasan_check_read+0x15/0x20
[   25.093288]  _copy_to_user+0x3c/0x70
[   25.093319]  copy_user_test_oob+0x364/0x10f0
[   25.093357]  ? __pfx_copy_user_test_oob+0x10/0x10
[   25.093392]  ? finish_task_switch.isra.0+0x153/0x700
[   25.093428]  ? __switch_to+0x47/0xf50
[   25.093463]  ? __schedule+0x10cc/0x2b60
[   25.093497]  ? __pfx_read_tsc+0x10/0x10
[   25.093528]  ? ktime_get_ts64+0x86/0x230
[   25.093562]  kunit_try_run_case+0x1a5/0x480
[   25.093599]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.093634]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.093669]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.093704]  ? __kthread_parkme+0x82/0x180
[   25.093732]  ? preempt_count_sub+0x50/0x80
[   25.093765]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.093801]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.093835]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.093890]  kthread+0x337/0x6f0
[   25.093928]  ? trace_preempt_on+0x20/0xc0
[   25.093966]  ? __pfx_kthread+0x10/0x10
[   25.093998]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.094030]  ? calculate_sigpending+0x7b/0xa0
[   25.094066]  ? __pfx_kthread+0x10/0x10
[   25.094105]  ret_from_fork+0x116/0x1d0
[   25.094168]  ? __pfx_kthread+0x10/0x10
[   25.094201]  ret_from_fork_asm+0x1a/0x30
[   25.094243]  </TASK>
[   25.094273] 
[   25.109318] Allocated by task 303:
[   25.109600]  kasan_save_stack+0x45/0x70
[   25.110072]  kasan_save_track+0x18/0x40
[   25.110573]  kasan_save_alloc_info+0x3b/0x50
[   25.111042]  __kasan_kmalloc+0xb7/0xc0
[   25.111477]  __kmalloc_noprof+0x1c9/0x500
[   25.111840]  kunit_kmalloc_array+0x25/0x60
[   25.112379]  copy_user_test_oob+0xab/0x10f0
[   25.112899]  kunit_try_run_case+0x1a5/0x480
[   25.113474]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.114059]  kthread+0x337/0x6f0
[   25.114469]  ret_from_fork+0x116/0x1d0
[   25.114827]  ret_from_fork_asm+0x1a/0x30
[   25.115187] 
[   25.115382] The buggy address belongs to the object at ffff8881038d5f00
[   25.115382]  which belongs to the cache kmalloc-128 of size 128
[   25.116099] The buggy address is located 0 bytes inside of
[   25.116099]  allocated 120-byte region [ffff8881038d5f00, ffff8881038d5f78)
[   25.117328] 
[   25.117601] The buggy address belongs to the physical page:
[   25.118146] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1038d5
[   25.119983] flags: 0x200000000000000(node=0|zone=2)
[   25.120824] page_type: f5(slab)
[   25.121138] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   25.121854] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   25.123188] page dumped because: kasan: bad access detected
[   25.123566] 
[   25.123753] Memory state around the buggy address:
[   25.124230]  ffff8881038d5e00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   25.124929]  ffff8881038d5e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.125625] >ffff8881038d5f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   25.126247]                                                                 ^
[   25.126915]  ffff8881038d5f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.127516]  ffff8881038d6000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   25.128104] ==================================================================