[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191016104322.GC10184@linux.intel.com>
Date: Wed, 16 Oct 2019 13:43:22 +0300
From: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
To: Jason Gunthorpe <jgg@...pe.ca>
Cc: linux-integrity@...r.kernel.org,
David Safford <david.safford@...com>,
Pascal Van Leeuwen <pvanleeuwen@...imatrix.com>,
James Bottomley <James.Bottomley@...senPartnership.com>,
Peter Huewe <peterhuewe@....de>, Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] tpm: Salt tpm_get_random() result with get_random_bytes()
On Wed, Oct 16, 2019 at 01:38:05PM +0300, Jarkko Sakkinen wrote:
> On Tue, Oct 15, 2019 at 02:04:50PM -0300, Jason Gunthorpe wrote:
> > On Tue, Oct 15, 2019 at 03:47:02PM +0300, Jarkko Sakkinen wrote:
> > > Salt the result that comes from the TPM RNG with random bytes from the
> > > kernel RNG. This will allow to use tpm_get_random() as a substitute for
> > > get_random_bytes(). TPM could have a bug (making results predicatable),
> > > backdoor or even an inteposer in the bus. Salting gives protections
> > > against these concerns.
> >
> > Seems like a dangerous use case, why would any kernel user that cared
> > about quality of randomness ever call a tpm_* API to get quality
> > random data?
>
> This is related to this discussion:
>
> https://lore.kernel.org/linux-integrity/CAE=NcrY3BTvD-L2XP6bsO=9oAJLtSD0wYpUymVkAGAnYObsPzQ@mail.gmail.com/T/#t
>
> I could also move this to the call site.
But I hear you anyway.
I think for trusted keys the best strategy would be to do
exactly this:
1. Generate one random value with get_random_bytes_arch()
2. Generate another with backend specific technology (we
have now two TPM and TEE) if an RNG available.
3. Xor the values together.
/Jarkko
Powered by blists - more mailing lists