summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2014-07-02 12:47:48 +1000
committerDamien Miller <djm@mindrot.org>2014-07-02 12:47:48 +1000
commit84a89161a9629239b64171ef3e22ef6a3e462d51 (patch)
treeb2d4e810d05a4ee77db25e2989d88b660fa684d4
parent51504ceec627c0ad57b9f75585c7b3d277f326be (diff)
- matthew@cvs.openbsd.org 2014/06/18 02:59:13
[sandbox-systrace.c] Now that we have a dedicated getentropy(2) system call for arc4random(3), we can disallow __sysctl(2) in OpenSSH's systrace sandbox. ok djm
-rw-r--r--ChangeLog7
-rw-r--r--sandbox-systrace.c10
2 files changed, 15 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 50e549ec..99e59c1e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,13 @@
[sandbox-systrace.c]
permit SYS_getentropy
from matthew
+ - matthew@cvs.openbsd.org 2014/06/18 02:59:13
+ [sandbox-systrace.c]
+ Now that we have a dedicated getentropy(2) system call for
+ arc4random(3), we can disallow __sysctl(2) in OpenSSH's systrace
+ sandbox.
+
+ ok djm
20140618
- (tim) [openssh/session.c] Work around to get chroot sftp working on UnixWare
diff --git a/sandbox-systrace.c b/sandbox-systrace.c
index c48f621f..41cf489c 100644
--- a/sandbox-systrace.c
+++ b/sandbox-systrace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sandbox-systrace.c,v 1.10 2014/06/13 08:26:29 deraadt Exp $ */
+/* $OpenBSD: sandbox-systrace.c,v 1.11 2014/06/18 02:59:13 matthew Exp $ */
/*
* Copyright (c) 2011 Damien Miller <djm@mindrot.org>
*
@@ -52,11 +52,17 @@ struct sandbox_policy {
static const struct sandbox_policy preauth_policy[] = {
{ SYS_open, SYSTR_POLICY_NEVER },
+#ifdef SYS_getentropy
+ /* OpenBSD 5.6 and newer use getentropy(2) to seed arc4random(3). */
+ { SYS_getentropy, SYSTR_POLICY_PERMIT },
+#else
+ /* Previous releases used sysctl(3)'s kern.arnd variable. */
{ SYS___sysctl, SYSTR_POLICY_PERMIT },
+#endif
+
{ SYS_close, SYSTR_POLICY_PERMIT },
{ SYS_exit, SYSTR_POLICY_PERMIT },
{ SYS_getpid, SYSTR_POLICY_PERMIT },
- { SYS_getentropy, SYSTR_POLICY_PERMIT },
{ SYS_gettimeofday, SYSTR_POLICY_PERMIT },
{ SYS_clock_gettime, SYSTR_POLICY_PERMIT },
{ SYS_madvise, SYSTR_POLICY_PERMIT },