diff options
author | Damien Miller <djm@mindrot.org> | 2014-07-02 04:47:48 +0200 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2014-07-02 04:47:48 +0200 |
commit | 84a89161a9629239b64171ef3e22ef6a3e462d51 (patch) | |
tree | b2d4e810d05a4ee77db25e2989d88b660fa684d4 /sandbox-systrace.c | |
parent | - deraadt@cvs.openbsd.org 2014/06/13 08:26:29 (diff) | |
download | openssh-84a89161a9629239b64171ef3e22ef6a3e462d51.tar.xz openssh-84a89161a9629239b64171ef3e22ef6a3e462d51.zip |
- 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
Diffstat (limited to 'sandbox-systrace.c')
-rw-r--r-- | sandbox-systrace.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sandbox-systrace.c b/sandbox-systrace.c index c48f621f7..41cf489c5 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 }, |