i386-linux stub: Use current __NR_uname; pacify memcheck
modified: stub/src/i386-linux.elf-entry.S modified: stub/src/i386-linux.elf-fold.S
This commit is contained in:
@@ -177,6 +177,14 @@ AT_PAGESZ= 6 // /usr/include/elf.h
|
|||||||
sub u_len,%esp // alloca
|
sub u_len,%esp // alloca
|
||||||
and $-2*NBPW,%esp // align stack
|
and $-2*NBPW,%esp // align stack
|
||||||
|
|
||||||
|
push %edi // save
|
||||||
|
lea NBPW(%esp,r_unc),%edi // after unfolded code
|
||||||
|
mov old_sp,%ecx
|
||||||
|
sub %edi,%ecx
|
||||||
|
mov $0xa5,%al
|
||||||
|
rep stosb // memcheck defense
|
||||||
|
pop %edi // restore
|
||||||
|
|
||||||
lea (2*NBPW + D_FOLD)(r_unc),%eax; add %esp,%eax
|
lea (2*NBPW + D_FOLD)(r_unc),%eax; add %esp,%eax
|
||||||
and $-2*NBPW,%eax; push %eax // MATCH_31 where to put pathname
|
and $-2*NBPW,%eax; push %eax // MATCH_31 where to put pathname
|
||||||
mov %eax,%ecx
|
mov %eax,%ecx
|
||||||
@@ -357,7 +365,7 @@ uname: .globl uname
|
|||||||
push %ebp; mov %esp,%ebp
|
push %ebp; mov %esp,%ebp
|
||||||
push %ebx
|
push %ebx
|
||||||
mov 2*NBPW(%ebp),%ebx
|
mov 2*NBPW(%ebp),%ebx
|
||||||
push $__NR_olduname; pop %eax; int $0x80
|
push $__NR_uname; pop %eax; int $0x80
|
||||||
pop %ebx; pop %ebp
|
pop %ebx; pop %ebp
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ uname: .globl uname
|
|||||||
mov %ebp,%esp
|
mov %ebp,%esp
|
||||||
push %ebx
|
push %ebx
|
||||||
mov %ebx, [2*NBPW + %ebp]
|
mov %ebx, [2*NBPW + %ebp]
|
||||||
push __NR_olduname; pop %eax; int 0x80
|
push __NR_uname; pop %eax; int 0x80
|
||||||
pop %ebx; pop %ebp
|
pop %ebx; pop %ebp
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user