aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAric Belsito <lluixhi@gmail.com>2017-01-02 19:44:15 -0800
committerAric Belsito <lluixhi@gmail.com>2017-01-02 19:44:15 -0800
commit452eefef5920e30cda5b6dfb394fba26dabd3064 (patch)
treeca59aff50cba7afb75ebbd4491231bc7b9454ab5 /sys-apps
parentapp-emulation/qemu: Version bump to 2.8.0 (diff)
downloadmusl-452eefef5920e30cda5b6dfb394fba26dabd3064.tar.gz
musl-452eefef5920e30cda5b6dfb394fba26dabd3064.tar.bz2
musl-452eefef5920e30cda5b6dfb394fba26dabd3064.zip
sys-apps/sandbox: Add fix-opendir patch
Bump to 2.10-r3 and 2.10-r4 to match tree
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/sandbox/Manifest5
-rw-r--r--sys-apps/sandbox/files/sandbox-2.10-fix-opendir.patch79
-rw-r--r--sys-apps/sandbox/sandbox-2.10-r3.ebuild (renamed from sys-apps/sandbox/sandbox-2.10-r2.ebuild)1
-rw-r--r--sys-apps/sandbox/sandbox-2.11-r4.ebuild (renamed from sys-apps/sandbox/sandbox-2.11-r3.ebuild)4
4 files changed, 84 insertions, 5 deletions
diff --git a/sys-apps/sandbox/Manifest b/sys-apps/sandbox/Manifest
index d8d86d1e..8cd4f181 100644
--- a/sys-apps/sandbox/Manifest
+++ b/sys-apps/sandbox/Manifest
@@ -1,5 +1,6 @@
AUX 09sandbox 37 SHA256 73e9e9d12ba54f1c649813ec86107924050528852c890a8ba1e2853796781bbe SHA512 4e8a9c58debde6480224a45559c5f2db4765213d151e47937f9142f110cac3681bf6402acaf21249a37bb17398e7bc00ae7feee68ecdb5b9363c432eac1b052a WHIRLPOOL 80d55a34d3faf3314f2b9de2200d4b46a800128514be9e30eb59e5f03fb7a0a5197a9e5b5ab33d6b68d35bf83c86a1bd7ba734a33ccd382fe0af3b2c2a11d0bd
AUX sandbox-2.10-disable-same.patch 2547 SHA256 09a11cf077ae69684080d1f0fd8fe83683fdf5f061e0a7a5261ca03463fd554a SHA512 bf005fbde7b6ba88df36bb75064658764e488dd2f3c96a6f92c69ad3f2e8d2db12ba2c7bafa9656326b7fde73301c330f68bd064efa0fce2a7eb28fff6ce0a1e WHIRLPOOL 27f0df961dcedc70819ecd1d0f105fb7176ecd77127ab187025d9aa52df9faa43941314c71a998dd72658105dfec4c5c6d3341dbae18e18b409af7dc6d9c31d6
+AUX sandbox-2.10-fix-opendir.patch 3311 SHA256 33e31a0331d75985e6fb254001d657988fbe7d0ff2f79128316530636391c76d SHA512 5c0650d6838b8171a87409ebd8565a90a42603874893708c2cdee5b50535e637f145fa2e51142db857c35a9bc11713b45b7e50c31f96f9ecd6ba342ce8d87928 WHIRLPOOL fbac85063c77b26af76761f0d377fac7c7a54e1f465fe0247b7ed90b98e077b75697ce127fa6c509fd28ff6af8313d7d65a0f34ecd969a6143af8b7246687602
AUX sandbox-2.10-fix-visibility-musl.patch 573 SHA256 67f70fa39867eeeee45b343db78c73fdb6e63b8a1b52d3dc288894402239dd12 SHA512 a740e0b1a68c0609dc3080e88ab8ab87885fe05f5e0864d10ed76e8e7000f7879cb206342c38d4097c691a7c85d1936e98802b206084eb2af9f78bd43158d759 WHIRLPOOL 0c226daa4b6d36c2df001d3d67b9e4023944c5b010d1bc311d731c121dd94b533546479a7b1b77bcb8be608ecf70508fb7dd65b22bafdb2d13a2860c9c0659da
AUX sandbox-2.10-memory-corruption.patch 1515 SHA256 4876cc9962d56d3c5fc5418fe12ef1a399e34ff0272f12640c4a5c5b775e8888 SHA512 1eb650824cc7a876fabef382cafb451a507326a8422fb7bb5014699046b64ea8f4cf2bba9efcb75d7a2eac4eff493d06153422f85c119f49635ac0840071660c WHIRLPOOL db2c834119c7887ed746154e73e88cc09bf2a31184b3cda2732b70cb43dd8bc7f59f1072a4cc56ebcf593ba67330b9888832dc186ee55e009428d607f62293ab
AUX sandbox-2.11-exec-hash.patch 4310 SHA256 e9dbdab6b1db8cbe547aa94057fce55bc6a5e59cf4bfc0b607cf35123a20b981 SHA512 8830c0a4a9c81a61ae7f749d690791a0d9f467d28872976681a1a7995e7f703d06928bd7e392d2042da5452979c39e28783f73803419d782c3ace4e949adbd70 WHIRLPOOL 053e584c1675d43ffc98d25aa5d6f897b635fb3fdb3c036287d6a4a9f9ac36ad871890390003efe87c2177e2d077f428461eb59eb880c6df7f302f1c12218a75
@@ -10,6 +11,6 @@ AUX sandbox-2.6-musl.patch 1821 SHA256 df08faebffbfade91a2620ff8b56c2087e4a34506
DIST sandbox-2.10.tar.xz 417068 SHA256 019d6a2646b3a5f9b6fc3fcb6ff99332901017eb845442bec8573b9901506fa6 SHA512 178b3b8fcb54e6ff67df1c8101866739b49e4d31a66717c21ef502dd2ab609fca70f1a0c662b913e207bfc1ba6994cefdcf5c92ff32add9dd98bd9707f301305 WHIRLPOOL 5d6cffa7317cafeba02af75de9ae914d4365a62b54d3dfcc14cb272e621f2f76a60a945591ccb57dd59d6750152087cb2f21e43ded3ec181d6b42df173147192
DIST sandbox-2.11.tar.xz 423492 SHA256 a1cb203f95057176ca0c5b53b8b9dafd41d1b64a6cf5039a9e1fb4a51b17f237 SHA512 0aa6c773c109749180442d1a46d1b957dea0c30f893e4be1ac0b410e1aad48fdd2972ec591aa2da3a0c74b32d2b7bd51b7c2263bd7b26f8a34bb762d8a48ea0b WHIRLPOOL a2222cc778f2181473cf23b46a62257e5f3857edebb457dcf230f02da0d153e38a28f78a20dee67c9e564c10239d8bd6982a6e894de666f6eff4550f7ad8cdee
EBUILD sandbox-2.10-r1.ebuild 2977 SHA256 2b308bd2634a1a30e8438d41e141aee5119d0ae23b493bbb092f76c471af0d81 SHA512 15e3f29bf3397201410f7f364346efaa6d3d75350ab1ff2dabdb246dde71ee8c5ceeef1e9e4c3913d64808eb8783aceead74a92c2f182f793b57d90c1b183e6f WHIRLPOOL 8f95e1726ddd28343850da33f4ca98216ea1e03f574c9d808903015ea9f82023b2b6e655106e17786dac8c0b74c3e33346c28638644dc71fdaacf5f6481414c1
-EBUILD sandbox-2.10-r2.ebuild 2224 SHA256 83e19b123c97ef30bb04950ed682bcd05848024b7d986a94e96f1a58fdaf3949 SHA512 731819a7e32447b38c2a883f96e9f66970ce86888b5cbbd810a0cc33cd7ad6048d025e0b8613f54b215051e8b534144da63c3bbbeea96932000a5143daf8bb03 WHIRLPOOL e18e41c8a054d3cbd08ee7515b48f9f8cebc202128480bcbe39cc80a165f2d1ad0846bdee88d6481e5d455b72945102db84cea5416265863f6906e2efd86eae6
-EBUILD sandbox-2.11-r3.ebuild 2292 SHA256 8ceb8d79bb6e2b09c3ce7f70e53c55eb0dca614f220399299d8ac823d43a80e8 SHA512 ccfdc9e646fdd63eaa3b86db12c68ccd9d7aa17e578bd48d94349fc05c1477ac16aa2b3a9734d7c7baf3239244ed1dd6d2ca8065cb40e39d4963a52ef38425eb WHIRLPOOL 53557346089dc2cae94acf67ed5cbb05ad2ff696983e01ae3e814447912f4475194f3b0f2a603abc7ebe8087d8e3013443b9f1e35b5c36254d4b9ad7991cd0cf
+EBUILD sandbox-2.10-r3.ebuild 2277 SHA256 5bdaf6b3ab6f9662737a0c85499505cfd47ce73062d2266d396992f76f3e56c4 SHA512 39b5d77eddcaf96e5449b68df23208473bf72661f6a839fdb79c30665a62ca01e3b31de38c71ae59f14addbea3158b201f68231d70c1913d8c6c4427eea25ef8 WHIRLPOOL ad83a6df2749c4ff2da8008e689d18dcaec90ff33bd7daf7d8ee3cdbdc49344fd7b105a666f8d70967518503490f9a1c1403373860a9350e5cffd607af47939d
+EBUILD sandbox-2.11-r4.ebuild 2333 SHA256 09b213dc0465790033254ff8de391d429f87d6f56686752c082099e2d3aa8bf9 SHA512 7ac3f0557fc88617a429e730436b8dfb1ed130d811fac3e340a4d09404851f58bbb740348bc2f8b78306286731f59e9ebb89ed550d6d1efa013d0f1010ef4946 WHIRLPOOL 6c5d22cec6cad1f92cadab73b9a901fb2ab465c4a33deff4ce89eedc6f5915f1107893d0841d4cbd85e80ee907dfa07914c70abac3f98159baa593668d8e83e7
MISC metadata.xml 331 SHA256 593acb3cb5d82507c93a39cc745aebf1aa453683a039ff7d7f9d12ad9ed042a4 SHA512 f112b562f8b2a1022c0f4eac7a0e55369046d1d7d6052ab1514d841c968fc8cb33e9c337326db23a5944f3f43a676d4743dec4413ddd6e7f5c6cf63c82969675 WHIRLPOOL 0e306bda54e820ed6883b47ea0e305c5a361a88047b8f6ccd1ba621e1ef7bec08809019e638949e05e892e3d3eeffe48568b6e31e1db8071ca9932b0ea2d9f2e
diff --git a/sys-apps/sandbox/files/sandbox-2.10-fix-opendir.patch b/sys-apps/sandbox/files/sandbox-2.10-fix-opendir.patch
new file mode 100644
index 00000000..2ff89bcd
--- /dev/null
+++ b/sys-apps/sandbox/files/sandbox-2.10-fix-opendir.patch
@@ -0,0 +1,79 @@
+From 3f668dc6ba1910085e61b3a24167ab1352c60d92 Mon Sep 17 00:00:00 2001
+From: Mart Raudsepp <leio@gentoo.org>
+Date: Fri, 11 Nov 2016 12:34:48 +0200
+Subject: [PATCH] libsandbox: do not abort with a long name to opendir
+
+Add a pre-check for opendir that catches too long name arguments
+given to opendir, as it would get messed up and abort before it
+even gets to the open*() syscall (which would handle it correctly),
+due to opendir going through before_syscall/check_syscall, even
+though it isn't a true syscall and it getting cut to SB_PATH_MAX
+inbetween and getting confused somewhere.
+
+URL: https://bugs.gentoo.org/553092
+Signed-off-by: Mart Raudsepp <leio@gentoo.org>
+---
+ libsandbox/wrapper-funcs/opendir.c | 2 ++
+ libsandbox/wrapper-funcs/opendir_pre_check.c | 26 ++++++++++++++++++++++++++
+ libsandbox/wrappers.h | 1 +
+ 3 files changed, 29 insertions(+)
+ create mode 100644 libsandbox/wrapper-funcs/opendir_pre_check.c
+
+diff --git a/libsandbox/wrapper-funcs/opendir.c b/libsandbox/wrapper-funcs/opendir.c
+index 7670775..70c2692 100644
+--- a/libsandbox/wrapper-funcs/opendir.c
++++ b/libsandbox/wrapper-funcs/opendir.c
+@@ -10,4 +10,6 @@
+ #define WRAPPER_SAFE() SB_SAFE(name)
+ #define WRAPPER_RET_TYPE DIR *
+ #define WRAPPER_RET_DEFAULT NULL
++#define WRAPPER_PRE_CHECKS() sb_opendir_pre_check(STRING_NAME, name)
++
+ #include "__wrapper_simple.c"
+diff --git a/libsandbox/wrapper-funcs/opendir_pre_check.c b/libsandbox/wrapper-funcs/opendir_pre_check.c
+new file mode 100644
+index 0000000..60c869f
+--- /dev/null
++++ b/libsandbox/wrapper-funcs/opendir_pre_check.c
+@@ -0,0 +1,26 @@
++/*
++ * opendir() pre-check.
++ *
++ * Copyright 1999-2016 Gentoo Foundation
++ * Licensed under the GPL-2
++ */
++
++bool sb_opendir_pre_check(const char *func, const char *name)
++{
++ /* If length of name is larger than PATH_MAX, we would mess it up
++ * before it reaches the open syscall, which would cleanly error out
++ * via sandbox as well (actually with much smaller lengths than even
++ * PATH_MAX).
++ * So error out early in this case, in order to avoid an abort in
++ * check_syscall later on, which gets ran for opendir, despite it not
++ * being a syscall.
++ */
++ if (strnlen(name, PATH_MAX) == PATH_MAX) {
++ errno = ENAMETOOLONG;
++ sb_debug_dyn("EARLY FAIL: %s(%s): %s\n",
++ func, name, strerror(errno));
++ return false;
++ }
++
++ return true;
++}
+diff --git a/libsandbox/wrappers.h b/libsandbox/wrappers.h
+index 0aa58bb..bf5bf64 100644
+--- a/libsandbox/wrappers.h
++++ b/libsandbox/wrappers.h
+@@ -27,6 +27,7 @@ attribute_hidden bool sb_fopen64_pre_check (const char *func, const char *pathn
+ attribute_hidden bool sb_mkdirat_pre_check (const char *func, const char *pathname, int dirfd);
+ attribute_hidden bool sb_openat_pre_check (const char *func, const char *pathname, int dirfd, int flags);
+ attribute_hidden bool sb_openat64_pre_check (const char *func, const char *pathname, int dirfd, int flags);
++attribute_hidden bool sb_opendir_pre_check (const char *func, const char *name);
+ attribute_hidden bool sb_unlinkat_pre_check (const char *func, const char *pathname, int dirfd);
+ attribute_hidden bool sb_common_at_pre_check(const char *func, const char **pathname, int dirfd,
+ char *dirfd_path, size_t dirfd_path_len);
+--
+2.9.0
+
diff --git a/sys-apps/sandbox/sandbox-2.10-r2.ebuild b/sys-apps/sandbox/sandbox-2.10-r3.ebuild
index 35f8b8cc..1a9b3f0f 100644
--- a/sys-apps/sandbox/sandbox-2.10-r2.ebuild
+++ b/sys-apps/sandbox/sandbox-2.10-r3.ebuild
@@ -34,6 +34,7 @@ sandbox_death_notice() {
src_prepare() {
epatch "${FILESDIR}"/${P}-memory-corruption.patch #568714
epatch "${FILESDIR}"/${P}-disable-same.patch
+ epatch "${FILESDIR}"/${P}-fix-opendir.patch #553092
epatch "${FILESDIR}"/${PN}-2.6-musl.patch
epatch "${FILESDIR}"/${P}-fix-visibility-musl.patch
epatch_user
diff --git a/sys-apps/sandbox/sandbox-2.11-r3.ebuild b/sys-apps/sandbox/sandbox-2.11-r4.ebuild
index b903c194..e370c3aa 100644
--- a/sys-apps/sandbox/sandbox-2.11-r3.ebuild
+++ b/sys-apps/sandbox/sandbox-2.11-r4.ebuild
@@ -35,11 +35,9 @@ src_prepare() {
epatch "${FILESDIR}"/${P}-execvpe.patch #578516
epatch "${FILESDIR}"/${P}-exec-hash.patch #578524
epatch "${FILESDIR}"/${P}-exec-prelink.patch #599894
-
- # Fix for MUSL
+ epatch "${FILESDIR}"/${PN}-2.10-fix-opendir.patch #553092
epatch "${FILESDIR}"/${P}-musl.patch
epatch "${FILESDIR}"/${PN}-2.10-fix-visibility-musl.patch
-
epatch_user
}