Hay
Date
Dec. 6, 2024, 3:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   37.812347] ==================================================================
[   37.813264] BUG: KASAN: slab-out-of-bounds in copy_to_kernel_nofault+0x8c/0x250
[   37.814005] Write of size 8 at addr fff00000c66d6278 by task kunit_try_catch/270
[   37.815483] 
[   37.815870] CPU: 1 UID: 0 PID: 270 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241206 #1
[   37.817264] Tainted: [B]=BAD_PAGE, [N]=TEST
[   37.818030] Hardware name: linux,dummy-virt (DT)
[   37.818655] Call trace:
[   37.819554]  show_stack+0x20/0x38 (C)
[   37.820365]  dump_stack_lvl+0x8c/0xd0
[   37.820969]  print_report+0x118/0x5e0
[   37.821263]  kasan_report+0xc8/0x118
[   37.821563]  kasan_check_range+0x100/0x1a8
[   37.822094]  __kasan_check_write+0x20/0x30
[   37.822827]  copy_to_kernel_nofault+0x8c/0x250
[   37.823572]  copy_to_kernel_nofault_oob+0x1bc/0x418
[   37.824681]  kunit_try_run_case+0x14c/0x3d0
[   37.825381]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   37.826195]  kthread+0x24c/0x2d0
[   37.826828]  ret_from_fork+0x10/0x20
[   37.827468] 
[   37.827811] Allocated by task 270:
[   37.828373]  kasan_save_stack+0x3c/0x68
[   37.828969]  kasan_save_track+0x20/0x40
[   37.829884]  kasan_save_alloc_info+0x40/0x58
[   37.830499]  __kasan_kmalloc+0xd4/0xd8
[   37.831241]  __kmalloc_cache_noprof+0x15c/0x3c0
[   37.832014]  copy_to_kernel_nofault_oob+0xc8/0x418
[   37.832787]  kunit_try_run_case+0x14c/0x3d0
[   37.833527]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   37.834431]  kthread+0x24c/0x2d0
[   37.835072]  ret_from_fork+0x10/0x20
[   37.835761] 
[   37.836438] The buggy address belongs to the object at fff00000c66d6200
[   37.836438]  which belongs to the cache kmalloc-128 of size 128
[   37.837954] The buggy address is located 0 bytes to the right of
[   37.837954]  allocated 120-byte region [fff00000c66d6200, fff00000c66d6278)
[   37.839236] 
[   37.839630] The buggy address belongs to the physical page:
[   37.840370] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1066d6
[   37.842055] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   37.843664] page_type: f5(slab)
[   37.844164] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   37.845129] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   37.846504] page dumped because: kasan: bad access detected
[   37.847136] 
[   37.847442] Memory state around the buggy address:
[   37.848113]  fff00000c66d6100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc
[   37.849448]  fff00000c66d6180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   37.850749] >fff00000c66d6200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   37.851629]                                                                 ^
[   37.852302]  fff00000c66d6280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   37.852844]  fff00000c66d6300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   37.853775] ==================================================================
[   37.768503] ==================================================================
[   37.770130] BUG: KASAN: slab-out-of-bounds in copy_to_kernel_nofault+0x204/0x250
[   37.771243] Read of size 8 at addr fff00000c66d6278 by task kunit_try_catch/270
[   37.772106] 
[   37.772462] CPU: 1 UID: 0 PID: 270 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241206 #1
[   37.773683] Tainted: [B]=BAD_PAGE, [N]=TEST
[   37.774396] Hardware name: linux,dummy-virt (DT)
[   37.775359] Call trace:
[   37.775878]  show_stack+0x20/0x38 (C)
[   37.776723]  dump_stack_lvl+0x8c/0xd0
[   37.777496]  print_report+0x118/0x5e0
[   37.778208]  kasan_report+0xc8/0x118
[   37.779038]  __asan_report_load8_noabort+0x20/0x30
[   37.779929]  copy_to_kernel_nofault+0x204/0x250
[   37.780841]  copy_to_kernel_nofault_oob+0x158/0x418
[   37.781745]  kunit_try_run_case+0x14c/0x3d0
[   37.782687]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   37.783401]  kthread+0x24c/0x2d0
[   37.784121]  ret_from_fork+0x10/0x20
[   37.784808] 
[   37.785204] Allocated by task 270:
[   37.785717]  kasan_save_stack+0x3c/0x68
[   37.786735]  kasan_save_track+0x20/0x40
[   37.787836]  kasan_save_alloc_info+0x40/0x58
[   37.788677]  __kasan_kmalloc+0xd4/0xd8
[   37.789200]  __kmalloc_cache_noprof+0x15c/0x3c0
[   37.789841]  copy_to_kernel_nofault_oob+0xc8/0x418
[   37.791050]  kunit_try_run_case+0x14c/0x3d0
[   37.791725]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   37.792390]  kthread+0x24c/0x2d0
[   37.793366]  ret_from_fork+0x10/0x20
[   37.793938] 
[   37.794443] The buggy address belongs to the object at fff00000c66d6200
[   37.794443]  which belongs to the cache kmalloc-128 of size 128
[   37.795655] The buggy address is located 0 bytes to the right of
[   37.795655]  allocated 120-byte region [fff00000c66d6200, fff00000c66d6278)
[   37.797155] 
[   37.797477] The buggy address belongs to the physical page:
[   37.798299] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1066d6
[   37.799686] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   37.800636] page_type: f5(slab)
[   37.801247] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   37.802160] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   37.803422] page dumped because: kasan: bad access detected
[   37.804130] 
[   37.804554] Memory state around the buggy address:
[   37.805220]  fff00000c66d6100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc
[   37.806065]  fff00000c66d6180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   37.806996] >fff00000c66d6200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   37.808266]                                                                 ^
[   37.809191]  fff00000c66d6280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   37.809835]  fff00000c66d6300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   37.810841] ==================================================================

