1 |
commit: fecd358d04d5766a08adedae95afcbd0eadde707 |
2 |
Author: Mart Raudsepp <leio <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Mar 2 10:31:20 2016 +0000 |
4 |
Commit: Mart Raudsepp <leio <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Mar 2 10:33:12 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fecd358d |
7 |
|
8 |
dev-libs/wayland: Fix wayland-scanner executable stack in v1.10.0 |
9 |
|
10 |
.../1.10.0-scanner-avoid-executable-stack.patch | 45 ++++++++++++++++++++++ |
11 |
...land-1.10.0.ebuild => wayland-1.10.0-r1.ebuild} | 6 ++- |
12 |
2 files changed, 49 insertions(+), 2 deletions(-) |
13 |
|
14 |
diff --git a/dev-libs/wayland/files/1.10.0-scanner-avoid-executable-stack.patch b/dev-libs/wayland/files/1.10.0-scanner-avoid-executable-stack.patch |
15 |
new file mode 100644 |
16 |
index 0000000..ff4899a |
17 |
--- /dev/null |
18 |
+++ b/dev-libs/wayland/files/1.10.0-scanner-avoid-executable-stack.patch |
19 |
@@ -0,0 +1,45 @@ |
20 |
+From f8f3e54aa7bc15871ca4296cbc16ae065b07de4e Mon Sep 17 00:00:00 2001 |
21 |
+From: Pekka Paalanen <pekka.paalanen@××××××××××××.uk> |
22 |
+Date: Wed, 2 Mar 2016 11:00:35 +0200 |
23 |
+Subject: [PATCH] scanner: avoid executable stack |
24 |
+ |
25 |
+Before this patch: |
26 |
+$ scanelf -lpqe ./wayland-scanner |
27 |
+RWX --- --- ./wayland-scanner |
28 |
+ |
29 |
+That indicates the stack is executable, which is a bad thing for |
30 |
+security. Wayland-scanner does not actually need an executable stack, it |
31 |
+is just an oversight from using an .S file in the sources. |
32 |
+ |
33 |
+Add a special incantation in dtddata.S to make it not cause the stack to |
34 |
+become executable. |
35 |
+ |
36 |
+Reported-by: Mart Raudsepp <leio@g.o> |
37 |
+Signed-off-by: Pekka Paalanen <pekka.paalanen@××××××××××××.uk> |
38 |
+Tested-by: Mart Raudsepp <leio@g.o> |
39 |
+--- |
40 |
+ src/dtddata.S | 8 ++++++++ |
41 |
+ 1 file changed, 8 insertions(+) |
42 |
+ |
43 |
+diff --git a/src/dtddata.S b/src/dtddata.S |
44 |
+index 68e3435..ce51133 100644 |
45 |
+--- a/src/dtddata.S |
46 |
++++ b/src/dtddata.S |
47 |
+@@ -20,6 +20,14 @@ |
48 |
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
49 |
+ */ |
50 |
+ |
51 |
++/* |
52 |
++ * Avoid executable stack. |
53 |
++ * from: https://wiki.gentoo.org/wiki/Hardened/GNU_stack_quickstart |
54 |
++ */ |
55 |
++#if defined(__linux__) && defined(__ELF__) |
56 |
++.section .note.GNU-stack,"",%progbits |
57 |
++#endif |
58 |
++ |
59 |
+ /* from: http://www.linuxjournal.com/content/embedding-file-executable-aka-hello-world-version-5967#comment-348129 */ |
60 |
+ |
61 |
+ .macro binfile name file |
62 |
+-- |
63 |
+2.6.4 |
64 |
+ |
65 |
|
66 |
diff --git a/dev-libs/wayland/wayland-1.10.0.ebuild b/dev-libs/wayland/wayland-1.10.0-r1.ebuild |
67 |
similarity index 90% |
68 |
rename from dev-libs/wayland/wayland-1.10.0.ebuild |
69 |
rename to dev-libs/wayland/wayland-1.10.0-r1.ebuild |
70 |
index b3d1bfc..4cff5fe 100644 |
71 |
--- a/dev-libs/wayland/wayland-1.10.0.ebuild |
72 |
+++ b/dev-libs/wayland/wayland-1.10.0-r1.ebuild |
73 |
@@ -40,8 +40,10 @@ DEPEND="${RDEPEND} |
74 |
) |
75 |
virtual/pkgconfig" |
76 |
|
77 |
-# dtd validation configure patch is upstream and will be part of 1.11 |
78 |
-PATCHES=( "${FILESDIR}/${PV}-build-fix-configure-disable-dtd-validation.patch" ) |
79 |
+PATCHES=( |
80 |
+ "${FILESDIR}/${PV}-build-fix-configure-disable-dtd-validation.patch" |
81 |
+ "${FILESDIR}/${PV}-scanner-avoid-executable-stack.patch" |
82 |
+) |
83 |
|
84 |
multilib_src_configure() { |
85 |
local myeconfargs=( |