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]
Message-ID: <alpine.DEB.2.00.1102031114030.7277@kaball-desktop>
Date:	Thu, 3 Feb 2011 11:25:19 +0000
From:	Stefano Stabellini <stefano.stabellini@...citrix.com>
To:	"H. Peter Anvin" <hpa@...or.com>
CC:	Stefano Stabellini <Stefano.Stabellini@...citrix.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"tglx@...utronix.de" <tglx@...utronix.de>,
	"x86@...nel.org" <x86@...nel.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
	Jeremy Fitzhardinge <Jeremy.Fitzhardinge@...rix.com>,
	Jan Beulich <JBeulich@...ell.com>
Subject: Re: [PATCH] x86/mm/init: respect memblock reserved regions when
 destroying mappings

On Thu, 3 Feb 2011, H. Peter Anvin wrote:
> On 01/31/2011 07:18 AM, Stefano Stabellini wrote:
> > x86/mm/init: respect memblock reserved regions when destroying mappings
> > 
> > In init_memory_mapping we are destroying all the mappings between
> > _brk_end and _end, no matter if some memory areas in that range have
> > been reserved using memblock_x86_reserve_range.
> > Besides if _end is not pmd aligned we might destroy the
> > mappings for valid memory between _end and the following pmd.
> > 
> > In order to avoid this problem, before clearing any pmds we check if the
> > corresponding memory area has been reserved and we only destroy the
> > mapping if it hasn't.
> > 
> > We found this problem because under Xen we have a valid mapping at _end,
> > and if _end is not pmd aligned the current code destroys the initial
> > part of it.
> > 
> > In practice this fix does not have any impact on native.
> > 
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@...citrix.com>
> 
> How on Earth would you end up with a reserved region *inside the BRK*?

I think in practice you cannot, but you can have reserved regions at
_end, that is the main problem I am trying to solve.
If we have a reserved region at _end and _end is not PMD aligned, then
we have a problem.

I thought that checking for reserved regions before destroying the
mapping would be a decent solution (because it wouldn't affect the
normal case); so I ended up checking between _brk_end and _end too.

Other alternative solutions I thought about but that I discarded because
they also affect the normal case are:

- never destroy mappings that could go over _end;
- always PMD align _end.

If none of the above are acceptable, I welcome other suggestions :-)

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