[   31.657053] ==================================================================
[   31.658022] BUG: KASAN: slab-out-of-bounds in copy_to_kernel_nofault+0x99/0x260
[   31.659540] Write of size 8 at addr ffff888102933878 by task kunit_try_catch/289
[   31.661219] 
[   31.661490] CPU: 0 UID: 0 PID: 289 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241206 #1
[   31.663284] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.663601] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   31.665614] Call Trace:
[   31.666015]  <TASK>
[   31.666469]  dump_stack_lvl+0x73/0xb0
[   31.666805]  print_report+0xd1/0x640
[   31.667420]  ? __virt_addr_valid+0x1db/0x2d0
[   31.667848]  ? kasan_complete_mode_report_info+0x2a/0x200
[   31.668504]  kasan_report+0x102/0x140
[   31.669182]  ? copy_to_kernel_nofault+0x99/0x260
[   31.670027]  ? copy_to_kernel_nofault+0x99/0x260
[   31.670440]  kasan_check_range+0x10c/0x1c0
[   31.670975]  __kasan_check_write+0x18/0x20
[   31.671470]  copy_to_kernel_nofault+0x99/0x260
[   31.672112]  copy_to_kernel_nofault_oob+0x214/0x4e0
[   31.672474]  ? __pfx_copy_to_kernel_nofault_oob+0x10/0x10
[   31.673163]  ? finish_task_switch.isra.0+0x153/0x700
[   31.673635]  ? __schedule+0xc70/0x27e0
[   31.674152]  ? trace_hardirqs_on+0x37/0xe0
[   31.674584]  ? __pfx_read_tsc+0x10/0x10
[   31.675135]  ? ktime_get_ts64+0x86/0x230
[   31.675462]  kunit_try_run_case+0x1b3/0x490
[   31.676257]  ? __pfx_kunit_try_run_case+0x10/0x10
[   31.676757]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   31.677341]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   31.678207]  ? __kthread_parkme+0x82/0x160
[   31.678522]  ? preempt_count_sub+0x50/0x80
[   31.679111]  ? __pfx_kunit_try_run_case+0x10/0x10
[   31.679563]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   31.680180]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   31.680727]  kthread+0x257/0x310
[   31.681211]  ? __pfx_kthread+0x10/0x10
[   31.681682]  ret_from_fork+0x41/0x80
[   31.682269]  ? __pfx_kthread+0x10/0x10
[   31.682585]  ret_from_fork_asm+0x1a/0x30
[   31.683107]  </TASK>
[   31.683540] 
[   31.683876] Allocated by task 289:
[   31.684181]  kasan_save_stack+0x3d/0x60
[   31.684489]  kasan_save_track+0x18/0x40
[   31.685060]  kasan_save_alloc_info+0x3b/0x50
[   31.685466]  __kasan_kmalloc+0xb7/0xc0
[   31.685968]  __kmalloc_cache_noprof+0x184/0x410
[   31.686557]  copy_to_kernel_nofault_oob+0xc5/0x4e0
[   31.687169]  kunit_try_run_case+0x1b3/0x490
[   31.687606]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   31.687990]  kthread+0x257/0x310
[   31.688493]  ret_from_fork+0x41/0x80
[   31.689175]  ret_from_fork_asm+0x1a/0x30
[   31.689484] 
[   31.689830] The buggy address belongs to the object at ffff888102933800
[   31.689830]  which belongs to the cache kmalloc-128 of size 128
[   31.690656] The buggy address is located 0 bytes to the right of
[   31.690656]  allocated 120-byte region [ffff888102933800, ffff888102933878)
[   31.692066] 
[   31.692246] The buggy address belongs to the physical page:
[   31.693183] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102933
[   31.693866] flags: 0x200000000000000(node=0|zone=2)
[   31.694628] page_type: f5(slab)
[   31.694996] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   31.695449] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   31.696367] page dumped because: kasan: bad access detected
[   31.697258] 
[   31.697518] Memory state around the buggy address:
[   31.697953]  ffff888102933700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc
[   31.698694]  ffff888102933780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.699576] >ffff888102933800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   31.700157]                                                                 ^
[   31.700808]  ffff888102933880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.701380]  ffff888102933900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.702387] ==================================================================
[   31.612543] ==================================================================
[   31.613909] BUG: KASAN: slab-out-of-bounds in copy_to_kernel_nofault+0x225/0x260
[   31.614791] Read of size 8 at addr ffff888102933878 by task kunit_try_catch/289
[   31.615462] 
[   31.615992] CPU: 0 UID: 0 PID: 289 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241206 #1
[   31.617242] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.617579] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   31.618653] Call Trace:
[   31.619047]  <TASK>
[   31.619619]  dump_stack_lvl+0x73/0xb0
[   31.620129]  print_report+0xd1/0x640
[   31.620609]  ? __virt_addr_valid+0x1db/0x2d0
[   31.621053]  ? kasan_complete_mode_report_info+0x2a/0x200
[   31.621679]  kasan_report+0x102/0x140
[   31.622052]  ? copy_to_kernel_nofault+0x225/0x260
[   31.622603]  ? copy_to_kernel_nofault+0x225/0x260
[   31.623165]  __asan_report_load8_noabort+0x18/0x20
[   31.623648]  copy_to_kernel_nofault+0x225/0x260
[   31.624087]  copy_to_kernel_nofault_oob+0x179/0x4e0
[   31.624426]  ? __pfx_copy_to_kernel_nofault_oob+0x10/0x10
[   31.624873]  ? finish_task_switch.isra.0+0x153/0x700
[   31.625748]  ? __schedule+0xc70/0x27e0
[   31.626303]  ? trace_hardirqs_on+0x37/0xe0
[   31.626906]  ? __pfx_read_tsc+0x10/0x10
[   31.627522]  ? ktime_get_ts64+0x86/0x230
[   31.628076]  kunit_try_run_case+0x1b3/0x490
[   31.628407]  ? __pfx_kunit_try_run_case+0x10/0x10
[   31.629357]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   31.630035]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   31.630471]  ? __kthread_parkme+0x82/0x160
[   31.630925]  ? preempt_count_sub+0x50/0x80
[   31.631754]  ? __pfx_kunit_try_run_case+0x10/0x10
[   31.632272]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   31.632897]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   31.633467]  kthread+0x257/0x310
[   31.633983]  ? __pfx_kthread+0x10/0x10
[   31.634447]  ret_from_fork+0x41/0x80
[   31.634878]  ? __pfx_kthread+0x10/0x10
[   31.635465]  ret_from_fork_asm+0x1a/0x30
[   31.636023]  </TASK>
[   31.636404] 
[   31.636776] Allocated by task 289:
[   31.637107]  kasan_save_stack+0x3d/0x60
[   31.637545]  kasan_save_track+0x18/0x40
[   31.638045]  kasan_save_alloc_info+0x3b/0x50
[   31.638584]  __kasan_kmalloc+0xb7/0xc0
[   31.638996]  __kmalloc_cache_noprof+0x184/0x410
[   31.639372]  copy_to_kernel_nofault_oob+0xc5/0x4e0
[   31.640146]  kunit_try_run_case+0x1b3/0x490
[   31.640712]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   31.641300]  kthread+0x257/0x310
[   31.641596]  ret_from_fork+0x41/0x80
[   31.641908]  ret_from_fork_asm+0x1a/0x30
[   31.642376] 
[   31.642652] The buggy address belongs to the object at ffff888102933800
[   31.642652]  which belongs to the cache kmalloc-128 of size 128
[   31.643919] The buggy address is located 0 bytes to the right of
[   31.643919]  allocated 120-byte region [ffff888102933800, ffff888102933878)
[   31.645255] 
[   31.645449] The buggy address belongs to the physical page:
[   31.645974] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102933
[   31.647046] flags: 0x200000000000000(node=0|zone=2)
[   31.647714] page_type: f5(slab)
[   31.648146] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   31.648755] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   31.649822] page dumped because: kasan: bad access detected
[   31.650410] 
[   31.650690] Memory state around the buggy address:
[   31.651577]  ffff888102933700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc
[   31.652286]  ffff888102933780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.652746] >ffff888102933800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   31.653222]                                                                 ^
[   31.654340]  ffff888102933880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.655047]  ffff888102933900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.655575] ==================================================================