]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
- (djm) [configure.ac sandbox-capsicum.c sandbox-rlimit.c] Disable
authorDamien Miller <djm@mindrot.org>
Sat, 25 Jan 2014 22:39:53 +0000 (09:39 +1100)
committerDamien Miller <djm@mindrot.org>
Sat, 25 Jan 2014 22:39:53 +0000 (09:39 +1100)
    RLIMIT_NOFILE pseudo-sandbox on FreeBSD. In some configurations,
    libc will attempt to open additional file descriptors for crypto
    offload and crash if they cannot be opened.

ChangeLog
configure.ac
sandbox-capsicum.c
sandbox-rlimit.c

index 384c0712c325939e4517944ab6a8e24726168157..6b965261a70d85306bd3f38962b22257991108c9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
      [kex.c]
      dh_need needs to be set to max(seclen, blocksize, ivlen, mac_len)
      ok dtucker@, noted by mancha
+  - (djm) [configure.ac sandbox-capsicum.c sandbox-rlimit.c] Disable
+    RLIMIT_NOFILE pseudo-sandbox on FreeBSD. In some configurations,
+    libc will attempt to open additional file descriptors for crypto
+    offload and crash if they cannot be opened.
 
 20130125
  - (djm) [configure.ac] Fix detection of capsicum sandbox on FreeBSD
index 5e5e4d135370bad5b92bca9524f088591f35b768..4a398418a52b31f25d05ee1f99fc43210207b326 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: configure.ac,v 1.562 2014/01/25 02:16:59 djm Exp $
+# $Id: configure.ac,v 1.563 2014/01/25 22:39:53 djm Exp $
 #
 # Copyright (c) 1999-2004 Damien Miller
 #
@@ -15,7 +15,7 @@
 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org])
-AC_REVISION($Revision: 1.562 $)
+AC_REVISION($Revision: 1.563 $)
 AC_CONFIG_SRCDIR([ssh.c])
 AC_LANG([C])
 
@@ -780,6 +780,9 @@ mips-sony-bsd|mips-sony-newsos4)
        AC_DEFINE([BROKEN_STRNVIS], [1],
            [FreeBSD strnvis argument order is swapped compared to OpenBSD])
        TEST_MALLOC_OPTIONS="AJRX"
+       # Preauth crypto occasionally uses file descriptors for crypto offload
+       # and will crash if they cannot be opened.
+       AC_DEFINE([SANDBOX_SKIP_RLIMIT_NOFILE])
        ;;
 *-*-bsdi*)
        AC_DEFINE([SETEUID_BREAKS_SETUID])
index f648c6ece3a6a3a6c24ace46d3e36410f7f4c750..ee2a7e79eafa5a6db58dfd72070cf4608760f95f 100644 (file)
@@ -75,9 +75,11 @@ ssh_sandbox_child(struct ssh_sandbox *box)
        if (setrlimit(RLIMIT_FSIZE, &rl_zero) == -1)
                fatal("%s: setrlimit(RLIMIT_FSIZE, { 0, 0 }): %s",
                        __func__, strerror(errno));
+#ifndef SANDBOX_SKIP_RLIMIT_NOFILE
        if (setrlimit(RLIMIT_NOFILE, &rl_zero) == -1)
                fatal("%s: setrlimit(RLIMIT_NOFILE, { 0, 0 }): %s",
                        __func__, strerror(errno));
+#endif
        if (setrlimit(RLIMIT_NPROC, &rl_zero) == -1)
                fatal("%s: setrlimit(RLIMIT_NPROC, { 0, 0 }): %s",
                        __func__, strerror(errno));
index da91eb1b9215e2f741e2e9c179cebcea01d447d0..bba80778b1a16d10eeeb453d4b2f3ea7d12323f3 100644 (file)
@@ -69,9 +69,11 @@ ssh_sandbox_child(struct ssh_sandbox *box)
                fatal("%s: setrlimit(RLIMIT_FSIZE, { 0, 0 }): %s",
                        __func__, strerror(errno));
 #endif
+#ifndef SANDBOX_SKIP_RLIMIT_NOFILE
        if (setrlimit(RLIMIT_NOFILE, &rl_zero) == -1)
                fatal("%s: setrlimit(RLIMIT_NOFILE, { 0, 0 }): %s",
                        __func__, strerror(errno));
+#endif
 #ifdef HAVE_RLIMIT_NPROC
        if (setrlimit(RLIMIT_NPROC, &rl_zero) == -1)
                fatal("%s: setrlimit(RLIMIT_NPROC, { 0, 0 }): %s",