From owner-freebsd-security@FreeBSD.ORG Thu Sep 27 09:49:52 2012 Return-Path: Delivered-To: freebsd-security@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7E255106566B for ; Thu, 27 Sep 2012 09:49:52 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 3F2758FC08 for ; Thu, 27 Sep 2012 09:49:52 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 2843D68E1; Thu, 27 Sep 2012 11:49:51 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id E2096837F; Thu, 27 Sep 2012 11:49:50 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: RW References: <20120918211422.GA1400@garage.freebsd.pl> <20120919192836.3a60cdfd@gumby.homeunix.com> Date: Thu, 27 Sep 2012 11:49:49 +0200 In-Reply-To: <20120919192836.3a60cdfd@gumby.homeunix.com> (RW's message of "Wed, 19 Sep 2012 19:28:36 +0100") Message-ID: <863923pzgi.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-security@freebsd.org Subject: Re: Collecting entropy from device_attach() times. X-BeenThere: freebsd-security@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Security issues \[members-only posting\]" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Sep 2012 09:49:52 -0000 RW writes: > "Dag-Erling Sm=C3=B8rgrav" writes: > > You can't rely on the existence of a TSC. I would suggest using the > > fractional part of binuptime instead. > get_cyclecount() is supposed to be platform independent and should > fall-back to nanotime(9) if TSC or equivalent is absent. I just thought of another issue with get_cyclecount(). On machines with TSCs, its resolution varies with the CPU's speed (nominal or actual, depending on the exact model). This means that attachtime measurements have far lower resolution and therefore less entropy on slow machines than on fast ones. This doesn't mean we can't use get_cyclecount(), just that we shouldn't base our entropy estimates on data gathered on a fast system. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no