David Benjamin 9c49713ba8 Add .note.GNU-stack at the source level.
GNU-based toolchains on ELF platforms default the stack to executable
and rely on a .note.GNU-stack section in *each* object file to flip it
off. The compiler knows to do this for its object files, but assembly
does everything by hand. See this link for details:
https://www.airs.com/blog/archives/518

We do this in the cmake build by passing -Wa,--noexecstack to the
assembler. However, since we have to deal with many buildsystems, it
would be more robust to put it in the source.

It's unclear whether this should be gated on ELF or Linux. The Gentoo
and Ubuntu documents recommend checking for Linux with gas, but only ELF
with NASM.
https://wiki.gentoo.org/wiki/Hardened/GNU_stack_quickstart
https://wiki.ubuntu.com/SecurityTeam/Roadmap/ExecutableStacks

At the same time, these links suggest it is an ELF-wide issue and not
just Linux:
https://github.com/golang/go/issues/5392
https://reviews.freebsd.org/D11033

https://github.com/openssl/openssl/issues/4575 also discusses this but
the rationale lists both ELF and non-ELF platforms, so it's unclear.

Treat it as ELF-wide for now. We can revisit this if necessary.

Update-Note: If there is a build failure due to .note.GNU-stack, holler.
Change-Id: Ic59096aa1fc2bf5380a412c9991de22cb46c0faf
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/37984
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
2019-10-03 22:10:36 +00:00
..
2018-09-05 23:41:25 +00:00
2018-09-05 23:41:25 +00:00
2018-10-15 23:37:04 +00:00
2018-09-05 23:41:25 +00:00
2018-11-12 23:34:36 +00:00
2019-04-17 20:57:57 +00:00
2018-09-05 23:41:25 +00:00
2019-05-24 16:52:33 +00:00
2018-10-01 17:35:10 +00:00
2018-09-05 23:41:25 +00:00
2019-07-10 21:14:32 +00:00
2019-03-14 15:21:48 +00:00
2019-09-20 00:10:53 +00:00
2018-02-13 20:12:47 +00:00
2016-03-26 04:54:44 +00:00
2019-09-27 19:02:43 +00:00
2017-10-25 04:17:18 +00:00