Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936217AbcJZWLn (ORCPT ); Wed, 26 Oct 2016 18:11:43 -0400 Received: from up.free-electrons.com ([163.172.77.33]:53513 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934612AbcJZWKL (ORCPT ); Wed, 26 Oct 2016 18:10:11 -0400 Date: Tue, 25 Oct 2016 15:26:48 +0200 From: Maxime Ripard To: LABBE Corentin Cc: srinivas.kandagatla@linaro.org, wens@csie.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org Subject: Re: [PATCH] nvmem: sunxi-sid: SID content is not a valid source of randomness Message-ID: <20161025132648.txeo3rw6yz5wutrg@lukather> References: <1477144408-15896-1-git-send-email-clabbe.montjoie@gmail.com> <20161024201020.h6akyqad2o42xkhq@lukather> <20161025053855.GA901@Red> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="l2m3ygi2en6ylpof" Content-Disposition: inline In-Reply-To: <20161025053855.GA901@Red> User-Agent: Mutt/1.6.2-neo (2016-08-21) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2698 Lines: 78 --l2m3ygi2en6ylpof Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 25, 2016 at 07:38:55AM +0200, LABBE Corentin wrote: > On Mon, Oct 24, 2016 at 10:10:20PM +0200, Maxime Ripard wrote: > > On Sat, Oct 22, 2016 at 03:53:28PM +0200, Corentin Labbe wrote: > > > Since SID's content is constant over reboot, > >=20 > > That's not true, at least not across all the Allwinner SoCs, and > > especially not on the A10 and A20 that this driver supports. > >=20 >=20 > On my cubieboard2 (A20) > hexdump -C /sys/devices/platform/soc\@01c00000/1c23800.eeprom/sunxi-sid0/= nvmem=20 > 00000000 16 51 66 83 80 48 50 72 56 54 48 48 03 c2 75 72 |.Qf..HPrVTHH= =2E.ur| > 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |............= =2E...| > * > 00000100 16 51 66 83 80 48 50 72 56 54 48 48 03 c2 75 72 |.Qf..HPrVTHH= =2E.ur| > 00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |............= =2E...| > * > 00000200 > cubiedev ~ # reboot > cubiedev ~ # hexdump -C /sys/devices/platform/soc\@01c00000/1c23800.eepro= m/sunxi-sid0/nvmem=20 > 00000000 16 51 66 83 80 48 50 72 56 54 48 48 03 c2 75 72 |.Qf..HPrVTHH= =2E.ur| > 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |............= =2E...| > * > 00000100 16 51 66 83 80 48 50 72 56 54 48 48 03 c2 75 72 |.Qf..HPrVTHH= =2E.ur| > 00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |............= =2E...| > * > 00000200 >=20 > So clearly for me its constant. It's constant across reboots, but not across devices. Each device have a different SID content, therefore it's a relevant source of entropy in the system. Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com --l2m3ygi2en6ylpof Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJYD12YAAoJEBx+YmzsjxAgE6wP/A5VE+Qy9Jt3/C5BMcwtqkk9 oxLNXOJCa3+aMMcpt696REILpxhfZ/b+PzQBv1R/wZ+Yt5gddknp9USgUb8UzV5V /uJpvugHSXGoco7Xf8RbWMs55jCntfMIavIhiiiibtONntm2kW1tzVQ59w68onm5 yqnBBGHK8PE55YKBkNEEMpAMffQNPVX6vFXXUTsMj/6v63rvcI5KRyH4Cv264DTL 7CUOTa/qHHwI7Jn3Bx9jRkmcDvLFzHhmPjFTuq88+VvNnFczYSpwK00TE2NenUVr i4yMJn1vDcd2JbwgWAL9K7jcaHa1n485QrErV56PN7ay+ylnSTJaBPpEV/ZODuVP JNzaBdxfuPKcJYiVlj8qt51Td8nay04bAYIDhBUzACxhky1SBc+nPjDZmQhvM44e SmjG6Azc2jNGMFLN0vmKaBc3A96Q2tEsmGDWciqFaSIT7VknXefarcJKx2aeoNoz l0jgFJde9fFkP9kMuoCeyVdaMPw1uvvsTwVx50uqqnsyuz4lEs4qFpDNMSQw/hPw AvjTiuN5hWm9ErChdyvdVoEG0yI5QrXLTbgIYaq0zekXJlHMaENjV8Jn/GIkacSO 2n7VYyxnfM6Zj3eAlfwB0A+eTDHMbZMjWuExeaLZzpwQ7PdAsgEzC9xxfz8cNIJh JTj/QcNElBQ408JhcGHF =FYUn -----END PGP SIGNATURE----- --l2m3ygi2en6ylpof--