Re: [PATCH] FDPIC: Ignore the loader's PT_GNU_STACK whencalculating the stack size

From: Pavel Machek
Date: Wed Jul 08 2009 - 06:36:24 EST


On Wed 2009-07-01 13:08:14, David Howells wrote:
> Ignore the loader's PT_GNU_STACK when calculating the stack size, and only
> consider the executable's PT_GNU_STACK, assuming the executable has one.
>
> Currently the behaviour is to take the largest stack size and use that, but
> that means you can't reduce the stack size in the executable. The loader's
> stack size should probably only be used when executing the loader directly.
>
> WARNING: This patch is slightly dangerous - it may render a system inoperable
> if the loader's stack size is larger than that of important executables, and
> the system relies unknowingly on this increasing the size of the stack.

The patch seems wrong to me; loader needs the stack, too, right?

What about making sure that the loader specifies reasonable stack
size, instead?

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/