Hi LQ,
Actually following a security course, i was looking for more info regarding buffer overflow.
During my personal research, i've found something quite strange which is obviously due to my lack of knowledge.
Why are they some differents version of gcc not working the same way when memory allocating ?
let's take an simple example :
char tableau[5]
char tableau[10]
When disassembling this code with gdb, i do have the following :
On debian 4.x ( kernel 2.6 ) and gcc 4.1.2,
it does allocate 16 bytes for the two arrays
SUB $ 0x10, %esp
On debian 3.1 ( kernel 2.4 ) and gcc 3.4.6
it does allocate 40 bytes
SUB $ 0x28, %esp
I presume there are differences between both version of gcc and / or kernel.
I've tried to have a look within GCC online doc, but without success at the moment.
Can someone set me out on the path of truth ?
I've read some stuff regarding protected kernel mode ( which, as far as i understood,is activated in 2.6 kernel ) .. could it be a clue ?
Thanks for any infos.
Regards,
Pierre