Re: [PATCH] KVM: validate userspace input in kvm_clear_dirty_log_protect()

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

 



On 02/01/19 18:29, Tomas Bortoli wrote:
>  	n = kvm_dirty_bitmap_bytes(memslot);
> +
> +	if (n << 3 < log->num_pages || log->first_page > log->num_pages)
> +		return -EINVAL;
> +

This should be

	if (log->first_page > memslot->npages ||
	    log->num_pages > memslot->npages - log->first_page)
		return -EINVAL;

i.e. the comparison should check the last page in the range, not the
number of pages.  In addition, using "n" is unnecessary since we do have
the memslot.  I'll do the changes myself if you prefer, but an ack would
be nice.

Paolo



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux