Hay
Date
Nov. 28, 2024, 2:36 a.m.

Environment
qemu-arm64
qemu-x86_64

[   37.090424] ==================================================================
[   37.091225] BUG: KASAN: slab-out-of-bounds in copy_to_kernel_nofault+0x8c/0x250
[   37.091778] Write of size 8 at addr fff00000c641f378 by task kunit_try_catch/269
[   37.092629] 
[   37.093006] CPU: 0 UID: 0 PID: 269 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241128 #1
[   37.094221] Tainted: [B]=BAD_PAGE, [N]=TEST
[   37.094803] Hardware name: linux,dummy-virt (DT)
[   37.095336] Call trace:
[   37.095766]  show_stack+0x20/0x38 (C)
[   37.097339]  dump_stack_lvl+0x8c/0xd0
[   37.098247]  print_report+0x118/0x5e0
[   37.098816]  kasan_report+0xc8/0x118
[   37.099448]  kasan_check_range+0x100/0x1a8
[   37.100046]  __kasan_check_write+0x20/0x30
[   37.100745]  copy_to_kernel_nofault+0x8c/0x250
[   37.101484]  copy_to_kernel_nofault_oob+0x1bc/0x418
[   37.102246]  kunit_try_run_case+0x14c/0x3d0
[   37.102931]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   37.103650]  kthread+0x24c/0x2d0
[   37.104265]  ret_from_fork+0x10/0x20
[   37.104851] 
[   37.105198] Allocated by task 269:
[   37.105833]  kasan_save_stack+0x3c/0x68
[   37.106480]  kasan_save_track+0x20/0x40
[   37.107069]  kasan_save_alloc_info+0x40/0x58
[   37.107727]  __kasan_kmalloc+0xd4/0xd8
[   37.108359]  __kmalloc_cache_noprof+0x15c/0x3c0
[   37.108971]  copy_to_kernel_nofault_oob+0xc8/0x418
[   37.109738]  kunit_try_run_case+0x14c/0x3d0
[   37.110374]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   37.111086]  kthread+0x24c/0x2d0
[   37.111685]  ret_from_fork+0x10/0x20
[   37.112260] 
[   37.112636] The buggy address belongs to the object at fff00000c641f300
[   37.112636]  which belongs to the cache kmalloc-128 of size 128
[   37.114041] The buggy address is located 0 bytes to the right of
[   37.114041]  allocated 120-byte region [fff00000c641f300, fff00000c641f378)
[   37.115270] 
[   37.115667] The buggy address belongs to the physical page:
[   37.116372] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10641f
[   37.117206] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   37.118104] page_type: f5(slab)
[   37.118701] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   37.119635] raw: 0000000000000000 0000000080100010 00000001f5000000 0000000000000000
[   37.120584] page dumped because: kasan: bad access detected
[   37.121275] 
[   37.121733] Memory state around the buggy address:
[   37.122308]  fff00000c641f200: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   37.123272]  fff00000c641f280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   37.124079] >fff00000c641f300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   37.124893]                                                                 ^
[   37.125757]  fff00000c641f380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   37.126610]  fff00000c641f400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   37.127447] ==================================================================
[   37.050060] ==================================================================
[   37.051159] BUG: KASAN: slab-out-of-bounds in copy_to_kernel_nofault+0x204/0x250
[   37.051791] Read of size 8 at addr fff00000c641f378 by task kunit_try_catch/269
[   37.052725] 
[   37.053928] CPU: 0 UID: 0 PID: 269 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241128 #1
[   37.055286] Tainted: [B]=BAD_PAGE, [N]=TEST
[   37.055935] Hardware name: linux,dummy-virt (DT)
[   37.056741] Call trace:
[   37.057454]  show_stack+0x20/0x38 (C)
[   37.058103]  dump_stack_lvl+0x8c/0xd0
[   37.058655]  print_report+0x118/0x5e0
[   37.059329]  kasan_report+0xc8/0x118
[   37.059957]  __asan_report_load8_noabort+0x20/0x30
[   37.060573]  copy_to_kernel_nofault+0x204/0x250
[   37.061487]  copy_to_kernel_nofault_oob+0x158/0x418
[   37.062347]  kunit_try_run_case+0x14c/0x3d0
[   37.062958]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   37.063585]  kthread+0x24c/0x2d0
[   37.064169]  ret_from_fork+0x10/0x20
[   37.064761] 
[   37.065068] Allocated by task 269:
[   37.065936]  kasan_save_stack+0x3c/0x68
[   37.066536]  kasan_save_track+0x20/0x40
[   37.067071]  kasan_save_alloc_info+0x40/0x58
[   37.067706]  __kasan_kmalloc+0xd4/0xd8
[   37.068301]  __kmalloc_cache_noprof+0x15c/0x3c0
[   37.068896]  copy_to_kernel_nofault_oob+0xc8/0x418
[   37.070059]  kunit_try_run_case+0x14c/0x3d0
[   37.070559]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   37.071226]  kthread+0x24c/0x2d0
[   37.071770]  ret_from_fork+0x10/0x20
[   37.072354] 
[   37.072700] The buggy address belongs to the object at fff00000c641f300
[   37.072700]  which belongs to the cache kmalloc-128 of size 128
[   37.073866] The buggy address is located 0 bytes to the right of
[   37.073866]  allocated 120-byte region [fff00000c641f300, fff00000c641f378)
[   37.075009] 
[   37.075385] The buggy address belongs to the physical page:
[   37.076476] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10641f
[   37.077601] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   37.078377] page_type: f5(slab)
[   37.078799] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   37.079675] raw: 0000000000000000 0000000080100010 00000001f5000000 0000000000000000
[   37.080446] page dumped because: kasan: bad access detected
[   37.081103] 
[   37.081622] Memory state around the buggy address:
[   37.082347]  fff00000c641f200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc
[   37.083107]  fff00000c641f280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   37.083850] >fff00000c641f300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   37.084708]                                                                 ^
[   37.085917]  fff00000c641f380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   37.086698]  fff00000c641f400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   37.087536] ==================================================================

