Re: [x86] Access off the bottom of stack causes a segfault?

From: H. Peter Anvin
Date: Tue Oct 14 2003 - 15:44:55 EST


Followup to: <Pine.LNX.4.53.0310141510590.2211@chaos>
By author: "Richard B. Johnson" <root@xxxxxxxxxxxxxxxxxx>
In newsgroup: linux.dev.kernel
>
> > main:
> > mov DWORD PTR [%ESP - 16004], %EBP # Save EBP to stack
>
> BAM **INTERRUPT** writes return address below stack-pointer.
>

Since we're in user mode, interrupts don't matter, but signals have
the same effect.

Note that this is a matter of the ABI definition. For example, in the
x86-64 ABI there is a designated region of well-defined size below
%rsp called the redzone, which signals aren't allowed to clobber.

-hpa
--
<hpa@xxxxxxxxxxxxx> at work, <hpa@xxxxxxxxx> in private!
If you send me mail in HTML format I will assume it's spam.
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64
-
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/