Messages in this thread Patch in this message | | | From | (John Reiser) | Date | Sat, 31 Oct 1998 14:36:01 -0800 | Subject | [PATCH] include/asm-i386/elf.h, kernel 2.1.126 |
| |
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) -----------------------------------------------------------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
| |