• M
    mips/kvm: fix ioctl error handling · 0178fd7d
    Michael S. Tsirkin 提交于
    Returning directly whatever copy_to_user(...) or copy_from_user(...)
    returns may not do the right thing if there's a pagefault:
    copy_to_user/copy_from_user return the number of bytes not copied in
    this case, but ioctls need to return -EFAULT instead.
    
    Fix up kvm on mips to do
    	return copy_to_user(...)) ?  -EFAULT : 0;
    and
    	return copy_from_user(...)) ?  -EFAULT : 0;
    
    everywhere.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
    Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
    0178fd7d
mips.c 40.5 KB