mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
Give message on stderr when SELinux enforcing mode inhibits execution.
l_lx_elf.c fold_elf86.asm fold_elf86.h committer: jreiser <jreiser> 1145393418 +0000
This commit is contained in:
parent
2eb6e3b0ea
commit
58cce9d2f8
|
@ -97,32 +97,31 @@ L50:
|
|||
%define MAX_ELF_HDR 512
|
||||
|
||||
sub esp, dword MAX_ELF_HDR + OVERHEAD ; alloca
|
||||
mov edx, esp ; %edx= &tmp
|
||||
push ebx ; save &Elf32_Ehdr of this stub
|
||||
xor ecx, ecx ; 0
|
||||
push ecx ; assume not ET_DYN
|
||||
lea eax, [szElf32_Ehdr + 2*szElf32_Phdr + szl_info + szp_info + ebx] ; 1st &b_info
|
||||
mov esi, [e_entry + ebx] ; beyond compressed data
|
||||
push ebx ; start of unmap region (&Elf32_Ehdr of this stub)
|
||||
mov edx, [p_memsz + szElf32_Ehdr + ebx] ; phdr[0].p_memsz, pre-rounded up
|
||||
lea edx, [PAGE_SIZE + edx + ebx] ; 1 page in l_lx_elf86asm for unfold
|
||||
push edx ; end of unmap region
|
||||
sub eax, eax ; 0
|
||||
cmp word [e_type + ebx], byte ET_DYN
|
||||
jne L53
|
||||
pop ecx ; is ET_DYN: discard false assumption
|
||||
add esi, ebx ; relocate e_entry
|
||||
mov ch, PAGE_SIZE>>8 ; %ecx= PAGE_SIZE
|
||||
add ebx, [p_memsz + szElf32_Ehdr + ebx]
|
||||
add ebx, ecx
|
||||
push ebx ; dynbase
|
||||
xchg eax, edx ; dynbase for ET_DYN; assumes mmap(0, ...) is placed after us!
|
||||
L53:
|
||||
push eax ; dynbase
|
||||
|
||||
mov esi, [e_entry + ebx] ; end of compressed data
|
||||
lea eax, [szElf32_Ehdr + 2*szElf32_Phdr + szl_info + szp_info + ebx] ; 1st &b_info
|
||||
sub esi, eax ; length of compressed data
|
||||
mov ebx, [ eax] ; length of uncompressed ELF headers
|
||||
mov ecx, [4+ eax] ; length of compressed ELF headers
|
||||
add ecx, byte szb_info
|
||||
lea edx, [3*4 + esp] ; &tmp
|
||||
pusha ; (AT_table, sz_cpr, f_expand, &tmp_ehdr, {sz_unc, &tmp}, {sz_cpr, &b1st_info} )
|
||||
inc edi ; swap with above 'pusha' to inhibit auxv_up for PT_INTERP
|
||||
EXTERN upx_main
|
||||
call upx_main ; returns entry address
|
||||
add esp, byte 8*4 ; remove 8 params from pusha
|
||||
pop ecx ; dynbase
|
||||
pop ebx ; &Elf32_Ehdr of this stub
|
||||
add esp, byte (8 +1)*4 ; remove 8 params from pusha, also dynbase
|
||||
pop ecx ; end of unmap region
|
||||
pop ebx ; start of unmap region (&Elf32_Ehdr of this stub)
|
||||
add esp, dword MAX_ELF_HDR + OVERHEAD ; un-alloca
|
||||
push eax ; save entry address
|
||||
|
||||
|
@ -135,23 +134,6 @@ L60:
|
|||
jne L60 ; not AT_NULL
|
||||
; edi now points at [AT_NULL]a_un.a_ptr which contains result of make_hatch()
|
||||
|
||||
; _dl_start and company (ld-linux.so.2) once assumed that it had virgin stack,
|
||||
; and did not initialize all its stack local variables to zero.
|
||||
; See bug libc/1165 at http://bugs.gnu.org/cgi-bin/gnatsweb.pl
|
||||
; Found 1999-06-16 glibc-2.1.1
|
||||
; Fixed 1999-12-29 glibc-2.1.2
|
||||
;
|
||||
;%define N_STKCLR (0x100 + MAX_ELF_HDR + OVERHEAD)/4
|
||||
;%define N_STKCLR 8
|
||||
; lea edi, [esp - 4*N_STKCLR]
|
||||
; pusha ; values will be zeroed
|
||||
; mov esi,esp ; save
|
||||
; mov esp,edi ; Linux does not grow stack below esp
|
||||
; mov ecx, N_STKCLR
|
||||
; ; xor eax,eax ; eax already 0 from L60
|
||||
; rep stosd
|
||||
; mov esp,esi ; restore
|
||||
|
||||
push eax
|
||||
push eax
|
||||
push eax
|
||||
|
@ -159,7 +141,7 @@ L60:
|
|||
push eax
|
||||
push eax
|
||||
push eax
|
||||
push eax ; 32 bytes of zeroes now on stack
|
||||
push eax ; 32 bytes of zeroes now on stack, ready for 'popa'
|
||||
|
||||
sub ecx, ebx ; length to unmap
|
||||
mov al, __NR_munmap ; eax was 0 from L60
|
||||
|
@ -221,5 +203,24 @@ mmap:
|
|||
pop ebx
|
||||
ret
|
||||
|
||||
global die_SELinux
|
||||
die_SELinux:
|
||||
push ebx
|
||||
push byte L71 - L70
|
||||
pop edx
|
||||
call L71
|
||||
L70:
|
||||
db "SELinux enforcing mode inhibits execution.",10
|
||||
L71:
|
||||
pop ecx
|
||||
push byte 2
|
||||
pop ebx
|
||||
%define __NR_write 4
|
||||
push byte __NR_write
|
||||
pop eax
|
||||
int 0x80
|
||||
pop ebx
|
||||
ret
|
||||
|
||||
; vi:ts=8:et:nowrap
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* fold_elf86.h -- created from fold_elf86.bin, 1640 (0x668) bytes
|
||||
/* fold_elf86.h -- created from fold_elf86.bin, 1709 (0x6ad) bytes
|
||||
|
||||
This file is part of the UPX executable compressor.
|
||||
|
||||
|
@ -27,112 +27,116 @@
|
|||
*/
|
||||
|
||||
|
||||
#define LINUX_I386ELF_FOLD_SIZE 1640
|
||||
#define LINUX_I386ELF_FOLD_ADLER32 0xf835c99c
|
||||
#define LINUX_I386ELF_FOLD_CRC32 0xaa96c253
|
||||
#define LINUX_I386ELF_FOLD_SIZE 1709
|
||||
#define LINUX_I386ELF_FOLD_ADLER32 0x22cbe748
|
||||
#define LINUX_I386ELF_FOLD_CRC32 0xddb64ae3
|
||||
|
||||
unsigned char linux_i386elf_fold[1640] = {
|
||||
unsigned char linux_i386elf_fold[1709] = {
|
||||
127, 69, 76, 70, 1, 1, 1, 0, 76,105,110,117,120, 0, 0, 0, /* 0x 0 */
|
||||
2, 0, 3, 0, 1, 0, 0, 0,128, 0,192, 0, 52, 0, 0, 0, /* 0x 10 */
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 32, 0, 2, 0, 0, 0, /* 0x 20 */
|
||||
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 0, /* 0x 30 */
|
||||
0, 0,192, 0,104, 6, 0, 0,104, 6, 0, 0, 5, 0, 0, 0, /* 0x 40 */
|
||||
0, 16, 0, 0, 1, 0, 0, 0,104, 6, 0, 0,104, 6,192, 0, /* 0x 50 */
|
||||
104, 6,192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, /* 0x 60 */
|
||||
0, 0,192, 0,173, 6, 0, 0,176, 6, 0, 0, 5, 0, 0, 0, /* 0x 40 */
|
||||
0, 16, 0, 0, 1, 0, 0, 0,173, 6, 0, 0,176, 6,192, 0, /* 0x 50 */
|
||||
176, 6,192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, /* 0x 60 */
|
||||
0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 70 */
|
||||
41,201,186,120, 2, 0, 0,137,230,137,231,232,112, 0, 0, 0, /* 0x 80 */
|
||||
41,201,186,120, 2, 0, 0,137,230,137,231,232,115, 0, 0, 0, /* 0x 80 */
|
||||
137,230,209,234, 25,192, 41,193,141, 36,196,133,210,117,243,137, /* 0x 90 */
|
||||
231,232, 90, 0, 0, 0,129,236, 0, 10, 0, 0,137,226, 83, 49, /* 0x a0 */
|
||||
201, 81,141,131,140, 0, 0, 0,139,115, 24,102,131,123, 16, 3, /* 0x b0 */
|
||||
117, 11, 89, 1,222,181, 16, 3, 91, 72, 1,203, 83, 41,198,139, /* 0x c0 */
|
||||
24,139, 72, 4,131,193, 12, 96, 71,232,132, 4, 0, 0,131,196, /* 0x d0 */
|
||||
32, 89, 91,129,196, 0, 10, 0, 0, 80, 79, 41,192, 60,175,175, /* 0x e0 */
|
||||
117,252, 80, 80, 80, 80, 80, 80, 80, 80, 41,217,176, 91,255, 39, /* 0x f0 */
|
||||
173,171,133,192,117,250,173,171,133,192,117,250, 87,173,171,131, /* 0x 100 */
|
||||
248, 32,115, 3, 15,179,194,133,192,173,171,117,240,131,239, 8, /* 0x 110 */
|
||||
1,201, 64,243,171, 72,171,171, 95,195, 83,141, 92, 36, 8,106, /* 0x 120 */
|
||||
90, 88,205,128, 91,195, 0, 0, 87, 86,137,206, 83,137,195, 57, /* 0x 130 */
|
||||
8,139,120, 4,115, 10,106,127, 91,106, 1, 88,205,128,235,254, /* 0x 140 */
|
||||
133,201,116, 8,138, 7, 71,136, 2, 66,226,248, 1,115, 4, 41, /* 0x 150 */
|
||||
51, 91, 94, 95,195, 85,137,229, 87, 86,137,198, 83,137,211,131, /* 0x 160 */
|
||||
236, 24,139, 69, 8,139,125, 12,137, 69,220,131, 58, 0, 15,132, /* 0x 170 */
|
||||
184, 0, 0, 0,141, 85,228,185, 12, 0, 0, 0,137,240,232,165, /* 0x 180 */
|
||||
255,255,255,139, 69,228,139, 77,232,133,192,117, 19,129,249, 85, /* 0x 190 */
|
||||
80, 88, 33,117, 15,131, 62, 0, 15,132,142, 0, 0, 0,235, 4, /* 0x 1a0 */
|
||||
133,201,117, 10,106,127, 91,106, 1, 88,205,128,235,254, 57,193, /* 0x 1b0 */
|
||||
119,242, 59, 3,119,238, 57,193,115, 85, 15,182, 69,236, 80,141, /* 0x 1c0 */
|
||||
69,224, 80,255,115, 4, 81,255,118, 4,255, 85,220,131,196, 20, /* 0x 1d0 */
|
||||
133,192,117,208,139, 85,224, 59, 85,228,117,200,138, 69,237,132, /* 0x 1e0 */
|
||||
192,116, 34,133,255,116, 30,129,250, 0, 2, 0, 0,119, 4, 57, /* 0x 1f0 */
|
||||
19,117, 18, 15,182,192, 80, 15,182, 69,238, 80, 82,255,115, 4, /* 0x 200 */
|
||||
255,215,131,196, 16,139, 69,232, 1, 70, 4, 41, 6,235, 10,139, /* 0x 210 */
|
||||
83, 4,137,240,232, 15,255,255,255,139, 85,228,139, 3, 1, 83, /* 0x 220 */
|
||||
4, 41,208,133,192,137, 3,233, 66,255,255,255,141,101,244, 91, /* 0x 230 */
|
||||
94, 95,201,195,133,210,137,209,116, 6,198, 0, 0, 64,226,250, /* 0x 240 */
|
||||
195,133,192, 83,137,211,116, 29,168, 1,117, 25,139, 16, 57,218, /* 0x 250 */
|
||||
116, 7, 74,117, 11,133,219,116, 7,137, 24,137, 72, 4,235, 5, /* 0x 260 */
|
||||
131,192, 8,235,231, 91,195, 85,137,229, 87, 86, 83,131,236, 80, /* 0x 270 */
|
||||
137, 85,224,139, 93,224,137, 69,228,139, 77,224,139, 69, 8, 3, /* 0x 280 */
|
||||
73, 28,137, 69,220, 49,192,102,131,123, 16, 2,139, 85, 12,137, /* 0x 290 */
|
||||
77,212, 15,148,192,137, 85,216,137,202, 15,183, 75, 44,193,224, /* 0x 2a0 */
|
||||
4,131,192, 34,131,206,255,137, 69,184,137,200, 49,219, 49,255, /* 0x 2b0 */
|
||||
72,120, 31,131, 58, 1,117, 21,139, 66, 8, 57,240,115, 5,137, /* 0x 2c0 */
|
||||
198,139,122, 16, 3, 66, 20, 57,195,115, 2,137,195,131,194, 32, /* 0x 2d0 */
|
||||
226,225,137,240,129,230, 0,240,255,255,106, 0, 41,243,106, 0, /* 0x 2e0 */
|
||||
37,255, 15, 0, 0,137,117,188,141,179,255, 15, 0, 0,255,117, /* 0x 2f0 */
|
||||
184,129,230, 0,240,255,255,106, 7, 86,255,117,188,141,188, 7, /* 0x 300 */
|
||||
255, 15, 0, 0,232, 17,254,255,255,129,231, 0,240,255,255,137, /* 0x 310 */
|
||||
194,137,195, 1,242, 41,254,131,196, 24,137, 69,176,137, 85,240, /* 0x 320 */
|
||||
1,251,137,241,106, 91, 88,205,128,139, 69,224,199, 69,200, 0, /* 0x 330 */
|
||||
0, 0, 0,139, 93,176, 43, 93,188,102,131,120, 44, 0,137, 93, /* 0x 340 */
|
||||
208, 15,132,195, 1, 0, 0,139, 85,212,139, 2,131,248, 6,117, /* 0x 350 */
|
||||
24,139, 77,208, 3, 74, 8,186, 3, 0, 0, 0,139, 69,216,232, /* 0x 360 */
|
||||
221,254,255,255,233,138, 1, 0, 0, 72, 15,133,131, 1, 0, 0, /* 0x 370 */
|
||||
139, 93,212,199, 69,196, 64, 98, 81,115,139, 69,208,139, 75, 24, /* 0x 380 */
|
||||
3, 67, 8,131,225, 7,139, 83, 16,193,225, 2,211,109,196,137, /* 0x 390 */
|
||||
198,139, 75, 20,137,195,129,227,255, 15, 0, 0,137, 85,232,141, /* 0x 3a0 */
|
||||
60, 26,139, 85,212, 1,193,137, 69,236,139, 66, 4, 41,222,131, /* 0x 3b0 */
|
||||
101,196, 7, 41,216,131,125,220, 1, 80,255,117,228, 25,192,137, /* 0x 3c0 */
|
||||
77,192,131,224,224,131,192, 50,131,125,220, 0, 80,137,248,106, /* 0x 3d0 */
|
||||
3,116, 3,141, 71, 3, 80, 86,232, 61,253,255,255,131,196, 24, /* 0x 3e0 */
|
||||
57,198, 15,133,188, 0, 0, 0,131,125,220, 0,116, 34,139, 77, /* 0x 3f0 */
|
||||
212, 49,192,246, 65, 24, 1,116, 6,139, 69,228,131,192, 2, 80, /* 0x 400 */
|
||||
139, 69,220,255,117,228,141, 85,232,232, 71,253,255,255, 88, 90, /* 0x 410 */
|
||||
137,218,137,251,137,240,247,219,232, 23,254,255,255,129,227,255, /* 0x 420 */
|
||||
15, 0, 0,141, 4, 62,137,218,137, 93,180,232, 4,254,255,255, /* 0x 430 */
|
||||
131,125,220, 0,116, 94,139, 69,212,131, 56, 1,117, 86,246, 64, /* 0x 440 */
|
||||
24, 1,116, 80,139, 80, 20,139, 88, 8,141, 12, 26, 3, 77,208, /* 0x 450 */
|
||||
59, 80, 16,117, 14,137,200,247,216, 37,255, 15, 0, 0,131,248, /* 0x 460 */
|
||||
3,119, 17,139, 85,212,107, 69,208, 52,131,122, 4, 0,141, 76, /* 0x 470 */
|
||||
3, 12,117, 15,139, 1, 61,205,128, 97,195,116, 6,199, 1,205, /* 0x 480 */
|
||||
128, 97,195,133,201,116, 13,139, 69,216, 49,210,131,224,254,232, /* 0x 490 */
|
||||
173,253,255,255,137,243,137,249,139, 85,196,106,125, 88,205,128, /* 0x 4a0 */
|
||||
133,192,116, 10,106,127, 91,106, 1, 88,205,128,235,254,139, 85, /* 0x 4b0 */
|
||||
180,141, 4, 23,141, 28, 6, 59, 93,192,115, 30,106, 0,106, 0, /* 0x 4c0 */
|
||||
106, 50,255,117,196, 41, 93,192,255,117,192, 83,232, 73,252,255, /* 0x 4d0 */
|
||||
255,131,196, 24, 57,195,116, 27,235,202,131,125,220, 0,116, 19, /* 0x 4e0 */
|
||||
141, 79, 3,129,225,255, 15, 0, 0,131,249, 3,119, 5,106, 91, /* 0x 4f0 */
|
||||
88,205,128,139, 77,224,255, 69,200, 15,183, 65, 44,131, 69,212, /* 0x 500 */
|
||||
32, 57, 69,200, 15,140, 61,254,255,255,131,125,220, 0,117, 14, /* 0x 510 */
|
||||
139, 93,228,106, 6, 88,205,128,133,192,116, 20,235,134,139, 69, /* 0x 520 */
|
||||
224,102,131,120, 16, 3,116, 8,139, 93,240,106, 45, 88,205,128, /* 0x 530 */
|
||||
131,125, 16, 0,116, 8,139, 77,208,139, 85, 16,137, 10,139, 93, /* 0x 540 */
|
||||
224,139, 91, 24, 1, 93,208,139, 69,208,141,101,244, 91, 94, 95, /* 0x 550 */
|
||||
201,195, 85,137,229, 87, 86, 83,131,236, 24,139,125, 28,106, 0, /* 0x 560 */
|
||||
139, 69, 16,141, 87, 52,139,117, 8, 80,139, 93, 32,137, 69,236, /* 0x 570 */
|
||||
137, 85,232,141, 69, 32,141, 85, 24,232,215,251,255,255,139, 69, /* 0x 580 */
|
||||
12, 15,183, 79, 44,186, 5, 0, 0, 0,137, 69, 32,137,240, 41, /* 0x 590 */
|
||||
93, 36,232,170,252,255,255, 15,183, 79, 42,186, 4, 0, 0, 0, /* 0x 5a0 */
|
||||
137,240,232,154,252,255,255,139, 93,232,139, 77, 40,186, 3, 0, /* 0x 5b0 */
|
||||
0, 0, 3, 75, 8,137,240,131,193, 52,232,130,252,255,255,141, /* 0x 5c0 */
|
||||
69,240,137,250, 80,141, 69, 32, 86, 80,139, 69,236,232,149,252, /* 0x 5d0 */
|
||||
255,255,186, 9, 0, 0, 0,137,193,137,195,137,240,232, 95,252, /* 0x 5e0 */
|
||||
255,255,102,139, 79, 44,131,196, 20, 49,210,102,133,201,116, 94, /* 0x 5f0 */
|
||||
139, 69,232,131, 56, 3,117, 74,139, 93,240, 49,201, 3, 88, 8, /* 0x 600 */
|
||||
137,202,106, 5, 88,205,128,133,192,137,198,120, 21,186, 0, 2, /* 0x 610 */
|
||||
0, 0,137,195,137,249,106, 3, 88,205,128, 61, 0, 2, 0, 0, /* 0x 620 */
|
||||
116, 10,106,127, 91,106, 1, 88,205,128,235,254,106, 0,137,250, /* 0x 630 */
|
||||
106, 0,137,240,106, 0,232, 44,252,255,255,131,196, 12,137,195, /* 0x 640 */
|
||||
235, 12, 66, 15,183,193,131, 69,232, 32, 57,194,124,162,141,101, /* 0x 650 */
|
||||
244,137,216, 91, 94, 95,201,195 /* 0x 660 */
|
||||
231,232, 93, 0, 0, 0,129,236, 0, 10, 0, 0, 83,139, 83, 72, /* 0x a0 */
|
||||
141,148, 26, 0, 16, 0, 0, 82, 41,192,102,131,123, 16, 3,117, /* 0x b0 */
|
||||
1,146, 80,139,115, 24,141,131,140, 0, 0, 0, 41,198,139, 24, /* 0x c0 */
|
||||
139, 72, 4,131,193, 12,141, 84, 36, 12, 96, 71,232,198, 4, 0, /* 0x d0 */
|
||||
0,131,196, 36, 89, 91,129,196, 0, 10, 0, 0, 80, 79, 41,192, /* 0x e0 */
|
||||
60,175,175,117,252, 80, 80, 80, 80, 80, 80, 80, 80, 41,217,176, /* 0x f0 */
|
||||
91,255, 39,173,171,133,192,117,250,173,171,133,192,117,250, 87, /* 0x 100 */
|
||||
173,171,131,248, 32,115, 3, 15,179,194,133,192,173,171,117,240, /* 0x 110 */
|
||||
131,239, 8, 1,201, 64,243,171, 72,171,171, 95,195, 83,141, 92, /* 0x 120 */
|
||||
36, 8,106, 90, 88,205,128, 91,195, 83,106, 43, 90,232, 43, 0, /* 0x 130 */
|
||||
0, 0, 83, 69, 76,105,110,117,120, 32,101,110,102,111,114, 99, /* 0x 140 */
|
||||
105,110,103, 32,109,111,100,101, 32,105,110,104,105, 98,105,116, /* 0x 150 */
|
||||
115, 32,101,120,101, 99,117,116,105,111,110, 46, 10, 89,106, 2, /* 0x 160 */
|
||||
91,106, 4, 88,205,128, 91,195, 87, 86,137,206, 83,137,195, 57, /* 0x 170 */
|
||||
8,139,120, 4,115, 10,106,127, 91,106, 1, 88,205,128,235,254, /* 0x 180 */
|
||||
133,201,116, 8,138, 7, 71,136, 2, 66,226,248, 1,115, 4, 41, /* 0x 190 */
|
||||
51, 91, 94, 95,195, 85,137,229, 87, 86,137,198, 83,137,211,131, /* 0x 1a0 */
|
||||
236, 24,139, 69, 8,139,125, 12,137, 69,220,131, 58, 0, 15,132, /* 0x 1b0 */
|
||||
184, 0, 0, 0,141, 85,228,185, 12, 0, 0, 0,137,240,232,165, /* 0x 1c0 */
|
||||
255,255,255,139, 69,228,139, 77,232,133,192,117, 19,129,249, 85, /* 0x 1d0 */
|
||||
80, 88, 33,117, 15,131, 62, 0, 15,132,142, 0, 0, 0,235, 4, /* 0x 1e0 */
|
||||
133,201,117, 10,106,127, 91,106, 1, 88,205,128,235,254, 57,193, /* 0x 1f0 */
|
||||
119,242, 59, 3,119,238, 57,193,115, 85, 15,182, 69,236, 80,141, /* 0x 200 */
|
||||
69,224, 80,255,115, 4, 81,255,118, 4,255, 85,220,131,196, 20, /* 0x 210 */
|
||||
133,192,117,208,139, 85,224, 59, 85,228,117,200,138, 69,237,132, /* 0x 220 */
|
||||
192,116, 34,133,255,116, 30,129,250, 0, 2, 0, 0,119, 4, 57, /* 0x 230 */
|
||||
19,117, 18, 15,182,192, 80, 15,182, 69,238, 80, 82,255,115, 4, /* 0x 240 */
|
||||
255,215,131,196, 16,139, 69,232, 1, 70, 4, 41, 6,235, 10,139, /* 0x 250 */
|
||||
83, 4,137,240,232, 15,255,255,255,139, 85,228,139, 3, 1, 83, /* 0x 260 */
|
||||
4, 41,208,133,192,137, 3,233, 66,255,255,255,141,101,244, 91, /* 0x 270 */
|
||||
94, 95,201,195,133,210,137,209,116, 6,198, 0, 0, 64,226,250, /* 0x 280 */
|
||||
195,133,192, 83,137,211,116, 29,168, 1,117, 25,139, 16, 57,218, /* 0x 290 */
|
||||
116, 7, 74,117, 11,133,219,116, 7,137, 24,137, 72, 4,235, 5, /* 0x 2a0 */
|
||||
131,192, 8,235,231, 91,195, 85,137,229, 87, 86, 83,131,236, 80, /* 0x 2b0 */
|
||||
137, 85,224,139, 93,224,137, 69,228,139, 77,224,139, 69, 8, 3, /* 0x 2c0 */
|
||||
73, 28,137, 69,220, 49,192,102,131,123, 16, 2,139, 85, 12,137, /* 0x 2d0 */
|
||||
77,212, 15,148,192,137, 85,216,137,202, 15,183, 75, 44,193,224, /* 0x 2e0 */
|
||||
4,131,192, 34,131,206,255,137, 69,184,137,200, 49,219, 49,255, /* 0x 2f0 */
|
||||
72,120, 31,131, 58, 1,117, 21,139, 66, 8, 57,240,115, 5,137, /* 0x 300 */
|
||||
198,139,122, 16, 3, 66, 20, 57,195,115, 2,137,195,131,194, 32, /* 0x 310 */
|
||||
226,225,137,240,129,230, 0,240,255,255,106, 0, 41,243,106,255, /* 0x 320 */
|
||||
37,255, 15, 0, 0,137,117,188,141,179,255, 15, 0, 0,255,117, /* 0x 330 */
|
||||
184,129,230, 0,240,255,255,106, 0, 86,255,117,188,141,188, 7, /* 0x 340 */
|
||||
255, 15, 0, 0,232,212,253,255,255,129,231, 0,240,255,255,137, /* 0x 350 */
|
||||
194,137,195, 1,242, 41,254,131,196, 24,137, 69,176,137, 85,240, /* 0x 360 */
|
||||
1,251,137,241,106, 91, 88,205,128,139, 69,224,199, 69,200, 0, /* 0x 370 */
|
||||
0, 0, 0,139, 93,176, 43, 93,188,102,131,120, 44, 0,137, 93, /* 0x 380 */
|
||||
208, 15,132,200, 1, 0, 0,139, 85,212,139, 2,131,248, 6,117, /* 0x 390 */
|
||||
24,139, 77,208, 3, 74, 8,186, 3, 0, 0, 0,139, 69,216,232, /* 0x 3a0 */
|
||||
221,254,255,255,233,143, 1, 0, 0, 72, 15,133,136, 1, 0, 0, /* 0x 3b0 */
|
||||
139, 93,212,199, 69,196, 64, 98, 81,115,139, 69,208,139, 75, 24, /* 0x 3c0 */
|
||||
3, 67, 8,131,225, 7,139, 83, 16,193,225, 2,211,109,196,137, /* 0x 3d0 */
|
||||
198,139, 75, 20,137,195,129,227,255, 15, 0, 0,137, 85,232,141, /* 0x 3e0 */
|
||||
60, 26,139, 85,212, 1,193,137, 69,236,139, 66, 4, 41,222,131, /* 0x 3f0 */
|
||||
101,196, 7, 41,216,131,125,220, 1, 80,255,117,228, 25,192,137, /* 0x 400 */
|
||||
77,192,131,224,224,131,192, 50,131,125,220, 0, 80,137,248,106, /* 0x 410 */
|
||||
3,116, 3,141, 71, 3, 80, 86,232, 0,253,255,255,131,196, 24, /* 0x 420 */
|
||||
57,198, 15,133,193, 0, 0, 0,131,125,220, 0,116, 34,139, 77, /* 0x 430 */
|
||||
212, 49,192,246, 65, 24, 1,116, 6,139, 69,228,131,192, 2, 80, /* 0x 440 */
|
||||
139, 69,220,255,117,228,141, 85,232,232, 71,253,255,255, 88, 90, /* 0x 450 */
|
||||
137,218,137,251,137,240,247,219,232, 23,254,255,255,129,227,255, /* 0x 460 */
|
||||
15, 0, 0,141, 4, 62,137,218,137, 93,180,232, 4,254,255,255, /* 0x 470 */
|
||||
131,125,220, 0,116, 94,139, 69,212,131, 56, 1,117, 86,246, 64, /* 0x 480 */
|
||||
24, 1,116, 80,139, 80, 20,139, 88, 8,141, 12, 26, 3, 77,208, /* 0x 490 */
|
||||
59, 80, 16,117, 14,137,200,247,216, 37,255, 15, 0, 0,131,248, /* 0x 4a0 */
|
||||
3,119, 17,139, 85,212,107, 69,208, 52,131,122, 4, 0,141, 76, /* 0x 4b0 */
|
||||
3, 12,117, 15,139, 1, 61,205,128, 97,195,116, 6,199, 1,205, /* 0x 4c0 */
|
||||
128, 97,195,133,201,116, 13,139, 69,216, 49,210,131,224,254,232, /* 0x 4d0 */
|
||||
173,253,255,255,137,243,137,249,139, 85,196,106,125, 88,205,128, /* 0x 4e0 */
|
||||
133,192,116, 15,232, 64,252,255,255,106,127, 91,106, 1, 88,205, /* 0x 4f0 */
|
||||
128,235,254,139, 85,180,141, 4, 23,141, 28, 6, 59, 93,192,115, /* 0x 500 */
|
||||
30,106, 0,106,255,106, 50,255,117,196, 41, 93,192,255,117,192, /* 0x 510 */
|
||||
83,232, 7,252,255,255,131,196, 24, 57,195,116, 27,235,202,131, /* 0x 520 */
|
||||
125,220, 0,116, 19,141, 79, 3,129,225,255, 15, 0, 0,131,249, /* 0x 530 */
|
||||
3,119, 5,106, 91, 88,205,128,139, 77,224,255, 69,200, 15,183, /* 0x 540 */
|
||||
65, 44,131, 69,212, 32, 57, 69,200, 15,140, 56,254,255,255,131, /* 0x 550 */
|
||||
125,220, 0,117, 14,139, 93,228,106, 6, 88,205,128,133,192,116, /* 0x 560 */
|
||||
20,235,134,139, 69,224,102,131,120, 16, 3,116, 8,139, 93,240, /* 0x 570 */
|
||||
106, 45, 88,205,128,131,125, 16, 0,116, 8,139, 77,208,139, 85, /* 0x 580 */
|
||||
16,137, 10,139, 93,224,139, 91, 24, 1, 93,208,139, 69,208,141, /* 0x 590 */
|
||||
101,244, 91, 94, 95,201,195, 85,137,229, 87, 86, 83,131,236, 24, /* 0x 5a0 */
|
||||
139,125, 28,106, 0,139, 69, 16,141, 87, 52,139,117, 8, 80,139, /* 0x 5b0 */
|
||||
93, 32,137, 69,236,137, 85,232,141, 69, 32,141, 85, 24,232,210, /* 0x 5c0 */
|
||||
251,255,255,139, 69, 12, 15,183, 79, 44,186, 5, 0, 0, 0,137, /* 0x 5d0 */
|
||||
69, 32,137,240, 41, 93, 36,232,165,252,255,255, 15,183, 79, 42, /* 0x 5e0 */
|
||||
186, 4, 0, 0, 0,137,240,232,149,252,255,255,139, 93,232,139, /* 0x 5f0 */
|
||||
77, 40,186, 3, 0, 0, 0, 3, 75, 8,137,240,131,193, 52,232, /* 0x 600 */
|
||||
125,252,255,255,141, 69,240,137,250, 80,141, 69, 32, 86, 80,139, /* 0x 610 */
|
||||
69,236,232,144,252,255,255,186, 9, 0, 0, 0,137,193,137,195, /* 0x 620 */
|
||||
137,240,232, 90,252,255,255,102,139, 79, 44,131,196, 20, 49,210, /* 0x 630 */
|
||||
102,133,201,116, 94,139, 69,232,131, 56, 3,117, 74,139, 93,240, /* 0x 640 */
|
||||
49,201, 3, 88, 8,137,202,106, 5, 88,205,128,133,192,137,198, /* 0x 650 */
|
||||
120, 21,186, 0, 2, 0, 0,137,195,137,249,106, 3, 88,205,128, /* 0x 660 */
|
||||
61, 0, 2, 0, 0,116, 10,106,127, 91,106, 1, 88,205,128,235, /* 0x 670 */
|
||||
254,106, 0,137,250,106, 0,137,240,106, 0,232, 39,252,255,255, /* 0x 680 */
|
||||
131,196, 12,137,195,235, 12, 66, 15,183,193,131, 69,232, 32, 57, /* 0x 690 */
|
||||
194,124,162,141,101,244,137,216, 91, 94, 95,201,195 /* 0x 6a0 */
|
||||
};
|
||||
|
|
|
@ -90,6 +90,8 @@ err_exit(int a) __attribute__ ((__noreturn__));
|
|||
}
|
||||
#endif //}
|
||||
|
||||
extern void die_SELinux();
|
||||
|
||||
static void *
|
||||
do_brk(void *addr)
|
||||
{
|
||||
|
@ -268,8 +270,7 @@ xfind_pages(unsigned mflags, Elf32_Phdr const *phdr, int phnum,
|
|||
lo -= ~PAGE_MASK & lo; // round down to page boundary
|
||||
hi = PAGE_MASK & (hi - lo - PAGE_MASK -1); // page length
|
||||
szlo = PAGE_MASK & (szlo - PAGE_MASK -1); // page length
|
||||
addr = mmap((void *)lo, hi, PROT_READ|PROT_WRITE|PROT_EXEC,
|
||||
mflags, 0, 0 );
|
||||
addr = mmap((void *)lo, hi, PROT_NONE, mflags, -1, 0 ); // just reserve address space
|
||||
*p_brk = hi + addr; // the logical value of brk(0)
|
||||
munmap(szlo + addr, hi - szlo); // desirable if PT_LOAD non-contiguous
|
||||
return (unsigned long)addr - lo;
|
||||
|
@ -320,13 +321,14 @@ do_xmap(int const fdi, Elf32_Ehdr const *const ehdr, struct Extent *const xi,
|
|||
}
|
||||
}
|
||||
if (0!=mprotect(addr, mlen, prot)) {
|
||||
die_SELinux();
|
||||
err_exit(10);
|
||||
ERR_LAB
|
||||
}
|
||||
addr += mlen + frag; /* page boundary on hi end */
|
||||
if (addr < haddr) { // need pages for .bss
|
||||
if (addr != mmap(addr, haddr - addr, prot,
|
||||
MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, 0, 0 ) ) {
|
||||
MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0 ) ) {
|
||||
err_exit(9);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user