mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* execve-bug ...
@ 2005-06-12 19:23 DJ.CnX
  2005-06-12 19:48 ` execve-bug Christoph Hellwig
  2005-06-12 20:49 ` execve-bug Willy Tarreau
  0 siblings, 2 replies; 3+ messages in thread
From: DJ.CnX @ 2005-06-12 19:23 UTC (permalink / raw)
  To: linux-kernel

Linux rrlf 2.6.5-7.151-default #1 Fri Mar 18 11:31:21 UTC 2005 i686 i686 i386 GNU/Linux

----------------- new.asm -------------------------
bits 32
section .text

global _start

msg db "och bin",0x0
msg_len equ $-msg 

_start:
           pusha
	   mov eax,4
	   mov ebx,1
	   mov ecx,msg
	   mov edx,msg_len
	   int 0x80
	   
	   popa
	   xor eax,eax
	   inc eax
	   int 0x80
---------------------------------------------------	   


shell# nasm -f elf -o new.o new.asm
shell# ld -o new new.o
shell# ./new
och binshell#







Linux rrlf 2.6.11 #2 Thu May 12 15:46:31 CEST 2005 i686 i686 i386 GNU/Linux

-------------- new.asm ----------------------------
bits 32
section .text

global _start

msg db "och bin",0x0
msg_len equ $-msg 

_start:
           pusha
	   mov eax,4
	   mov ebx,1
	   mov ecx,msg
	   mov edx,msg_len
	   int 0x80
	   
	   popa
	   xor eax,eax
	   inc eax
	   int 0x80
----------------------------------------------------

shell# nasm -f elf -o new.o new.asm 
shell# ld -o new new.o
shell# ./new
Segmentation Fault.



i even tried to execute the binary i've compiled on 2.6.5.x but it didnt
work : Segmentation Fault. So i think its a bug in the "execve"-function. 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: execve-bug ...
  2005-06-12 19:23 execve-bug DJ.CnX
@ 2005-06-12 19:48 ` Christoph Hellwig
  2005-06-12 20:49 ` execve-bug Willy Tarreau
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2005-06-12 19:48 UTC (permalink / raw)
  To: DJ.CnX; +Cc: linux-kernel


Can you post your messag to an assemly-language beginners forum please?

Thanks!


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: execve-bug ...
  2005-06-12 19:23 execve-bug DJ.CnX
  2005-06-12 19:48 ` execve-bug Christoph Hellwig
@ 2005-06-12 20:49 ` Willy Tarreau
  1 sibling, 0 replies; 3+ messages in thread
From: Willy Tarreau @ 2005-06-12 20:49 UTC (permalink / raw)
  To: DJ.CnX; +Cc: linux-kernel

On Sun, Jun 12, 2005 at 09:23:06PM +0200, DJ.CnX@phreaker.net wrote:
 
> shell# nasm -f elf -o new.o new.asm 
> shell# ld -o new new.o
> shell# ./new
> Segmentation Fault.
> 
> 
> 
> i even tried to execute the binary i've compiled on 2.6.5.x but it didnt
> work : Segmentation Fault. So i think its a bug in the "execve"-function. 

well, fortunately this is not the case or you would have some difficulties
executing your tools. You should find litterature about all the options
you have to pass to 'ld' to use it this way, or simpler : use gcc as the
linker and keep 'main' as your program's entry point, it WILL work.

You should have tried 'strace -i ./new', it would have showed you that
the program pointer is invalid (I see b7f63fae here), while on older
kernels it was still 8048080. This does not necessarily mean there's a
bug in execve(), but most probably that this code would have worked
before because of a side effect and that this side effect has been
closed now.

For instance, you can check asmutils which still works. But please,
don't post newbie asm problems here, this definitely is not the right
list.

Regards,
Willy


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-06-12 20:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-12 19:23 execve-bug DJ.CnX
2005-06-12 19:48 ` execve-bug Christoph Hellwig
2005-06-12 20:49 ` execve-bug Willy Tarreau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®