Like done in gnttab_setup_table(), check the handle once early in the
function and use the lighter-weight (for PV) copying function in the
loop.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
return -EFAULT;
}
+ if ( !guest_handle_okay(op.frame_list, op.nr_frames) )
+ return -EFAULT;
+
d = rcu_lock_domain_by_any_id(op.dom);
if ( d == NULL )
{
for ( i = 0; i < op.nr_frames; i++ )
{
gmfn = gfn_x(gnttab_status_gfn(d, gt, i));
- if ( copy_to_guest_offset(op.frame_list, i, &gmfn, 1) )
+ if ( __copy_to_guest_offset(op.frame_list, i, &gmfn, 1) )
op.status = GNTST_bad_virt_addr;
}