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:	Wed, 07 May 2014 17:24:00 +0200
From:	Paolo Bonzini <pbonzini@...hat.com>
To:	Bandan Das <bsd@...hat.com>, Nadav Amit <namit@...technion.ac.il>
CC:	mtosatti@...hat.com, hpa@...or.com, gleb@...nel.org,
	tglx@...utronix.de, mingo@...hat.com, x86@...nel.org,
	kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/5] KVM: x86: Wrong register masking in 64-bit mode

Il 07/05/2014 16:50, Bandan Das ha scritto:
>> > +static void assign_masked(ulong *dest, ulong src, int bytes)
>> >  {
>> > -	*dest = (*dest & ~mask) | (src & mask);
>> > +	switch (bytes) {
>> > +	case 2:
>> > +		*dest = (u16)src | (*dest & ~0xfffful);
>> > +		break;
>> > +	case 4:
>> > +		*dest = (u32)src;
>> > +		break;
>> > +	case 8:
>> > +		*dest = src;
>> > +		break;
>> > +	default:
>> > +		BUG();
> IIRC, Paolo mentioned that a WARN() is preferable. But I see
> a lot other places where BUG() is called, maybe, he can confirm.
>

There is really no reason to crash the host for a misused API, so I do 
believe that a WARN() is preferable.

Paolo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