diff options
author | 2014-06-18 02:59:13 +0000 | |
---|---|---|
committer | 2014-06-18 02:59:13 +0000 | |
commit | c9c60a3421412028b23a397b09ad500e01634259 (patch) | |
tree | 9e5f81e7437cb85ba73bb84037361661311fc4c6 /usr.bin/ssh/sandbox-systrace.c | |
parent | Implement the membar(9) API for hppa. (diff) | |
download | wireguard-openbsd-c9c60a3421412028b23a397b09ad500e01634259.tar.xz wireguard-openbsd-c9c60a3421412028b23a397b09ad500e01634259.zip |
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 'usr.bin/ssh/sandbox-systrace.c')
-rw-r--r-- | usr.bin/ssh/sandbox-systrace.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/ssh/sandbox-systrace.c b/usr.bin/ssh/sandbox-systrace.c index bf57ff277eb..f05c601161a 100644 --- a/usr.bin/ssh/sandbox-systrace.c +++ b/usr.bin/ssh/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> * @@ -48,11 +48,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 }, |