Author haypo
Recipients amaury.forgeotdarc, haypo
Date 2008-09-30.09:02:51
SpamBayes Score 2.46117e-09
Marked as misclassified No
Message-id <1222765373.64.0.170534331375.issue3999@psf.upfronthosting.co.za>
In-reply-to
Content
@amaury.forgeotdarc: It looks like PyOS_CheckStack() is only 
implemented for Windows. It uses alloca() + __try/__except + 
_resetstkoflw(). The GNU libc nor Linux kernel don't check stack 
pointer on alloca(), it's just $esp += <alloca argument>. Using 
alloca() you may also be able to able outside the stack to move your 
stack pointer to the heap or another memory mapping. PyOS_CheckStack() 
doesn't really protect the stack: if a function use alloca() or a 
similar construction like « void test(int size) { char 
allocated_on_the_stack[size]; ... } », you will not catch this error.

PyOS_CheckStack() only checks one type of error: stack overflow. It 
doesn't check invalid memory read / write (see my first example, 
read.py).
History
Date User Action Args
2008-09-30 09:02:53hayposetrecipients: + haypo, amaury.forgeotdarc
2008-09-30 09:02:53hayposetmessageid: <1222765373.64.0.170534331375.issue3999@psf.upfronthosting.co.za>
2008-09-30 09:02:53haypolinkissue3999 messages
2008-09-30 09:02:52haypocreate