sys-apps/dbus-stub: add
[sgilles-overlay.git] / dev-libs / wayland / files / 1.10.0-scanner-avoid-executable-stack.patch
blobff4899a23b44128a07fc9f2c8ded50f72cf0c667
1 From f8f3e54aa7bc15871ca4296cbc16ae065b07de4e Mon Sep 17 00:00:00 2001
2 From: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
3 Date: Wed, 2 Mar 2016 11:00:35 +0200
4 Subject: [PATCH] scanner: avoid executable stack
6 Before this patch:
7 $ scanelf -lpqe ./wayland-scanner
8 RWX --- --- ./wayland-scanner
10 That indicates the stack is executable, which is a bad thing for
11 security. Wayland-scanner does not actually need an executable stack, it
12 is just an oversight from using an .S file in the sources.
14 Add a special incantation in dtddata.S to make it not cause the stack to
15 become executable.
17 Reported-by: Mart Raudsepp <leio@gentoo.org>
18 Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
19 Tested-by: Mart Raudsepp <leio@gentoo.org>
20 ---
21 src/dtddata.S | 8 ++++++++
22 1 file changed, 8 insertions(+)
24 diff --git a/src/dtddata.S b/src/dtddata.S
25 index 68e3435..ce51133 100644
26 --- a/src/dtddata.S
27 +++ b/src/dtddata.S
28 @@ -20,6 +20,14 @@
29 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
32 +/*
33 + * Avoid executable stack.
34 + * from: https://wiki.gentoo.org/wiki/Hardened/GNU_stack_quickstart
35 + */
36 +#if defined(__linux__) && defined(__ELF__)
37 +.section .note.GNU-stack,"",%progbits
38 +#endif
40 /* from: http://www.linuxjournal.com/content/embedding-file-executable-aka-hello-world-version-5967#comment-348129 */
42 .macro binfile name file
43 --
44 2.6.4