Hay
Date
Dec. 5, 2024, 2:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   36.798084] ==================================================================
[   36.799507] BUG: KASAN: slab-out-of-bounds in copy_to_kernel_nofault+0x8c/0x250
[   36.800216] Write of size 8 at addr fff00000c669bb78 by task kunit_try_catch/270
[   36.802007] 
[   36.802340] CPU: 1 UID: 0 PID: 270 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241205 #1
[   36.803717] Tainted: [B]=BAD_PAGE, [N]=TEST
[   36.804521] Hardware name: linux,dummy-virt (DT)
[   36.805008] Call trace:
[   36.805568]  show_stack+0x20/0x38 (C)
[   36.806217]  dump_stack_lvl+0x8c/0xd0
[   36.807016]  print_report+0x118/0x5e0
[   36.807927]  kasan_report+0xc8/0x118
[   36.808669]  kasan_check_range+0x100/0x1a8
[   36.809515]  __kasan_check_write+0x20/0x30
[   36.810249]  copy_to_kernel_nofault+0x8c/0x250
[   36.810847]  copy_to_kernel_nofault_oob+0x1bc/0x418
[   36.812219]  kunit_try_run_case+0x14c/0x3d0
[   36.812943]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   36.813651]  kthread+0x24c/0x2d0
[   36.814133]  ret_from_fork+0x10/0x20
[   36.814794] 
[   36.815238] Allocated by task 270:
[   36.815974]  kasan_save_stack+0x3c/0x68
[   36.816548]  kasan_save_track+0x20/0x40
[   36.817112]  kasan_save_alloc_info+0x40/0x58
[   36.817712]  __kasan_kmalloc+0xd4/0xd8
[   36.818706]  __kmalloc_cache_noprof+0x15c/0x3c0
[   36.819600]  copy_to_kernel_nofault_oob+0xc8/0x418
[   36.820324]  kunit_try_run_case+0x14c/0x3d0
[   36.821716]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   36.822550]  kthread+0x24c/0x2d0
[   36.823509]  ret_from_fork+0x10/0x20
[   36.824467] 
[   36.824738] The buggy address belongs to the object at fff00000c669bb00
[   36.824738]  which belongs to the cache kmalloc-128 of size 128
[   36.826348] The buggy address is located 0 bytes to the right of
[   36.826348]  allocated 120-byte region [fff00000c669bb00, fff00000c669bb78)
[   36.828583] 
[   36.828921] The buggy address belongs to the physical page:
[   36.829637] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10669b
[   36.830584] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   36.831635] page_type: f5(slab)
[   36.832183] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   36.833111] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   36.834095] page dumped because: kasan: bad access detected
[   36.834802] 
[   36.835381] Memory state around the buggy address:
[   36.836014]  fff00000c669ba00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   36.836923]  fff00000c669ba80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   36.837864] >fff00000c669bb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   36.838710]                                                                 ^
[   36.840425]  fff00000c669bb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   36.841503]  fff00000c669bc00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   36.842403] ==================================================================
[   36.752496] ==================================================================
[   36.753808] BUG: KASAN: slab-out-of-bounds in copy_to_kernel_nofault+0x204/0x250
[   36.754733] Read of size 8 at addr fff00000c669bb78 by task kunit_try_catch/270
[   36.755747] 
[   36.757000] CPU: 1 UID: 0 PID: 270 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241205 #1
[   36.758348] Tainted: [B]=BAD_PAGE, [N]=TEST
[   36.758940] Hardware name: linux,dummy-virt (DT)
[   36.759757] Call trace:
[   36.760161]  show_stack+0x20/0x38 (C)
[   36.760953]  dump_stack_lvl+0x8c/0xd0
[   36.761545]  print_report+0x118/0x5e0
[   36.762202]  kasan_report+0xc8/0x118
[   36.762863]  __asan_report_load8_noabort+0x20/0x30
[   36.763503]  copy_to_kernel_nofault+0x204/0x250
[   36.764286]  copy_to_kernel_nofault_oob+0x158/0x418
[   36.765466]  kunit_try_run_case+0x14c/0x3d0
[   36.766091]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   36.766870]  kthread+0x24c/0x2d0
[   36.767478]  ret_from_fork+0x10/0x20
[   36.768041] 
[   36.768351] Allocated by task 270:
[   36.768797]  kasan_save_stack+0x3c/0x68
[   36.769530]  kasan_save_track+0x20/0x40
[   36.770219]  kasan_save_alloc_info+0x40/0x58
[   36.770915]  __kasan_kmalloc+0xd4/0xd8
[   36.771580]  __kmalloc_cache_noprof+0x15c/0x3c0
[   36.772282]  copy_to_kernel_nofault_oob+0xc8/0x418
[   36.772970]  kunit_try_run_case+0x14c/0x3d0
[   36.773729]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   36.774771]  kthread+0x24c/0x2d0
[   36.775702]  ret_from_fork+0x10/0x20
[   36.776595] 
[   36.776931] The buggy address belongs to the object at fff00000c669bb00
[   36.776931]  which belongs to the cache kmalloc-128 of size 128
[   36.778492] The buggy address is located 0 bytes to the right of
[   36.778492]  allocated 120-byte region [fff00000c669bb00, fff00000c669bb78)
[   36.780168] 
[   36.780846] The buggy address belongs to the physical page:
[   36.781741] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10669b
[   36.782943] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   36.784437] page_type: f5(slab)
[   36.785183] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   36.786153] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   36.787027] page dumped because: kasan: bad access detected
[   36.788046] 
[   36.788380] Memory state around the buggy address:
[   36.789003]  fff00000c669ba00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc
[   36.789931]  fff00000c669ba80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   36.790865] >fff00000c669bb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   36.791975]                                                                 ^
[   36.792931]  fff00000c669bb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   36.793941]  fff00000c669bc00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   36.795353] ==================================================================

