]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix crash on glibc __libc_message()
authorNick Mathewson <nickm@torproject.org>
Wed, 11 Feb 2015 14:44:07 +0000 (09:44 -0500)
committerNick Mathewson <nickm@torproject.org>
Wed, 11 Feb 2015 14:46:29 +0000 (09:46 -0500)
__libc_message() tries to open /dev/tty with O_RDWR, but the sandbox
catches that and calls it a crash.  Instead, I'm making the sandbox
setenv LIBC_FATAL_STDERR_, so that glibc uses stderr instead.

Fix for 14759, bugfix on 0.2.5.1-alpha

changes/bug14759 [new file with mode: 0644]
src/common/sandbox.c

diff --git a/changes/bug14759 b/changes/bug14759
new file mode 100644 (file)
index 0000000..82fe97c
--- /dev/null
@@ -0,0 +1,6 @@
+  o Minor bugfixes (sandbox):
+    - Allow Glibc fatal errors to be sent to stderr before Tor exits.
+      Previously, glibc would try to write them to /dev/tty, and the sandbox
+      would trap the call and make Tor exit prematurely. Fixes bug 14759;
+      bugfix on 0.2.5.1-alpha.
+
index 450b04a6f763afddeef3637ee8e9edae7bf4e0d1..57847e1376b2de3e991267e105448d4ac393c1fa 100644 (file)
@@ -1676,6 +1676,9 @@ register_cfg(sandbox_cfg_t* cfg)
 static int
 initialise_libseccomp_sandbox(sandbox_cfg_t* cfg)
 {
+  /* Prevent glibc from trying to open /dev/tty on fatal error */
+  setenv("LIBC_FATAL_STDERR_", "1", 1);
+
   if (install_sigsys_debugging())
     return -1;