Re: execve-bug ...

From: Willy Tarreau
Date: Sun Jun 12 2005 - 15:52:25 EST


On Sun, Jun 12, 2005 at 09:23:06PM +0200, DJ.CnX@xxxxxxxxxxxx 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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/