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:	Fri, 16 Dec 2011 09:54:57 -0800
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Yinghai Lu <yinghai.lu@...cle.com>
CC:	Jacob Shin <jacob.shin@....com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"Herrmann3, Andreas" <Andreas.Herrmann3@....com>,
	"x86@...nel.org" <x86@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Joerg Roedel <joerg.roedel@....com>
Subject: Re: [PATCH 1/1] x86: Exclude E820_RESERVED regions and memory holes
 above 4 GB from direct mapping.

On 12/16/2011 09:42 AM, Yinghai Lu wrote:
>
> no, you change the meaning max_low_pfn_mapped and max_pfn_mapped for x86_64 at least.
>
> before your patch:
> max_low_pfn_mapped is the mapped pfn beblow 4g.
> max_pfn_mapped: is mapped pfn.
>
> after your patch, those two variables does not mean the memory [0, max_low_pfn_mapped) and [4g<<12, max_pfn_mapped)
> are really mapped.
>

And that's exactly the problem.  It is BROKEN -- as in fundamentally 
dangerous -- for these mappings to exist.  It is because the model is 
too inflexible.

> so in arch/x86/platform/efi/efi.c
>
>                  if (end_pfn<= max_low_pfn_mapped
>                      || (end_pfn>  (1UL<<  (32 - PAGE_SHIFT))
>                          &&  end_pfn<= max_pfn_mapped))
>                          va = __va(md->phys_addr);
>                  else
>                          va = efi_ioremap(md->phys_addr, size, md->type);
>
>
> and others will have problem.
>
> to solve your problem:
> 1. unmap the HT range ?
> 2. or introduce mapped_pfn_range array?

1 is fundamentally a braindead hack that solves one case without solving 
the overall problem.

For 2 - why can't we simply make the invariant that E820_RAM is mapped 
and nothing else, with the sole exceptions being the 1 MiB (fixed MTRR)?

For things like efi.c we should make sure to have interfaces instead of 
open-code this kind of stuff.

	-hpa

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