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] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1112191230510.22060@chino.kir.corp.google.com>
Date:	Mon, 19 Dec 2011 12:34:16 -0800 (PST)
From:	David Rientjes <rientjes@...gle.com>
To:	David Daney <ddaney.cavm@...il.com>
cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Stephen Rothwell <sfr@...b.auug.org.au>,
	Paul Mundt <lethal@...ux-sh.org>, linux-kernel@...r.kernel.org,
	David Daney <david.daney@...ium.com>
Subject: Re: [PATCH] mm: Fix BUILD_BUG assertion in
 pmdp_clear_flush_young()

On Mon, 19 Dec 2011, David Daney wrote:

> > The problem here is that HPAGE_PMD_MASK is being referenced without
> > CONFIG_TRANSPARENT_HUGEPAGE.  pmdp_clear_flush_young() is only applicable
> > with that config option enabled.  So rather than trying to minimize lines
> > captured under an #ifdef by placing the BUG() directly in the function for
> > asm-generic, you'll need to wrap pmd_clear_flush_young() with
> > #ifdef CONFIG_TRANSPARENT_HUGEPAGE and define its equivalent for
> > CONFIG_TRANSPARENT_HUGEPAGE=n that breaks the build if not enabled.
> > 
> 
> That does sound like a better option.
> 
> I still think having the BUILD_BUG defined as we do in Andrew Morton's tree is
> the correct approach, and I don't want to see that reverted because of this
> ugliness.
> 

Agreed, the problem here is that we have existing code, such as 
pmdp_clear_flush_young() that is calling BUG() at runtime for 
non-supported configurations.  So when BUILD_BUG_ON() for HPAGE_PMD_MASK 
and friends was introduced, it detects improper use that needs to be fixed 
and you've found one of those cases.

> Really this is hackery that should be cleaned up as you suggest, instead of
> being papered over with this BUG() thing.  I can't test SH things, otherwise I
> might look at it.  The SH maintainers should probably take a look instead.
> 

It's not only about sh, this will affect any architecture that uses the 
generic version of pmdp_clear_flush_young(), which is everything except 
x86.
--
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