From owner-svn-src-all@FreeBSD.ORG Wed Apr 1 11:52:10 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06F43C6C; Wed, 1 Apr 2015 11:52:10 +0000 (UTC) Received: from mail-wg0-x229.google.com (mail-wg0-x229.google.com [IPv6:2a00:1450:400c:c00::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A68D74; Wed, 1 Apr 2015 11:52:09 +0000 (UTC) Received: by wgoe14 with SMTP id e14so50245891wgo.0; Wed, 01 Apr 2015 04:52:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=1dPHohWOscLPNWN3lODbJH5DiKYWxFHykDZmLMC0KJc=; b=NxMMURXWddENNIi8DAIrhW6a8BPCbh2m6Qzz5tcq5+yu/csf1aI13TUAiJ7pBIsLVc W60wq4i+1tAbdLowH2M9ULxbS+s5l5rNbTodDKOIxvP3L/guyQpiBUdo2uUwz1+9gT1Y 65yKKznqdcIw5VgHjhyTWa4vic52GAEHCmWV8hICqnnPGv7rQ81xhN+5Rzf/p594z+Q1 pXH5J7qfnuP1ooA2Iak9ngNIKKTK0xdjtg58m2qM5hzZlUe9yAJ8Z0WWvPqDFgpGYEjv gL6ozeubFU43BzUYSf3tBcdqlfW7BCbcQIBs6NprfbAnfZ7WgI5OBFvsax11oW9XHK3s feZA== X-Received: by 10.180.7.196 with SMTP id l4mr14117744wia.44.1427889127830; Wed, 01 Apr 2015 04:52:07 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id gt4sm2813498wib.21.2015.04.01.04.52.06 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 01 Apr 2015 04:52:07 -0700 (PDT) Date: Wed, 1 Apr 2015 13:52:04 +0200 From: Mateusz Guzik To: Gleb Smirnoff Subject: Re: svn commit: r280955 - in head/sys: modules/notrandom dev/notrandom Message-ID: <20150401115204.GB16649@dft-labs.eu> References: <20150401113628.GA16649@dft-labs.eu> <20150401114313.GZ64665@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150401114313.GZ64665@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2015 11:52:10 -0000 On Wed, Apr 01, 2015 at 02:43:13PM +0300, Gleb Smirnoff wrote: > On Wed, Apr 01, 2015 at 01:36:28PM +0200, Mateusz Guzik wrote: > M> Author: mjg > M> Date: Wed Apr 1 13:37:00 2015 > M> New Revision: 280955 > M> URL: https://svnweb.freebsd.org/changeset/base/280955 > M> > M> Log: > M> Add /dev/notrandom > M> > M> notrandom provides fast and reliable not random numbers. > M> > M> This was added in an effort to increase feature-compatiblity with > M> Solaris 10. > M> > M> See http://www.brendangregg.com/Specials/notrandom.c for Solaris > M> implementation. > M> > M> Reviewed-by: Bruce Schneier (ok, not really) > M> MFC after: 1 week > > What is the difference of this implementation with /dev/zero? > /dev/zero returns 0s, while notrandom was implemented to return 7s. We could e.g. symlink /dev/notrandom to /dev/zero, but that would break compatiblity with Solaris apps depending on this functionality. It could also introduce hard-to-debug problems. After all, readers get a different value than they expect. Given that we have some parts of Solaris merged (zfs, dtrace) and work with open source forks on these technologies, I think we should diverge only when necessary. As a side note I'm surprised with the choice of 7. I would expect 3, no more, no less. 3 would be the number returned, and the number readers receive would be 3. -- Mateusz Guzik