aboutsummaryrefslogtreecommitdiff
path: root/src/common/sandbox.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-02-11 09:44:07 -0500
committerNick Mathewson <nickm@torproject.org>2015-02-11 09:46:29 -0500
commitf5f6d13e4cc0d8e823888694bb2c3415d80690ab (patch)
tree61e8449c06d010ab1ee5f9e442fdcab086c5446c /src/common/sandbox.c
parent0c81dfa848da160b02818771626a425cd27b86bc (diff)
downloadtor-f5f6d13e4cc0d8e823888694bb2c3415d80690ab.tar.gz
tor-f5f6d13e4cc0d8e823888694bb2c3415d80690ab.zip
Fix crash on glibc __libc_message()
__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
Diffstat (limited to 'src/common/sandbox.c')
-rw-r--r--src/common/sandbox.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/common/sandbox.c b/src/common/sandbox.c
index 450b04a6f7..57847e1376 100644
--- a/src/common/sandbox.c
+++ b/src/common/sandbox.c
@@ -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;