Vulnerability Development mailing list archives
Re: Smashing the Stack?
From: Gigi Sullivan <sullivan () sikurezza org>
Date: Sat, 20 Jul 2002 14:55:34 +0200
Aiee :) Hello! On Wed, Jul 17, 2002 at 08:46:58AM -0700, Jeremy Junginger wrote:
void function(int a, int b, int c) {
char buffer1[5];
char buffer2[10];
void main() {
function(1,2,3);
}
in "word" (4 byte) increments. That makes sense; however, when I
generate the assembly code with the exact same code, I see that it is
subtracting 40 rather than the expected 20
(bufger1(5bytes=2words=8bytes+10bytes=3words=12bytes). This part looks
This should be due to default stack boundary that gcc uses. Version 2.7.2.3
(quite old) seems to have default stack boundary set to 2; that means
that you have stuff on a 2^2=4 byte, i.e. dword boundary.
For example, gcc 2.95.2 seems to set this default to 3, IIRC.
To change this, just compile using -mpreferred-stack-boundary=2 so you'll
get the "usual" stuff on a dword (4 byte) boundary.
Hope this helps.
bye bye
-- gg sullivan
--
Lorenzo Cavallaro `Gigi Sullivan' <sullivan () sikurezza org>
Until I loved, life had no beauty;
I did not know I lived until I had loved. (Theodor Korner)
Current thread:
- Smashing the Stack? Jeremy Junginger (Jul 17)
- Re: Smashing the Stack? tide (Jul 17)
- Re: Smashing the Stack? Kim Reece (Jul 17)
- Re: Smashing the Stack? Vinay A. Mahadik (Jul 17)
- Re: Smashing the Stack? yatima (Jul 17)
- Re: Smashing the Stack? fila (Jul 18)
- Re: Smashing the Stack? Dan Kaminsky (Jul 18)
- Re: Smashing the Stack? fila (Jul 18)
- Re: Smashing the Stack? Gigi Sullivan (Jul 20)
- <Possible follow-ups>
- RE: Smashing the Stack? Eric Thomas (Jul 17)
- Re: Smashing the Stack? strange (Jul 17)
- Message not available
- Re: Smashing the Stack? Sebastian Hegenbart (Jul 20)
- Re: Smashing the Stack? strange (Jul 17)
- Re: Smashing the Stack? tide (Jul 17)
- Re: Smashing the Stack? Ali Saifullah Khan (Jul 17)
