From 9769599f1db98e2b67386ba755e5ad6f1c06fee1 Mon Sep 17 00:00:00 2001 From: John Reiser Date: Wed, 19 May 2004 00:15:00 +0000 Subject: [PATCH] Avoid "ASCII armor" area below 16MB (0x01000000) for exec-shield and pre-linked PT_INTERP such as ld-linux.so.2 l_lx_elf86.asm l_lx_elf86.lds l_lx_sh86.asm l_lx_sh86.lds committer: jreiser 1084925700 +0000 --- src/stub/l_lx_elf86.asm | 4 ++-- src/stub/l_lx_elf86.lds | 4 ++-- src/stub/l_lx_sh86.asm | 2 +- src/stub/l_lx_sh86.lds | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/stub/l_lx_elf86.asm b/src/stub/l_lx_elf86.asm index 8fcee7eb..e7e48dc8 100644 --- a/src/stub/l_lx_elf86.asm +++ b/src/stub/l_lx_elf86.asm @@ -141,7 +141,7 @@ unfold: lodsd push eax ; sz_uncompressed (junk, actually) push esp ; &sz_uncompressed - mov eax, 0x400000 + mov eax, 0x1000000 push eax ; &destination ; mmap a page to hold the decompressed program @@ -158,7 +158,7 @@ unfold: pop eax int 0x80 xchg eax, ebx - mov bh, PAGE_SIZE>>8 ; ebx= 0x401000 + mov bh, PAGE_SIZE>>8 ; ebx= 0x1001000 add esp, byte 6*4 ; discard args to mmap lodsd diff --git a/src/stub/l_lx_elf86.lds b/src/stub/l_lx_elf86.lds index e431969f..76ed12fc 100644 --- a/src/stub/l_lx_elf86.lds +++ b/src/stub/l_lx_elf86.lds @@ -38,8 +38,8 @@ PHDRS } SECTIONS { - /* 0x00401000: l_lx_elf86.asm assumes 1 page up from 64KB boundary */ - . = 0x00401000 + SIZEOF_HEADERS + 12; /* 12==sizeof(l_info) */ + /* 0x01001000: l_lx_elf86.asm assumes 1 page up from 64KB boundary */ + . = 0x01001000 + SIZEOF_HEADERS + 12; /* 12==sizeof(l_info) */ .text : { *(.text) *(.data) diff --git a/src/stub/l_lx_sh86.asm b/src/stub/l_lx_sh86.asm index 177960c8..12be5178 100644 --- a/src/stub/l_lx_sh86.asm +++ b/src/stub/l_lx_sh86.asm @@ -136,7 +136,7 @@ unfold: lodsd push eax ; sz_uncompressed of folded stub (junk, actually) push esp ; &sz_uncompressed - mov edx, 0x00800000 ; origin of this program + mov edx, 0x01400000 ; origin of this program mov eax, [p_memsz + szElf32_Ehdr + edx] ; length of loaded pages add eax, edx add edx, szElf32_Ehdr + 2*szElf32_Phdr ; convenient ptr diff --git a/src/stub/l_lx_sh86.lds b/src/stub/l_lx_sh86.lds index b3d551b8..ecf37a36 100644 --- a/src/stub/l_lx_sh86.lds +++ b/src/stub/l_lx_sh86.lds @@ -38,8 +38,8 @@ PHDRS /* force exactly 1 ELF32_Phdr: in particular, no PT_GNU_STACK */ SECTIONS { - /* 0x00800000: avoid 0x00400000 for shell itself being compressed */ - . = 0x00800000 + SIZEOF_HEADERS; + /* 0x01400000: avoid 0x01000000 for shell itself being compressed */ + . = 0x01400000 + SIZEOF_HEADERS; . = ALIGN(0x80); .data : { /* put everything together in one Phdr */ *(.text)