aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Thomsen <oss@cogitri.dev>2020-09-03 18:09:17 +0200
committerAriadne Conill <ariadne@dereferenced.org>2020-09-03 15:38:01 -0600
commitb602ab703e11942e10986bfd236307198c6a97f1 (patch)
tree416e0581fff99a07409c523fe0c5becda0e212e1
parent9f0c2c144a17e79f28b4f6544401d399dc77c0f8 (diff)
downloadaports-b602ab703e11942e10986bfd236307198c6a97f1.tar.gz
aports-b602ab703e11942e10986bfd236307198c6a97f1.tar.bz2
aports-b602ab703e11942e10986bfd236307198c6a97f1.tar.xz
main/dbus: fix deadlock
This avoids calling opendir() which mallocs, and as such isn't async-signal safe, which can lead to deadlocks if called between fork() and exec()
-rw-r--r--main/dbus/APKBUILD4
-rw-r--r--main/dbus/avoid-opendir-between-fork-exec.patch18
2 files changed, 21 insertions, 1 deletions
diff --git a/main/dbus/APKBUILD b/main/dbus/APKBUILD
index 6aa3dc86ad..c938624b40 100644
--- a/main/dbus/APKBUILD
+++ b/main/dbus/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=dbus
pkgver=1.12.20
-pkgrel=0
+pkgrel=1
pkgdesc="Freedesktop.org message bus system"
options="!check" # Introduces circular dependency with xorg-server (xvfb-run -> xvfb)
url="https://www.freedesktop.org/Software/dbus"
@@ -23,6 +23,7 @@ checkdepends="xvfb-run"
install="$pkgname.pre-install $pkgname.post-install"
source="https://dbus.freedesktop.org/releases/dbus/dbus-$pkgver.tar.gz
0001-_dbus_generate_random_bytes-use-getrandom-2.patch
+ avoid-opendir-between-fork-exec.patch
$pkgname.initd
"
@@ -88,4 +89,5 @@ x11() {
sha512sums="0964683bc6859374cc94e42e1ec0cdb542cca67971c205fcba4352500b6c0891665b0718e7d85eb060c81cb82e3346c313892bc02384da300ddd306c7eef0056 dbus-1.12.20.tar.gz
3db35499361e84d8e2469b88b033f49813b179188ac25f1841a989988c352af398a56dfd94383813626c6dfd032194f7a9fcdba001ccc3e005e7cd22dae7a7ed 0001-_dbus_generate_random_bytes-use-getrandom-2.patch
+cdd01f51882be4f388515441237aa6318888db6e88a4d980bafbf9b790945e4d959c6633d6d002274c0a617ac919f9355ba628c9b502b355f73fed602f997791 avoid-opendir-between-fork-exec.patch
4c6beba2382416e60a3adfa85ef843d90d93ca5f38c23f573e058ffca6d4fc3850d11d40938c74383bba61599569b7fdfb1fcf3b9d2f1463e6b2e2cc81097c84 dbus.initd"
diff --git a/main/dbus/avoid-opendir-between-fork-exec.patch b/main/dbus/avoid-opendir-between-fork-exec.patch
new file mode 100644
index 0000000000..44b03fbd5b
--- /dev/null
+++ b/main/dbus/avoid-opendir-between-fork-exec.patch
@@ -0,0 +1,18 @@
+Author: Rasmus Thomsen <oss@cogitri.dev>
+Upstream: No
+Reason: The code inside the `#ifdef __linux__` calls opendir. This can
+lead to deadlocks when act_on_fds_3_and_up is called between fork&exec since
+opendir mallocs which isn't async signal safe
+diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
+index 0288dbc9..e585136f 100644
+--- a/dbus/dbus-sysdeps-unix.c
++++ b/dbus/dbus-sysdeps-unix.c
+@@ -4742,7 +4742,7 @@ act_on_fds_3_and_up (void (*func) (int fd))
+ {
+ int maxfds, i;
+
+-#ifdef __linux__
++#if defined(__linux__) && defined(__GLIBC__)
+ DIR *d;
+
+ /* On Linux we can optimize this a bit if /proc is available. If it