Re: -Wl,-z,noexecstack hack removed for Linux and FreeBSD
Matthias Huetsch <[email protected]> Tue, 22 Jun 2010 16:57:34 +0200
| Newsgroups | gmane.comp.openoffice.devel.porting |
|---|---|
| Message-ID | <[email protected]> |
Hi Stephan, On 06/22/2010 03:57 PM, Stephan Bergmann wrote: > On 06/22/10 15:19, Matthias Huetsch wrote: >> Hmm, I'm not sure I understand why linking with "-z noexecstack" would >> be a hack. > > The entity providing the assembler-level input data for a link object > (the C/C++ compiler in case of a C/C++ source file; the human author of > an assembler source file; etc.) knows whether or not that object needs > executable stack, and no other entity knows that (esp. not the linker). > The GCC C/C++ compiler in the old Hamburg tool chain, while being the > entity that knew that the objects it produced did not require executable > stack, failed to pass this information on to the linker. In that sense, > -Wl,-z,noexecstack was a hack to work around the shortcomings of that > old compiler. Okay, understood. Only, that in this case I am the human, that wants to specify a non-executable stack for my application (but, see below). >> To me it is an additional security measure, to explicitly mark an >> executable to not require executable stack pages (and not rely on >> possibly incesure defaults). >> >> So, I guess I would choose to keep linking with "-z noexecstack" (and in >> fact think, every executable in the system should be linked that way). > > In which case it would be better to use a system that forbids execution > of objects that claim they require executable stack. In such a system, > erroneously overriding an object's requirement of executable stack via > -z noexecstack leads to obscure failure during runtime, while it would > otherwise have lead to a meaningful error message upon start up of that > object. Well, I think it is not so important what system a user chooses. The point is, I want to provide an application, that is not vulnerable to exploits making use of executable stack. I want non-executable stack, always, on every system, not override-able by any component that gets mapped into my processes address space. I short, I want non-executable stack, and thus an explicit "-z nonexecstack" for soffice.bin (an our other executables). Matthias > > -Stephan