lkml.org 
[lkml]   [1996]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Stack overflows.
Date

> With all the interest in buffer overflows lately, I was wondering if intel
> MM allows you to make the stack frame non-executable? I think someone made
> a patch for Solaris Sparc that does exactally that. (non supported by Sun,
> of course)

The trampolines generated by GCC for code like

foo()
{
eeks()
{
...
}
yuck(eeks);
}

or for certain objective C constructs assume that the stack frame is
executable. Trampolines are being used in the GNU libc and it's dynamic
linker, so it's a really bad idea to make the stack non-executable.

If you really want to make the stack non-executable see the documentation
for mprotect(2).

Btw, performancewise trampolines really suck on architecture that have to
maintain their I/D-cache consistence in software like 68k or MIPS. Even
Intel from Pentium on get a performance hit so better don't use them.

Ralf

\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.202 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site