[cfe-dev] A new builtin: __builtin_stack_pointer()

PaX Team pageexec at gmail.com
Mon Nov 11 14:28:53 PST 2013


On 11 Nov 2013 at 13:50, Behan Webster wrote:

> On 11/10/13 13:46, PaX Team wrote:
> > now with that background let me try to answer your questions:
> >
> > - __builtin_frame_address is indeed good enough for this purpose (and i can't
> >   find more use of the stack register in C, but maybe Behan knows of more where
> >   an exact value is important)
> It is "good enough" in the case where you're merely trying to find the
> beginning or end of the stack, however it's not acceptable to kernel
> upstream (precisely for situations where there is no frame pointer
> register). I've tried that already. They want to use the stack pointer.
> 
> In the other use case, where the stack pointer is saved for later it is
> not good enough however.

can you tell me where a precise stack pointer value is needed? the i386 stack
walker code definitely does not need one (sampling 'esp' is not precise anyway
since its value can change within a function) neither does current_thread_info.

cheers,
 PaX Team




More information about the cfe-dev mailing list