From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751598AbdHON0h (ORCPT ); Tue, 15 Aug 2017 09:26:37 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:35494 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750997AbdHON0g (ORCPT ); Tue, 15 Aug 2017 09:26:36 -0400 Date: Tue, 15 Aug 2017 15:26:24 +0200 From: Willy Tarreau To: "Theodore Ts'o" , Ingo Molnar , Borislav Petkov , Linus Torvalds , x86-ml , "Jason A. Donenfeld" , lkml Subject: Re: early x86 unseeded randomness Message-ID: <20170815132624.GA2688@1wt.eu> References: <20170814180048.m3igiaiunlyb5wur@pd.tnic> <20170814190013.zixopgjyq26ukxcj@pd.tnic> <20170815013124.2afytkibspxrikdn@thunk.org> <20170815064437.GA1986@1wt.eu> <20170815074254.6byayhspc5tdtjb5@gmail.com> <20170815080128.GA2288@1wt.eu> <20170815080546.xhfdpwqqgjk2qdvu@gmail.com> <20170815120950.etl7wbxurziazi5o@thunk.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170815120950.etl7wbxurziazi5o@thunk.org> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 15, 2017 at 08:09:50AM -0400, Theodore Ts'o wrote: > On Tue, Aug 15, 2017 at 10:05:46AM +0200, Ingo Molnar wrote: > > > > * Willy Tarreau wrote: > > > > > > > > > > Nowadays we could use similar methods using RDTSC providing more accurate > > > > > counting. This doesn't provide a lot of entropy of course, given that a > > > > > 2 GHz machine will at most count 31 bits there. But I tend to think that > > > > > what matters during early boot is to transform something highly predictable > > > > > into something unlikely to be predicted (ie: an exploit having to scan 2^31 > > > > > possible addresses will not be really usable). It's also possible to do the > > > > > same with the PIT0 counter ticking at 18.2 Hz without any correlation with > > > > > the RTC by the way, and roughly provide 25 more bits.... > > All of this assumes that you have different clock crystals generating > all of these different clock sources. Otherwise there can be a lot > less entropy than you expected. That's what's cool with the RTC, it definitely runs on its own 32kHz crystal since it continues to beat when everything else is powered off. Willy