Re: [PATCH RFC v2 6/6] KVM: introduce a new API for getting dirty bitmaps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/20/2010 08:03 PM, Takuya Yoshikawa wrote:
> @@ -318,7 +318,7 @@ struct kvm_dirty_log {
>  	__u32 padding1;
>  	union {
>  		void __user *dirty_bitmap; /* one bit per page */
> -		__u64 padding2;
> +		__u64 addr;

This can break on x86_32 and x86_64-compat. addr is a long not a __u64.


> +	case KVM_SWITCH_DIRTY_LOG: {
> +		struct kvm_dirty_log log;
> +
> +		r = -EFAULT;
> +		if (copy_from_user(&log, argp, sizeof log))
> +			goto out;
> +		r = kvm_vm_ioctl_switch_dirty_log(kvm, &log);
> +		if (r)
> +			goto out;
> +		r = -EFAULT;
> +		if (copy_to_user(argp, &log, sizeof log))
> +			goto out;
> +		r = 0;
> +		break;
> +	}

In x86_64-compat mode we are handling 32bit user-space addresses
so we need the compat counterpart of KVM_SWITCH_DIRTY_LOG too.
--
To unsubscribe from this list: send the line "unsubscribe kvm-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux KVM Devel]     [Linux Virtualization]     [Big List of Linux Books]     [Linux SCSI]     [Yosemite Forum]

  Powered by Linux