From 84a89161a9629239b64171ef3e22ef6a3e462d51 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 2 Jul 2014 12:47:48 +1000 Subject: - 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 --- sandbox-systrace.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'sandbox-systrace.c') 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 * @@ -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 }, -- cgit v1.2.3