lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 8 Jan 2019 17:28:05 +0100
From:   Tomas Bortoli <tomasbortoli@...il.com>
To:     Paolo Bonzini <pbonzini@...hat.com>, rkrcmar@...hat.com,
        kvm@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org, syzkaller@...glegroups.com
Subject: Re: [PATCH] KVM: validate userspace input in
 kvm_clear_dirty_log_protect()

Hi Paolo,

On 1/7/19 11:42 PM, Paolo Bonzini wrote:
> 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.
> 
> 


Yeah, I agree. Thanks for the reply and sure you can do the changes, np :)

Tomas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