[PATCH] include/asm-i386/elf.h, kernel 2.1.126

John Reiser (jreiser@teleport.com)
Sat, 31 Oct 1998 14:36:01 -0800


This is a MIME encapsulated message.

--===_363B913F_==
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

I'm working on a product where it is desirable for a process to have as
much run-to-run repeatability as possible. I've run into problems with
exec() introducing needless randomness via the registers. Clearing the
registers in _start (crt0.s) is eons too late. I'm in favor of spending
the bytes and cycles to remove the randomness where it originates.

ELF_PLAT_INIT is used in fs/binfmt_elf.c .

-- 
-----------------------------------------------------------
jreiser@teleport.com (John Reiser)
-----------------------------------------------------------
--===_363B913F_==
Content-Type: text/plain; name="MY_PATCH"

diff -u linux-2.1.126/include/asm-i386/elf.h linux/include/asm-i386/elf.h --- linux-2.1.126/include/asm-i386/elf.h Wed Jun 24 14:30:11 1998 +++ linux/include/asm-i386/elf.h Sat Oct 31 05:52:59 1998 @@ -33,7 +33,10 @@ shared libraries that have been loaded before the code runs. A value of 0 tells we have no such handler. */ -#define ELF_PLAT_INIT(_r) _r->edx = 0 +#define ELF_PLAT_INIT(_r) _r->edi = _r->esi = _r->ebp = _r->ebx = _r->edx = _r->ecx = _r->eax = 0 +/* Clear all registers except %esp, to improve repeatability, debugability, + make life easier for conservative garbage collectors, and reduce + covert channels from one process to another. */ #define USE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 --===_363B913F_== Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit

--===_363B913F_==--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/