diff --git a/NEWS b/NEWS index ce330440..5af4d562 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ User visible changes for UPX Changes in 3.02 (XX XXX 2007): * fix unmapping on arm-linux.elf + * fix error checking in mmap for i386-linux.elf [triggered by -fPIE] Changes in 3.01 (31 Jul 2007): * new options --no-mode, --no-owner and --no-time to disable preservation diff --git a/src/stub/i386-linux.elf-entry.h b/src/stub/i386-linux.elf-entry.h index c57c1573..90604a2f 100644 --- a/src/stub/i386-linux.elf-entry.h +++ b/src/stub/i386-linux.elf-entry.h @@ -29,8 +29,8 @@ #define STUB_I386_LINUX_ELF_ENTRY_SIZE 37553 -#define STUB_I386_LINUX_ELF_ENTRY_ADLER32 0x96da8d2e -#define STUB_I386_LINUX_ELF_ENTRY_CRC32 0x566a9049 +#define STUB_I386_LINUX_ELF_ENTRY_ADLER32 0x494b8c24 +#define STUB_I386_LINUX_ELF_ENTRY_CRC32 0x516bf826 unsigned char stub_i386_linux_elf_entry[37553] = { 127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */ @@ -466,7 +466,7 @@ unsigned char stub_i386_linux_elf_entry[37553] = { 91,106, 4, 88,205,128,179,127,106, 1, 88,205,128, 94,141, 69, /* 0x1ae0 */ 247, 43, 0,137,194, 3, 64, 72, 5,255, 15, 0, 0, 37, 0,240, /* 0x1af0 */ 255,255, 80, 49,201,106,255,106, 50,181, 16,106, 7, 81, 80,137, /* 0x1b00 */ -227,106, 90, 88,205,128,133,192,120,158,146,147,252,173, 80,137, /* 0x1b10 */ +227,106, 90, 88,205,128, 59, 3,117,158,146,147,252,173, 80,137, /* 0x1b10 */ 225, 80, 81, 82,173, 80,173,137, 68, 36, 12, 86,255,213,131,196, /* 0x1b20 */ 44,195, 93,232,181,255,255,255,116,109,112, 47,105, 51, 56, 54, /* 0x1b30 */ 45,108,105,110,117,120, 46,101,108,102, 45,101,110,116,114,121, /* 0x1b40 */ diff --git a/src/stub/src/i386-linux.elf-entry.S b/src/stub/src/i386-linux.elf-entry.S index 20dabdb6..122631e4 100644 --- a/src/stub/src/i386-linux.elf-entry.S +++ b/src/stub/src/i386-linux.elf-entry.S @@ -195,8 +195,8 @@ unfold: push __NR_mmap pop eax int 0x80 // changes only %eax; %edx is live - test eax,eax - js msg_SELinux + cmp eax,[ebx] + jne msg_SELinux // not the expected address (includes error) xchg eax, edx // %edx= page after .text; %eax= &Elf32_Ehdr of this program xchg eax, ebx // %ebx= &Elf32_Ehdr of this program