[   28.511018] ==================================================================
[   28.511654] BUG: KASAN: slab-out-of-bounds in copy_to_kernel_nofault+0x99/0x260
[   28.512313] Write of size 8 at addr ffff888101b6b278 by task kunit_try_catch/289
[   28.513233] 
[   28.513661] CPU: 1 UID: 0 PID: 289 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241128 #1
[   28.514819] Tainted: [B]=BAD_PAGE, [N]=TEST
[   28.515234] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   28.516145] Call Trace:
[   28.516419]  <TASK>
[   28.516681]  dump_stack_lvl+0x73/0xb0
[   28.517062]  print_report+0xd1/0x640
[   28.517426]  ? __virt_addr_valid+0x1db/0x2d0
[   28.517939]  ? kasan_complete_mode_report_info+0x2a/0x200
[   28.518774]  kasan_report+0x102/0x140
[   28.519474]  ? copy_to_kernel_nofault+0x99/0x260
[   28.520135]  ? copy_to_kernel_nofault+0x99/0x260
[   28.521654]  kasan_check_range+0x10c/0x1c0
[   28.522176]  __kasan_check_write+0x18/0x20
[   28.522633]  copy_to_kernel_nofault+0x99/0x260
[   28.523113]  copy_to_kernel_nofault_oob+0x214/0x4e0
[   28.523789]  ? __pfx_copy_to_kernel_nofault_oob+0x10/0x10
[   28.524485]  ? finish_task_switch.isra.0+0x153/0x700
[   28.525041]  ? __schedule+0xc3e/0x2790
[   28.525365]  ? trace_hardirqs_on+0x37/0xe0
[   28.525928]  ? __pfx_read_tsc+0x10/0x10
[   28.526323]  ? ktime_get_ts64+0x84/0x230
[   28.526845]  kunit_try_run_case+0x1b3/0x490
[   28.527389]  ? __pfx_kunit_try_run_case+0x10/0x10
[   28.527986]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   28.528487]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   28.528938]  ? __kthread_parkme+0x82/0x160
[   28.529612]  ? preempt_count_sub+0x50/0x80
[   28.529919]  ? __pfx_kunit_try_run_case+0x10/0x10
[   28.530619]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   28.531192]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.531764]  kthread+0x257/0x310
[   28.532068]  ? __pfx_kthread+0x10/0x10
[   28.532372]  ret_from_fork+0x41/0x80
[   28.532947]  ? __pfx_kthread+0x10/0x10
[   28.533812]  ret_from_fork_asm+0x1a/0x30
[   28.534207]  </TASK>
[   28.534467] 
[   28.534951] Allocated by task 289:
[   28.535595]  kasan_save_stack+0x3d/0x60
[   28.536779]  kasan_save_track+0x18/0x40
[   28.537089]  kasan_save_alloc_info+0x3b/0x50
[   28.537736]  __kasan_kmalloc+0xb7/0xc0
[   28.538416]  __kmalloc_cache_noprof+0x184/0x410
[   28.538987]  copy_to_kernel_nofault_oob+0xc5/0x4e0
[   28.539606]  kunit_try_run_case+0x1b3/0x490
[   28.540267]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.540688]  kthread+0x257/0x310
[   28.541112]  ret_from_fork+0x41/0x80
[   28.541794]  ret_from_fork_asm+0x1a/0x30
[   28.542165] 
[   28.542667] The buggy address belongs to the object at ffff888101b6b200
[   28.542667]  which belongs to the cache kmalloc-128 of size 128
[   28.544467] The buggy address is located 0 bytes to the right of
[   28.544467]  allocated 120-byte region [ffff888101b6b200, ffff888101b6b278)
[   28.545441] 
[   28.545758] The buggy address belongs to the physical page:
[   28.546269] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101b6b
[   28.546953] flags: 0x200000000000000(node=0|zone=2)
[   28.547476] page_type: f5(slab)
[   28.547885] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   28.548557] raw: 0000000000000000 0000000080100010 00000001f5000000 0000000000000000
[   28.549259] page dumped because: kasan: bad access detected
[   28.550262] 
[   28.550575] Memory state around the buggy address:
[   28.550906]  ffff888101b6b100: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   28.551715]  ffff888101b6b180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.552364] >ffff888101b6b200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   28.552970]                                                                 ^
[   28.553619]  ffff888101b6b280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.554198]  ffff888101b6b300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.554846] ==================================================================
[   28.465946] ==================================================================
[   28.467182] BUG: KASAN: slab-out-of-bounds in copy_to_kernel_nofault+0x225/0x260
[   28.467934] Read of size 8 at addr ffff888101b6b278 by task kunit_try_catch/289
[   28.468605] 
[   28.468814] CPU: 1 UID: 0 PID: 289 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241128 #1
[   28.469959] Tainted: [B]=BAD_PAGE, [N]=TEST
[   28.470527] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   28.471420] Call Trace:
[   28.471625]  <TASK>
[   28.471992]  dump_stack_lvl+0x73/0xb0
[   28.473143]  print_report+0xd1/0x640
[   28.473862]  ? __virt_addr_valid+0x1db/0x2d0
[   28.474376]  ? kasan_complete_mode_report_info+0x2a/0x200
[   28.474988]  kasan_report+0x102/0x140
[   28.475561]  ? copy_to_kernel_nofault+0x225/0x260
[   28.476243]  ? copy_to_kernel_nofault+0x225/0x260
[   28.476609]  __asan_report_load8_noabort+0x18/0x20
[   28.477251]  copy_to_kernel_nofault+0x225/0x260
[   28.477662]  copy_to_kernel_nofault_oob+0x179/0x4e0
[   28.478364]  ? __pfx_copy_to_kernel_nofault_oob+0x10/0x10
[   28.478975]  ? finish_task_switch.isra.0+0x153/0x700
[   28.479634]  ? __schedule+0xc3e/0x2790
[   28.480197]  ? trace_hardirqs_on+0x37/0xe0
[   28.480831]  ? __pfx_read_tsc+0x10/0x10
[   28.481253]  ? ktime_get_ts64+0x84/0x230
[   28.481696]  kunit_try_run_case+0x1b3/0x490
[   28.482227]  ? __pfx_kunit_try_run_case+0x10/0x10
[   28.482821]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   28.483512]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   28.483970]  ? __kthread_parkme+0x82/0x160
[   28.484590]  ? preempt_count_sub+0x50/0x80
[   28.485050]  ? __pfx_kunit_try_run_case+0x10/0x10
[   28.485529]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   28.486326]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.486874]  kthread+0x257/0x310
[   28.487414]  ? __pfx_kthread+0x10/0x10
[   28.487928]  ret_from_fork+0x41/0x80
[   28.488407]  ? __pfx_kthread+0x10/0x10
[   28.488865]  ret_from_fork_asm+0x1a/0x30
[   28.489416]  </TASK>
[   28.489795] 
[   28.489951] Allocated by task 289:
[   28.490484]  kasan_save_stack+0x3d/0x60
[   28.490799]  kasan_save_track+0x18/0x40
[   28.491416]  kasan_save_alloc_info+0x3b/0x50
[   28.491878]  __kasan_kmalloc+0xb7/0xc0
[   28.492457]  __kmalloc_cache_noprof+0x184/0x410
[   28.492959]  copy_to_kernel_nofault_oob+0xc5/0x4e0
[   28.493476]  kunit_try_run_case+0x1b3/0x490
[   28.494042]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.494621]  kthread+0x257/0x310
[   28.495143]  ret_from_fork+0x41/0x80
[   28.495480]  ret_from_fork_asm+0x1a/0x30
[   28.496002] 
[   28.496191] The buggy address belongs to the object at ffff888101b6b200
[   28.496191]  which belongs to the cache kmalloc-128 of size 128
[   28.497265] The buggy address is located 0 bytes to the right of
[   28.497265]  allocated 120-byte region [ffff888101b6b200, ffff888101b6b278)
[   28.498496] 
[   28.498759] The buggy address belongs to the physical page:
[   28.499314] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101b6b
[   28.500168] flags: 0x200000000000000(node=0|zone=2)
[   28.500726] page_type: f5(slab)
[   28.501167] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   28.501977] raw: 0000000000000000 0000000080100010 00000001f5000000 0000000000000000
[   28.502823] page dumped because: kasan: bad access detected
[   28.503296] 
[   28.503570] Memory state around the buggy address:
[   28.504219]  ffff888101b6b100: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   28.504736]  ffff888101b6b180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.505495] >ffff888101b6b200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   28.506201]                                                                 ^
[   28.506858]  ffff888101b6b280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.507628]  ffff888101b6b300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.508363] ==================================================================