From: Jason Gunthorpe <jgg@ziepe.ca>
To: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: linux-integrity@vger.kernel.org,
David Safford <david.safford@ge.com>,
Pascal Van Leeuwen <pvanleeuwen@verimatrix.com>,
James Bottomley <James.Bottomley@HansenPartnership.com>,
Peter Huewe <peterhuewe@gmx.de>, Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tpm: Salt tpm_get_random() result with get_random_bytes()
Date: Wed, 16 Oct 2019 13:09:08 -0300 [thread overview]
Message-ID: <20191016160908.GA3637@ziepe.ca> (raw)
In-Reply-To: <20191016104322.GC10184@linux.intel.com>
On Wed, Oct 16, 2019 at 01:43:22PM +0300, Jarkko Sakkinen wrote:
> 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.
Feels like something the random core should handle - maybe some way to
say 'my trust model requires trust in this RNG' and then the random
core can more heavily weight data from that RNG
Jason
next prev parent reply other threads:[~2019-10-16 16:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-15 12:47 [PATCH] tpm: Salt tpm_get_random() result with get_random_bytes() Jarkko Sakkinen
2019-10-15 17:04 ` Jason Gunthorpe
2019-10-16 10:38 ` Jarkko Sakkinen
2019-10-16 10:43 ` Jarkko Sakkinen
2019-10-16 16:09 ` Jason Gunthorpe [this message]
2019-10-17 16:21 ` Jarkko Sakkinen
2019-10-16 7:02 ` Janne Karhunen
2019-10-16 10:41 ` Jarkko Sakkinen
2019-10-16 11:16 ` Janne Karhunen
2019-10-16 16:23 ` Jarkko Sakkinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191016160908.GA3637@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=James.Bottomley@HansenPartnership.com \
--cc=arnd@arndb.de \
--cc=david.safford@ge.com \
--cc=gregkh@linuxfoundation.org \
--cc=jarkko.sakkinen@linux.intel.com \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterhuewe@gmx.de \
--cc=pvanleeuwen@verimatrix.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).