1 |
commit: 452eefef5920e30cda5b6dfb394fba26dabd3064 |
2 |
Author: Aric Belsito <lluixhi <AT> gmail <DOT> com> |
3 |
AuthorDate: Tue Jan 3 03:44:15 2017 +0000 |
4 |
Commit: Aric Belsito <lluixhi <AT> gmail <DOT> com> |
5 |
CommitDate: Tue Jan 3 03:44:15 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=452eefef |
7 |
|
8 |
sys-apps/sandbox: Add fix-opendir patch |
9 |
|
10 |
Bump to 2.10-r3 and 2.10-r4 to match tree |
11 |
|
12 |
sys-apps/sandbox/Manifest | 5 +- |
13 |
.../sandbox/files/sandbox-2.10-fix-opendir.patch | 79 ++++++++++++++++++++++ |
14 |
...ndbox-2.10-r2.ebuild => sandbox-2.10-r3.ebuild} | 1 + |
15 |
...ndbox-2.11-r3.ebuild => sandbox-2.11-r4.ebuild} | 4 +- |
16 |
4 files changed, 84 insertions(+), 5 deletions(-) |
17 |
|
18 |
diff --git a/sys-apps/sandbox/Manifest b/sys-apps/sandbox/Manifest |
19 |
index d8d86d1..8cd4f18 100644 |
20 |
--- a/sys-apps/sandbox/Manifest |
21 |
+++ b/sys-apps/sandbox/Manifest |
22 |
@@ -1,5 +1,6 @@ |
23 |
AUX 09sandbox 37 SHA256 73e9e9d12ba54f1c649813ec86107924050528852c890a8ba1e2853796781bbe SHA512 4e8a9c58debde6480224a45559c5f2db4765213d151e47937f9142f110cac3681bf6402acaf21249a37bb17398e7bc00ae7feee68ecdb5b9363c432eac1b052a WHIRLPOOL 80d55a34d3faf3314f2b9de2200d4b46a800128514be9e30eb59e5f03fb7a0a5197a9e5b5ab33d6b68d35bf83c86a1bd7ba734a33ccd382fe0af3b2c2a11d0bd |
24 |
AUX sandbox-2.10-disable-same.patch 2547 SHA256 09a11cf077ae69684080d1f0fd8fe83683fdf5f061e0a7a5261ca03463fd554a SHA512 bf005fbde7b6ba88df36bb75064658764e488dd2f3c96a6f92c69ad3f2e8d2db12ba2c7bafa9656326b7fde73301c330f68bd064efa0fce2a7eb28fff6ce0a1e WHIRLPOOL 27f0df961dcedc70819ecd1d0f105fb7176ecd77127ab187025d9aa52df9faa43941314c71a998dd72658105dfec4c5c6d3341dbae18e18b409af7dc6d9c31d6 |
25 |
+AUX sandbox-2.10-fix-opendir.patch 3311 SHA256 33e31a0331d75985e6fb254001d657988fbe7d0ff2f79128316530636391c76d SHA512 5c0650d6838b8171a87409ebd8565a90a42603874893708c2cdee5b50535e637f145fa2e51142db857c35a9bc11713b45b7e50c31f96f9ecd6ba342ce8d87928 WHIRLPOOL fbac85063c77b26af76761f0d377fac7c7a54e1f465fe0247b7ed90b98e077b75697ce127fa6c509fd28ff6af8313d7d65a0f34ecd969a6143af8b7246687602 |
26 |
AUX sandbox-2.10-fix-visibility-musl.patch 573 SHA256 67f70fa39867eeeee45b343db78c73fdb6e63b8a1b52d3dc288894402239dd12 SHA512 a740e0b1a68c0609dc3080e88ab8ab87885fe05f5e0864d10ed76e8e7000f7879cb206342c38d4097c691a7c85d1936e98802b206084eb2af9f78bd43158d759 WHIRLPOOL 0c226daa4b6d36c2df001d3d67b9e4023944c5b010d1bc311d731c121dd94b533546479a7b1b77bcb8be608ecf70508fb7dd65b22bafdb2d13a2860c9c0659da |
27 |
AUX sandbox-2.10-memory-corruption.patch 1515 SHA256 4876cc9962d56d3c5fc5418fe12ef1a399e34ff0272f12640c4a5c5b775e8888 SHA512 1eb650824cc7a876fabef382cafb451a507326a8422fb7bb5014699046b64ea8f4cf2bba9efcb75d7a2eac4eff493d06153422f85c119f49635ac0840071660c WHIRLPOOL db2c834119c7887ed746154e73e88cc09bf2a31184b3cda2732b70cb43dd8bc7f59f1072a4cc56ebcf593ba67330b9888832dc186ee55e009428d607f62293ab |
28 |
AUX sandbox-2.11-exec-hash.patch 4310 SHA256 e9dbdab6b1db8cbe547aa94057fce55bc6a5e59cf4bfc0b607cf35123a20b981 SHA512 8830c0a4a9c81a61ae7f749d690791a0d9f467d28872976681a1a7995e7f703d06928bd7e392d2042da5452979c39e28783f73803419d782c3ace4e949adbd70 WHIRLPOOL 053e584c1675d43ffc98d25aa5d6f897b635fb3fdb3c036287d6a4a9f9ac36ad871890390003efe87c2177e2d077f428461eb59eb880c6df7f302f1c12218a75 |
29 |
@@ -10,6 +11,6 @@ AUX sandbox-2.6-musl.patch 1821 SHA256 df08faebffbfade91a2620ff8b56c2087e4a34506 |
30 |
DIST sandbox-2.10.tar.xz 417068 SHA256 019d6a2646b3a5f9b6fc3fcb6ff99332901017eb845442bec8573b9901506fa6 SHA512 178b3b8fcb54e6ff67df1c8101866739b49e4d31a66717c21ef502dd2ab609fca70f1a0c662b913e207bfc1ba6994cefdcf5c92ff32add9dd98bd9707f301305 WHIRLPOOL 5d6cffa7317cafeba02af75de9ae914d4365a62b54d3dfcc14cb272e621f2f76a60a945591ccb57dd59d6750152087cb2f21e43ded3ec181d6b42df173147192 |
31 |
DIST sandbox-2.11.tar.xz 423492 SHA256 a1cb203f95057176ca0c5b53b8b9dafd41d1b64a6cf5039a9e1fb4a51b17f237 SHA512 0aa6c773c109749180442d1a46d1b957dea0c30f893e4be1ac0b410e1aad48fdd2972ec591aa2da3a0c74b32d2b7bd51b7c2263bd7b26f8a34bb762d8a48ea0b WHIRLPOOL a2222cc778f2181473cf23b46a62257e5f3857edebb457dcf230f02da0d153e38a28f78a20dee67c9e564c10239d8bd6982a6e894de666f6eff4550f7ad8cdee |
32 |
EBUILD sandbox-2.10-r1.ebuild 2977 SHA256 2b308bd2634a1a30e8438d41e141aee5119d0ae23b493bbb092f76c471af0d81 SHA512 15e3f29bf3397201410f7f364346efaa6d3d75350ab1ff2dabdb246dde71ee8c5ceeef1e9e4c3913d64808eb8783aceead74a92c2f182f793b57d90c1b183e6f WHIRLPOOL 8f95e1726ddd28343850da33f4ca98216ea1e03f574c9d808903015ea9f82023b2b6e655106e17786dac8c0b74c3e33346c28638644dc71fdaacf5f6481414c1 |
33 |
-EBUILD sandbox-2.10-r2.ebuild 2224 SHA256 83e19b123c97ef30bb04950ed682bcd05848024b7d986a94e96f1a58fdaf3949 SHA512 731819a7e32447b38c2a883f96e9f66970ce86888b5cbbd810a0cc33cd7ad6048d025e0b8613f54b215051e8b534144da63c3bbbeea96932000a5143daf8bb03 WHIRLPOOL e18e41c8a054d3cbd08ee7515b48f9f8cebc202128480bcbe39cc80a165f2d1ad0846bdee88d6481e5d455b72945102db84cea5416265863f6906e2efd86eae6 |
34 |
-EBUILD sandbox-2.11-r3.ebuild 2292 SHA256 8ceb8d79bb6e2b09c3ce7f70e53c55eb0dca614f220399299d8ac823d43a80e8 SHA512 ccfdc9e646fdd63eaa3b86db12c68ccd9d7aa17e578bd48d94349fc05c1477ac16aa2b3a9734d7c7baf3239244ed1dd6d2ca8065cb40e39d4963a52ef38425eb WHIRLPOOL 53557346089dc2cae94acf67ed5cbb05ad2ff696983e01ae3e814447912f4475194f3b0f2a603abc7ebe8087d8e3013443b9f1e35b5c36254d4b9ad7991cd0cf |
35 |
+EBUILD sandbox-2.10-r3.ebuild 2277 SHA256 5bdaf6b3ab6f9662737a0c85499505cfd47ce73062d2266d396992f76f3e56c4 SHA512 39b5d77eddcaf96e5449b68df23208473bf72661f6a839fdb79c30665a62ca01e3b31de38c71ae59f14addbea3158b201f68231d70c1913d8c6c4427eea25ef8 WHIRLPOOL ad83a6df2749c4ff2da8008e689d18dcaec90ff33bd7daf7d8ee3cdbdc49344fd7b105a666f8d70967518503490f9a1c1403373860a9350e5cffd607af47939d |
36 |
+EBUILD sandbox-2.11-r4.ebuild 2333 SHA256 09b213dc0465790033254ff8de391d429f87d6f56686752c082099e2d3aa8bf9 SHA512 7ac3f0557fc88617a429e730436b8dfb1ed130d811fac3e340a4d09404851f58bbb740348bc2f8b78306286731f59e9ebb89ed550d6d1efa013d0f1010ef4946 WHIRLPOOL 6c5d22cec6cad1f92cadab73b9a901fb2ab465c4a33deff4ce89eedc6f5915f1107893d0841d4cbd85e80ee907dfa07914c70abac3f98159baa593668d8e83e7 |
37 |
MISC metadata.xml 331 SHA256 593acb3cb5d82507c93a39cc745aebf1aa453683a039ff7d7f9d12ad9ed042a4 SHA512 f112b562f8b2a1022c0f4eac7a0e55369046d1d7d6052ab1514d841c968fc8cb33e9c337326db23a5944f3f43a676d4743dec4413ddd6e7f5c6cf63c82969675 WHIRLPOOL 0e306bda54e820ed6883b47ea0e305c5a361a88047b8f6ccd1ba621e1ef7bec08809019e638949e05e892e3d3eeffe48568b6e31e1db8071ca9932b0ea2d9f2e |
38 |
|
39 |
diff --git a/sys-apps/sandbox/files/sandbox-2.10-fix-opendir.patch b/sys-apps/sandbox/files/sandbox-2.10-fix-opendir.patch |
40 |
new file mode 100644 |
41 |
index 0000000..2ff89bc |
42 |
--- /dev/null |
43 |
+++ b/sys-apps/sandbox/files/sandbox-2.10-fix-opendir.patch |
44 |
@@ -0,0 +1,79 @@ |
45 |
+From 3f668dc6ba1910085e61b3a24167ab1352c60d92 Mon Sep 17 00:00:00 2001 |
46 |
+From: Mart Raudsepp <leio@g.o> |
47 |
+Date: Fri, 11 Nov 2016 12:34:48 +0200 |
48 |
+Subject: [PATCH] libsandbox: do not abort with a long name to opendir |
49 |
+ |
50 |
+Add a pre-check for opendir that catches too long name arguments |
51 |
+given to opendir, as it would get messed up and abort before it |
52 |
+even gets to the open*() syscall (which would handle it correctly), |
53 |
+due to opendir going through before_syscall/check_syscall, even |
54 |
+though it isn't a true syscall and it getting cut to SB_PATH_MAX |
55 |
+inbetween and getting confused somewhere. |
56 |
+ |
57 |
+URL: https://bugs.gentoo.org/553092 |
58 |
+Signed-off-by: Mart Raudsepp <leio@g.o> |
59 |
+--- |
60 |
+ libsandbox/wrapper-funcs/opendir.c | 2 ++ |
61 |
+ libsandbox/wrapper-funcs/opendir_pre_check.c | 26 ++++++++++++++++++++++++++ |
62 |
+ libsandbox/wrappers.h | 1 + |
63 |
+ 3 files changed, 29 insertions(+) |
64 |
+ create mode 100644 libsandbox/wrapper-funcs/opendir_pre_check.c |
65 |
+ |
66 |
+diff --git a/libsandbox/wrapper-funcs/opendir.c b/libsandbox/wrapper-funcs/opendir.c |
67 |
+index 7670775..70c2692 100644 |
68 |
+--- a/libsandbox/wrapper-funcs/opendir.c |
69 |
++++ b/libsandbox/wrapper-funcs/opendir.c |
70 |
+@@ -10,4 +10,6 @@ |
71 |
+ #define WRAPPER_SAFE() SB_SAFE(name) |
72 |
+ #define WRAPPER_RET_TYPE DIR * |
73 |
+ #define WRAPPER_RET_DEFAULT NULL |
74 |
++#define WRAPPER_PRE_CHECKS() sb_opendir_pre_check(STRING_NAME, name) |
75 |
++ |
76 |
+ #include "__wrapper_simple.c" |
77 |
+diff --git a/libsandbox/wrapper-funcs/opendir_pre_check.c b/libsandbox/wrapper-funcs/opendir_pre_check.c |
78 |
+new file mode 100644 |
79 |
+index 0000000..60c869f |
80 |
+--- /dev/null |
81 |
++++ b/libsandbox/wrapper-funcs/opendir_pre_check.c |
82 |
+@@ -0,0 +1,26 @@ |
83 |
++/* |
84 |
++ * opendir() pre-check. |
85 |
++ * |
86 |
++ * Copyright 1999-2016 Gentoo Foundation |
87 |
++ * Licensed under the GPL-2 |
88 |
++ */ |
89 |
++ |
90 |
++bool sb_opendir_pre_check(const char *func, const char *name) |
91 |
++{ |
92 |
++ /* If length of name is larger than PATH_MAX, we would mess it up |
93 |
++ * before it reaches the open syscall, which would cleanly error out |
94 |
++ * via sandbox as well (actually with much smaller lengths than even |
95 |
++ * PATH_MAX). |
96 |
++ * So error out early in this case, in order to avoid an abort in |
97 |
++ * check_syscall later on, which gets ran for opendir, despite it not |
98 |
++ * being a syscall. |
99 |
++ */ |
100 |
++ if (strnlen(name, PATH_MAX) == PATH_MAX) { |
101 |
++ errno = ENAMETOOLONG; |
102 |
++ sb_debug_dyn("EARLY FAIL: %s(%s): %s\n", |
103 |
++ func, name, strerror(errno)); |
104 |
++ return false; |
105 |
++ } |
106 |
++ |
107 |
++ return true; |
108 |
++} |
109 |
+diff --git a/libsandbox/wrappers.h b/libsandbox/wrappers.h |
110 |
+index 0aa58bb..bf5bf64 100644 |
111 |
+--- a/libsandbox/wrappers.h |
112 |
++++ b/libsandbox/wrappers.h |
113 |
+@@ -27,6 +27,7 @@ attribute_hidden bool sb_fopen64_pre_check (const char *func, const char *pathn |
114 |
+ attribute_hidden bool sb_mkdirat_pre_check (const char *func, const char *pathname, int dirfd); |
115 |
+ attribute_hidden bool sb_openat_pre_check (const char *func, const char *pathname, int dirfd, int flags); |
116 |
+ attribute_hidden bool sb_openat64_pre_check (const char *func, const char *pathname, int dirfd, int flags); |
117 |
++attribute_hidden bool sb_opendir_pre_check (const char *func, const char *name); |
118 |
+ attribute_hidden bool sb_unlinkat_pre_check (const char *func, const char *pathname, int dirfd); |
119 |
+ attribute_hidden bool sb_common_at_pre_check(const char *func, const char **pathname, int dirfd, |
120 |
+ char *dirfd_path, size_t dirfd_path_len); |
121 |
+-- |
122 |
+2.9.0 |
123 |
+ |
124 |
|
125 |
diff --git a/sys-apps/sandbox/sandbox-2.10-r2.ebuild b/sys-apps/sandbox/sandbox-2.10-r3.ebuild |
126 |
similarity index 97% |
127 |
rename from sys-apps/sandbox/sandbox-2.10-r2.ebuild |
128 |
rename to sys-apps/sandbox/sandbox-2.10-r3.ebuild |
129 |
index 35f8b8c..1a9b3f0 100644 |
130 |
--- a/sys-apps/sandbox/sandbox-2.10-r2.ebuild |
131 |
+++ b/sys-apps/sandbox/sandbox-2.10-r3.ebuild |
132 |
@@ -34,6 +34,7 @@ sandbox_death_notice() { |
133 |
src_prepare() { |
134 |
epatch "${FILESDIR}"/${P}-memory-corruption.patch #568714 |
135 |
epatch "${FILESDIR}"/${P}-disable-same.patch |
136 |
+ epatch "${FILESDIR}"/${P}-fix-opendir.patch #553092 |
137 |
epatch "${FILESDIR}"/${PN}-2.6-musl.patch |
138 |
epatch "${FILESDIR}"/${P}-fix-visibility-musl.patch |
139 |
epatch_user |
140 |
|
141 |
diff --git a/sys-apps/sandbox/sandbox-2.11-r3.ebuild b/sys-apps/sandbox/sandbox-2.11-r4.ebuild |
142 |
similarity index 97% |
143 |
rename from sys-apps/sandbox/sandbox-2.11-r3.ebuild |
144 |
rename to sys-apps/sandbox/sandbox-2.11-r4.ebuild |
145 |
index b903c19..e370c3a 100644 |
146 |
--- a/sys-apps/sandbox/sandbox-2.11-r3.ebuild |
147 |
+++ b/sys-apps/sandbox/sandbox-2.11-r4.ebuild |
148 |
@@ -35,11 +35,9 @@ src_prepare() { |
149 |
epatch "${FILESDIR}"/${P}-execvpe.patch #578516 |
150 |
epatch "${FILESDIR}"/${P}-exec-hash.patch #578524 |
151 |
epatch "${FILESDIR}"/${P}-exec-prelink.patch #599894 |
152 |
- |
153 |
- # Fix for MUSL |
154 |
+ epatch "${FILESDIR}"/${PN}-2.10-fix-opendir.patch #553092 |
155 |
epatch "${FILESDIR}"/${P}-musl.patch |
156 |
epatch "${FILESDIR}"/${PN}-2.10-fix-visibility-musl.patch |
157 |
- |
158 |
epatch_user |
159 |
} |