Hay
Date
July 4, 2025, 3:11 p.m.

Environment
qemu-x86_64

[   19.726124] ==================================================================
[   19.726579] BUG: KASAN: slab-out-of-bounds in _copy_to_user+0x4a/0x70
[   19.727030] Read of size 121 at addr ffff888102b20500 by task kunit_try_catch/306
[   19.728028] 
[   19.728433] CPU: 1 UID: 0 PID: 306 Comm: kunit_try_catch Tainted: G    B            N  6.15.5-rc2 #1 PREEMPT(voluntary) 
[   19.728503] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.728520] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   19.728546] Call Trace:
[   19.728574]  <TASK>
[   19.728606]  dump_stack_lvl+0x73/0xb0
[   19.728644]  print_report+0xd1/0x650
[   19.728672]  ? __virt_addr_valid+0x1db/0x2d0
[   19.728699]  ? _copy_to_user+0x4a/0x70
[   19.728723]  ? kasan_complete_mode_report_info+0x2a/0x200
[   19.728748]  ? _copy_to_user+0x4a/0x70
[   19.728771]  kasan_report+0x141/0x180
[   19.728797]  ? _copy_to_user+0x4a/0x70
[   19.728824]  kasan_check_range+0x10c/0x1c0
[   19.728848]  __kasan_check_read+0x15/0x20
[   19.728871]  _copy_to_user+0x4a/0x70
[   19.728893]  copy_user_test_oob+0x364/0x10f0
[   19.728919]  ? __pfx_copy_user_test_oob+0x10/0x10
[   19.728940]  ? finish_task_switch.isra.0+0x153/0x700
[   19.728967]  ? __switch_to+0x5d9/0xf60
[   19.728991]  ? dequeue_task_fair+0x166/0x4e0
[   19.729032]  ? __schedule+0x10cc/0x2b60
[   19.729064]  ? __pfx_read_tsc+0x10/0x10
[   19.729100]  ? ktime_get_ts64+0x86/0x230
[   19.729134]  kunit_try_run_case+0x1a5/0x480
[   19.729162]  ? __pfx_kunit_try_run_case+0x10/0x10
[   19.729187]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   19.729215]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   19.729242]  ? __kthread_parkme+0x82/0x180
[   19.729279]  ? preempt_count_sub+0x50/0x80
[   19.729325]  ? __pfx_kunit_try_run_case+0x10/0x10
[   19.729392]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   19.729442]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   19.729513]  kthread+0x337/0x6f0
[   19.729568]  ? trace_preempt_on+0x20/0xc0
[   19.729634]  ? __pfx_kthread+0x10/0x10
[   19.729680]  ? _raw_spin_unlock_irq+0x47/0x80
[   19.729726]  ? calculate_sigpending+0x7b/0xa0
[   19.729762]  ? __pfx_kthread+0x10/0x10
[   19.729785]  ret_from_fork+0x41/0x80
[   19.729810]  ? __pfx_kthread+0x10/0x10
[   19.729832]  ret_from_fork_asm+0x1a/0x30
[   19.729868]  </TASK>
[   19.729884] 
[   19.743155] Allocated by task 306:
[   19.743451]  kasan_save_stack+0x45/0x70
[   19.743758]  kasan_save_track+0x18/0x40
[   19.744058]  kasan_save_alloc_info+0x3b/0x50
[   19.744449]  __kasan_kmalloc+0xb7/0xc0
[   19.744702]  __kmalloc_noprof+0x1c9/0x500
[   19.744910]  kunit_kmalloc_array+0x25/0x60
[   19.745122]  copy_user_test_oob+0xab/0x10f0
[   19.745347]  kunit_try_run_case+0x1a5/0x480
[   19.745666]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   19.746144]  kthread+0x337/0x6f0
[   19.746477]  ret_from_fork+0x41/0x80
[   19.746886]  ret_from_fork_asm+0x1a/0x30
[   19.748065] 
[   19.748212] The buggy address belongs to the object at ffff888102b20500
[   19.748212]  which belongs to the cache kmalloc-128 of size 128
[   19.748885] The buggy address is located 0 bytes inside of
[   19.748885]  allocated 120-byte region [ffff888102b20500, ffff888102b20578)
[   19.749814] 
[   19.750217] The buggy address belongs to the physical page:
[   19.750473] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b20
[   19.751122] flags: 0x200000000000000(node=0|zone=2)
[   19.751506] page_type: f5(slab)
[   19.751810] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   19.752546] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   19.752889] page dumped because: kasan: bad access detected
[   19.753501] 
[   19.753624] Memory state around the buggy address:
[   19.754284]  ffff888102b20400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   19.754699]  ffff888102b20480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.755488] >ffff888102b20500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   19.755839]                                                                 ^
[   19.756512]  ffff888102b20580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.756925]  ffff888102b20600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.757584] ==================================================================