From owner-freebsd-security@FreeBSD.ORG Sat Jul 19 20:17:39 2014 Return-Path: Delivered-To: freebsd-security@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E379461 for ; Sat, 19 Jul 2014 20:17:39 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A78B2AF8 for ; Sat, 19 Jul 2014 20:17:38 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s6JKHaDJ005405 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 19 Jul 2014 13:17:37 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s6JKHawF005404; Sat, 19 Jul 2014 13:17:36 -0700 (PDT) (envelope-from jmg) Date: Sat, 19 Jul 2014 13:17:36 -0700 From: John-Mark Gurney To: Konstantin Belousov Subject: Re: Speed and security of /dev/urandom Message-ID: <20140719201736.GN45513@funkthat.com> Mail-Followup-To: Konstantin Belousov , Steven Chamberlain , freebsd-security@freebsd.org References: <53C85F42.1000704@pyro.eu.org> <20140719190348.GM45513@funkthat.com> <20140719192605.GV93733@kib.kiev.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140719192605.GV93733@kib.kiev.ua> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Sat, 19 Jul 2014 13:17:37 -0700 (PDT) Cc: freebsd-security@freebsd.org, Steven Chamberlain X-BeenThere: freebsd-security@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Security issues \[members-only posting\]" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 20:17:39 -0000 Konstantin Belousov wrote this message on Sat, Jul 19, 2014 at 22:26 +0300: > On Sat, Jul 19, 2014 at 12:03:48PM -0700, John-Mark Gurney wrote: > > So, my suggestions: > > 1) Convert arc4random(9) in the kernel to use the random pool as > > /dev/random uses. I vaguely remeber there being an issue w/ > > arc4random(9) being used early in boot before /dev/random is > > initalized which would complicate this change... > > 2) Convert arc4random(3) to use the sysctl, and if the sysctl fails, > > kill the process. > I think that using sysctl for non-management functionality is wrong. > If this feature is for the libraries and applications, and not for > system management and introspection utilities, it should be normal > syscall. Though in the past we've been discouraged from adding new syscalls, why, I don't know... I'm fine w/ this, though we have had the sysctl for over 7 years.. so, using a sysctl will introduce anoying backward compatibility issues, do you call back to the sysctl when the syscall isn't there? how do you make the new code handle old OS's? We can't remove arc4rand since old apps depend upon it... apprently the sysctl was added for SSP: https://svnweb.freebsd.org/changeset/base/169727 > Being syscall, it also solves the issue of backward-compatibility, > i.e. a new code, running on old kernel, get SIGSYS when using > non-existing syscall. If application is so sophisticated that > it want to handle the situation, it can, by installing a signal > handler. Otherwise, it is terminated automatically. Though broken applications (which there are many), could install SIGSYS and ignore it still.. :) broken apps are broken, not handling an error is broken.. yes it's easier w/ SIGSYS, but not perfect... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."