Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Sep 2012 11:49:49 +0200
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        RW <rwmaillists@googlemail.com>
Cc:        freebsd-security@freebsd.org
Subject:   Re: Collecting entropy from device_attach() times.
Message-ID:  <863923pzgi.fsf@ds4.des.no>
In-Reply-To: <20120919192836.3a60cdfd@gumby.homeunix.com> (RW's message of "Wed, 19 Sep 2012 19:28:36 %2B0100")
References:  <20120918211422.GA1400@garage.freebsd.pl> <20120919192836.3a60cdfd@gumby.homeunix.com>

next in thread | previous in thread | raw e-mail | index | archive | help
RW <rwmaillists@googlemail.com> writes:
> "Dag-Erling Sm=C3=B8rgrav" <des@des.no> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?863923pzgi.fsf>