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:	Sun, 01 Mar 2009 15:29:32 -0800
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Yinghai Lu <yinghai@...nel.org>
CC:	Ingo Molnar <mingo@...e.hu>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Jeremy Fitzhardinge <jeremy.fitzhardinge@...rix.com>
Subject: Re: [PATCH] x86: put initial_pg_tables into bss -v2

Yinghai Lu wrote:
> 
>> No, this is garbage.  If you're insisting on getting rid of the brk-like
>> allocation patterns,> YH
  then you have to get an alternative dynamic
>> allocator available to the pre-paging code.  Now, there is no reason we
>> couldn't execute C code before enabling paging, although the code would
>> either have to be PIC or linked at the physical address.
> 
> you can use find_e820_area()/reserve_early() pair to find right position for that.
> 

This stuff is currently done before paging is enabled, and existing C 
code can't be run as-is.  There are three ways to deal with that:

a) compile some of the code with -fPIC/-fPIE.
b) link some code twice with different offsets.
c) play really ugly games with segments (thus making the virtualization
    guys unhappy.)

Pretty much, these options all suck.  Another option, of course, is to 
generate a fixed amount of page tables just to get us into the C 
environment, generate a new set, *and reclaim the old ones*.  That way 
we're not wasting memory if we're on a small-RAM machine.

It's still really ugly, though.  A much easier and cleaner way would 
seem to be to calculate a far limit on the brk and then marking it as a 
formal (non-alloc) section in the linker script and vmlinux file.  That 
way anything that examines the vmlinux file will see it as an exclusion 
section.  We can (and should) even verify that we don't overflow the brk 
and panic if we do.

	-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