[   35.018733] ==================================================================
[   35.019974] BUG: KASAN: slab-out-of-bounds in copy_to_kernel_nofault+0x225/0x260
[   35.020670] Read of size 8 at addr ffff888102a17278 by task kunit_try_catch/288
[   35.022226] 
[   35.022454] CPU: 1 UID: 0 PID: 288 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241205 #1
[   35.023375] Tainted: [B]=BAD_PAGE, [N]=TEST
[   35.024127] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   35.024872] Call Trace:
[   35.025288]  <TASK>
[   35.025545]  dump_stack_lvl+0x73/0xb0
[   35.026169]  print_report+0xd1/0x640
[   35.026700]  ? __virt_addr_valid+0x1db/0x2d0
[   35.027292]  ? kasan_complete_mode_report_info+0x2a/0x200
[   35.028088]  kasan_report+0x102/0x140
[   35.028700]  ? copy_to_kernel_nofault+0x225/0x260
[   35.029365]  ? copy_to_kernel_nofault+0x225/0x260
[   35.030059]  __asan_report_load8_noabort+0x18/0x20
[   35.030592]  copy_to_kernel_nofault+0x225/0x260
[   35.031112]  copy_to_kernel_nofault_oob+0x179/0x4e0
[   35.031873]  ? __pfx_copy_to_kernel_nofault_oob+0x10/0x10
[   35.032578]  ? __schedule+0xc70/0x27e0
[   35.033257]  ? finish_task_switch.isra.0+0x153/0x700
[   35.033825]  ? finish_task_switch.isra.0+0x156/0x700
[   35.034340]  ? __pfx_read_tsc+0x10/0x10
[   35.035237]  ? ktime_get_ts64+0x86/0x230
[   35.035721]  kunit_try_run_case+0x1b3/0x490
[   35.036395]  ? __pfx_kunit_try_run_case+0x10/0x10
[   35.036940]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   35.037613]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   35.038186]  ? __kthread_parkme+0x82/0x160
[   35.038618]  ? preempt_count_sub+0x50/0x80
[   35.039290]  ? __pfx_kunit_try_run_case+0x10/0x10
[   35.039732]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   35.040465]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   35.041131]  kthread+0x257/0x310
[   35.041570]  ? __pfx_kthread+0x10/0x10
[   35.042449]  ret_from_fork+0x41/0x80
[   35.042645]  ? __pfx_kthread+0x10/0x10
[   35.043169]  ret_from_fork_asm+0x1a/0x30
[   35.043960]  </TASK>
[   35.044257] 
[   35.044474] Allocated by task 288:
[   35.044877]  kasan_save_stack+0x3d/0x60
[   35.045426]  kasan_save_track+0x18/0x40
[   35.046139]  kasan_save_alloc_info+0x3b/0x50
[   35.047126]  __kasan_kmalloc+0xb7/0xc0
[   35.047810]  __kmalloc_cache_noprof+0x184/0x410
[   35.048820]  copy_to_kernel_nofault_oob+0xc5/0x4e0
[   35.049402]  kunit_try_run_case+0x1b3/0x490
[   35.050277]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   35.050780]  kthread+0x257/0x310
[   35.051417]  ret_from_fork+0x41/0x80
[   35.051950]  ret_from_fork_asm+0x1a/0x30
[   35.052638] 
[   35.052881] The buggy address belongs to the object at ffff888102a17200
[   35.052881]  which belongs to the cache kmalloc-128 of size 128
[   35.053986] The buggy address is located 0 bytes to the right of
[   35.053986]  allocated 120-byte region [ffff888102a17200, ffff888102a17278)
[   35.056512] 
[   35.056839] The buggy address belongs to the physical page:
[   35.057624] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a17
[   35.058926] flags: 0x200000000000000(node=0|zone=2)
[   35.059516] page_type: f5(slab)
[   35.059752] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   35.060751] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   35.061930] page dumped because: kasan: bad access detected
[   35.062923] 
[   35.063063] Memory state around the buggy address:
[   35.064088]  ffff888102a17100: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   35.064880]  ffff888102a17180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   35.065390] >ffff888102a17200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   35.065974]                                                                 ^
[   35.066670]  ffff888102a17280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   35.067886]  ffff888102a17300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   35.068594] ==================================================================
[   35.070465] ==================================================================
[   35.072019] BUG: KASAN: slab-out-of-bounds in copy_to_kernel_nofault+0x99/0x260
[   35.072981] Write of size 8 at addr ffff888102a17278 by task kunit_try_catch/288
[   35.074711] 
[   35.075217] CPU: 1 UID: 0 PID: 288 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241205 #1
[   35.076311] Tainted: [B]=BAD_PAGE, [N]=TEST
[   35.076769] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   35.077737] Call Trace:
[   35.078480]  <TASK>
[   35.078780]  dump_stack_lvl+0x73/0xb0
[   35.079841]  print_report+0xd1/0x640
[   35.080179]  ? __virt_addr_valid+0x1db/0x2d0
[   35.080752]  ? kasan_complete_mode_report_info+0x2a/0x200
[   35.081376]  kasan_report+0x102/0x140
[   35.081821]  ? copy_to_kernel_nofault+0x99/0x260
[   35.082287]  ? copy_to_kernel_nofault+0x99/0x260
[   35.082803]  kasan_check_range+0x10c/0x1c0
[   35.083971]  __kasan_check_write+0x18/0x20
[   35.084718]  copy_to_kernel_nofault+0x99/0x260
[   35.085557]  copy_to_kernel_nofault_oob+0x214/0x4e0
[   35.086802]  ? __pfx_copy_to_kernel_nofault_oob+0x10/0x10
[   35.087790]  ? __schedule+0xc70/0x27e0
[   35.088448]  ? finish_task_switch.isra.0+0x153/0x700
[   35.089277]  ? finish_task_switch.isra.0+0x156/0x700
[   35.089774]  ? __pfx_read_tsc+0x10/0x10
[   35.090099]  ? ktime_get_ts64+0x86/0x230
[   35.090567]  kunit_try_run_case+0x1b3/0x490
[   35.091325]  ? __pfx_kunit_try_run_case+0x10/0x10
[   35.091865]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   35.092863]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   35.093328]  ? __kthread_parkme+0x82/0x160
[   35.094123]  ? preempt_count_sub+0x50/0x80
[   35.094635]  ? __pfx_kunit_try_run_case+0x10/0x10
[   35.095056]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   35.096071]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   35.097119]  kthread+0x257/0x310
[   35.097490]  ? __pfx_kthread+0x10/0x10
[   35.098140]  ret_from_fork+0x41/0x80
[   35.098529]  ? __pfx_kthread+0x10/0x10
[   35.099034]  ret_from_fork_asm+0x1a/0x30
[   35.099623]  </TASK>
[   35.100252] 
[   35.100831] Allocated by task 288:
[   35.101354]  kasan_save_stack+0x3d/0x60
[   35.101885]  kasan_save_track+0x18/0x40
[   35.102395]  kasan_save_alloc_info+0x3b/0x50
[   35.103001]  __kasan_kmalloc+0xb7/0xc0
[   35.103395]  __kmalloc_cache_noprof+0x184/0x410
[   35.104453]  copy_to_kernel_nofault_oob+0xc5/0x4e0
[   35.104986]  kunit_try_run_case+0x1b3/0x490
[   35.105310]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   35.106025]  kthread+0x257/0x310
[   35.106441]  ret_from_fork+0x41/0x80
[   35.106835]  ret_from_fork_asm+0x1a/0x30
[   35.107508] 
[   35.107742] The buggy address belongs to the object at ffff888102a17200
[   35.107742]  which belongs to the cache kmalloc-128 of size 128
[   35.109079] The buggy address is located 0 bytes to the right of
[   35.109079]  allocated 120-byte region [ffff888102a17200, ffff888102a17278)
[   35.110580] 
[   35.110938] The buggy address belongs to the physical page:
[   35.111589] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a17
[   35.112444] flags: 0x200000000000000(node=0|zone=2)
[   35.112883] page_type: f5(slab)
[   35.113416] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   35.114655] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   35.115527] page dumped because: kasan: bad access detected
[   35.116052] 
[   35.116405] Memory state around the buggy address:
[   35.117258]  ffff888102a17100: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   35.118011]  ffff888102a17180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   35.118297] >ffff888102a17200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   35.118573]                                                                 ^
[   35.118877]  ffff888102a17280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   35.119155]  ffff888102a17300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   35.119425] ==================================================================