forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev-libs/wayland: Fix wayland-scanner executable stack in v1.10.0
- Loading branch information
Showing
2 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
dev-libs/wayland/files/1.10.0-scanner-avoid-executable-stack.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
From f8f3e54aa7bc15871ca4296cbc16ae065b07de4e Mon Sep 17 00:00:00 2001 | ||
From: Pekka Paalanen <[email protected]> | ||
Date: Wed, 2 Mar 2016 11:00:35 +0200 | ||
Subject: [PATCH] scanner: avoid executable stack | ||
|
||
Before this patch: | ||
$ scanelf -lpqe ./wayland-scanner | ||
RWX --- --- ./wayland-scanner | ||
|
||
That indicates the stack is executable, which is a bad thing for | ||
security. Wayland-scanner does not actually need an executable stack, it | ||
is just an oversight from using an .S file in the sources. | ||
|
||
Add a special incantation in dtddata.S to make it not cause the stack to | ||
become executable. | ||
|
||
Reported-by: Mart Raudsepp <[email protected]> | ||
Signed-off-by: Pekka Paalanen <[email protected]> | ||
Tested-by: Mart Raudsepp <[email protected]> | ||
--- | ||
src/dtddata.S | 8 ++++++++ | ||
1 file changed, 8 insertions(+) | ||
|
||
diff --git a/src/dtddata.S b/src/dtddata.S | ||
index 68e3435..ce51133 100644 | ||
--- a/src/dtddata.S | ||
+++ b/src/dtddata.S | ||
@@ -20,6 +20,14 @@ | ||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
*/ | ||
|
||
+/* | ||
+ * Avoid executable stack. | ||
+ * from: https://wiki.gentoo.org/wiki/Hardened/GNU_stack_quickstart | ||
+ */ | ||
+#if defined(__linux__) && defined(__ELF__) | ||
+.section .note.GNU-stack,"",%progbits | ||
+#endif | ||
+ | ||
/* from: http://www.linuxjournal.com/content/embedding-file-executable-aka-hello-world-version-5967#comment-348129 */ | ||
|
||
.macro binfile name file | ||
-- | ||
2.6.4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters