-Wl,-z,noexecstack hack removed for Linux and FreeBSD

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

-Wl,-z,noexecstack hack removed for Linux and FreeBSD

stephan.bergmann
The fix for <http://qa.openoffice.org/issues/show_bug.cgi?id=110197>
"solenv: remove -Wl,-z,noexecstack hack," on CWS sb126 targeting OOo
3.4, removes from the OOo code base virtually all mentions of
noexecstack (see issue for details).  Most mentions were in Linux-only
code (where the need for the hack was probably only motivated by the old
Sun Hamburg tool chain, and so the hack is no longer needed after the
recent upgrade of that tool chain).

But some mentions were in code relevant for Linux and FreeBSD.  I assume
that this was by accident rather than by design, and the
-Wl,-z,noexecstack was never really necessary on FreeBSD (and it was
just lumped together with other pieces of code that actually are
relevant on both platforms).

Let me know if this change causes any problems,

-Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: -Wl,-z,noexecstack hack removed for Linux and FreeBSD

Matthias Huetsch
Hi Stephan, all,

Hmm, I'm not sure I understand why linking with "-z noexecstack" would
be a hack.

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).

Just my 2 cents,
Matthias

On 06/22/2010 09:31 AM, Stephan Bergmann wrote:

> The fix for <http://qa.openoffice.org/issues/show_bug.cgi?id=110197>
> "solenv: remove -Wl,-z,noexecstack hack," on CWS sb126 targeting OOo
> 3.4, removes from the OOo code base virtually all mentions of
> noexecstack (see issue for details).  Most mentions were in Linux-only
> code (where the need for the hack was probably only motivated by the old
> Sun Hamburg tool chain, and so the hack is no longer needed after the
> recent upgrade of that tool chain).
>
> But some mentions were in code relevant for Linux and FreeBSD.  I assume
> that this was by accident rather than by design, and the
> -Wl,-z,noexecstack was never really necessary on FreeBSD (and it was
> just lumped together with other pieces of code that actually are
> relevant on both platforms).
>
> Let me know if this change causes any problems,
>
> -Stephan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: -Wl,-z,noexecstack hack removed for Linux and FreeBSD

Matthias Huetsch
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

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]