public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Andy Lutomirski <luto@amacapital.net>
Cc: kvm@vger.kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org, Kees Cook <keescook@chromium.org>,
	x86@kernel.org, Daniel Borkmann <dborkman@redhat.com>,
	Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>,
	Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>,
	Gleb Natapov <gleb@kernel.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	bsd@redhat.com, Andrew Honig <ahonig@google.com>
Subject: Re: [PATCH v4 2/5] random: Add and use arch_get_rng_seed
Date: Tue, 22 Jul 2014 09:59:15 -0400	[thread overview]
Message-ID: <20140722135915.GB25291@thunk.org> (raw)
In-Reply-To: <9c2a0549519b4eb5eee2d5d480f8e83a574273df.1405620944.git.luto@amacapital.net>

On Thu, Jul 17, 2014 at 11:22:17AM -0700, Andy Lutomirski wrote:
> Currently, init_std_data contains its own logic for using arch
> random sources.  This logic is a bit strange: it reads one long of
> arch random data per byte of internal state.

This isn't true.  Check out the init_std_data() a bit more closely.

	unsigned long rv;

	...

	for (i = r->poolinfo->poolbytes; i > 0; i -= sizeof(rv)) {
	    ...

In particular, note the "i -= sizeof(rv)".  We are reading one bit per
bit of internal state beeing seeded.

> Assuming the arch sources are perfect, this is the right thing to
> do.  They're not, though, so the followup patch attempts to
> implement the correct logic on x86.

... and that's not a problem because we aren't giving any entropy
credit --- and this is deliberate, because we don't want to trust
un-auditable hardware.  We are deliberately trying to be conservative
here.

So I don't think either this patch or the next one is needed.  It adds
far more complexity than is warranted.

Regards,

						- Ted

  reply	other threads:[~2014-07-22 13:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-17 18:22 [PATCH v4 0/5] random,x86,kvm: Rework arch RNG seeds and get some from kvm Andy Lutomirski
2014-07-17 18:22 ` [PATCH v4 1/5] x86,kvm: Add MSR_KVM_GET_RNG_SEED and a matching feature bit Andy Lutomirski
2014-07-17 18:22 ` [PATCH v4 2/5] random: Add and use arch_get_rng_seed Andy Lutomirski
2014-07-22 13:59   ` Theodore Ts'o [this message]
2014-07-22 20:44     ` Andy Lutomirski
2014-07-22 20:57       ` H. Peter Anvin
2014-07-22 21:04         ` Andy Lutomirski
2014-07-22 21:08           ` H. Peter Anvin
2014-07-22 21:10             ` Andy Lutomirski
2014-07-22 21:16               ` H. Peter Anvin
2014-07-17 18:22 ` [PATCH v4 3/5] x86,random: Add an x86 implementation of arch_get_rng_seed Andy Lutomirski
2014-07-17 18:22 ` [PATCH v4 4/5] x86,random,kvm: Use KVM_GET_RNG_SEED in arch_get_rng_seed Andy Lutomirski
2014-07-17 18:22 ` [PATCH v4 5/5] x86,kaslr: Use MSR_KVM_GET_RNG_SEED for KASLR if available Andy Lutomirski
2014-07-17 18:48   ` Kees Cook

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=20140722135915.GB25291@thunk.org \
    --to=tytso@mit.edu \
    --cc=ahonig@google.com \
    --cc=bsd@redhat.com \
    --cc=dborkman@redhat.com \
    --cc=gleb@kernel.org \
    --cc=hpa@zytor.com \
    --cc=keescook@chromium.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=pbonzini@redhat.com \
    --cc=raghavendra.kt@linux.vnet.ibm.com \
    --cc=vatsa@linux.vnet.ibm.com \
    --cc=x86@kernel.org \
    /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