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, 22 Dec 2010 08:47:10 +0000
From:	Ian Campbell <Ian.Campbell@...rix.com>
To:	Jeremy Fitzhardinge <jeremy@...p.org>
CC:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
	Konrad Rzeszutek Wilk <konrad@...nel.org>,
	"xen-devel@...ts.xensource.com" <xen-devel@...ts.xensource.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Jan Beulich <JBeulich@...ell.com>,
	"hpa@...or.com" <hpa@...or.com>
Subject: Re: [Xen-devel] Re: [PATCH 01/10] xen: Make all reserved pages for
 the balloon be INVALID_P2M_ENTRY.

On Tue, 2010-12-21 at 22:19 +0000, Jeremy Fitzhardinge wrote: 
> On 12/21/2010 01:37 PM, Konrad Rzeszutek Wilk wrote:
> > +		BUG_ON(!set_phys_to_machine(pfn, INVALID_P2M_ENTRY));
[...] 
> I'm not a fan of hiding real side-effectful code in a BUG_ON
> predicate.
> 
> > +		BUG_ON(get_phys_to_machine(pfn) != INVALID_P2M_ENTRY);

I'm also not a fan of this "is the previous I called function buggy"
BUG_ON.

If we aren't confident that set_phys_to_machine() is doing the right
thing then adding a post-condition check to that function would be a
more preferable option.

Ian.


--
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