mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@linux.intel.com>
To: Denys Vlasenko <vda.linux@googlemail.com>,
	"Theodore Ts'o" <tytso@mit.edu>,
	Denys Vlasenko <dvlasenk@redhat.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: random: /dev/random often returns short reads
Date: Thu, 19 Jan 2017 19:17:41 -0800	[thread overview]
Message-ID: <0754295f-b10d-21ce-5767-937d1cd79090@linux.intel.com> (raw)
In-Reply-To: <CAK1hOcPrkLM4H0FZNpgFE66n2Eb4vxD6iST+OrzOvkmPoydV7w@mail.gmail.com>

On 01/19/17 13:45, Denys Vlasenko wrote:
> On Wed, Jan 18, 2017 at 7:07 PM, Theodore Ts'o <tytso@mit.edu> wrote:
>> In the ideal world, yes.  I've acknowledged this is a bug, in the "be
>> conservative in what you send, liberal in what you receive" sense..
>> But no one complained for three year, and userspace needs to be able
>> to retry short reads instead of immediately erroring out.
>>
>> The problem is changing that code to figure out exactly how many bytes
>> you need to get in order to have N random bytes is non-trivial.  So
>> our choices are:
>>
>> 1) Transfer more bytes than might be needed to the secondary pool,
>> which results in resource stranding --- since entropy in the secondary
>> pool isn't available for reseeding the CRNG.  OTOH, given that we're
>> now using the CRNG solution, and we're only reseeding every five
>> minutes, I'm not actually all that worried about stranding some extra
>> entropy bits in the blocking pool, since that's only going to happen
>> if we have people *using* the /dev/random pool, and so that entropy
>> will likely be used eventually anyway
> ...
> ...
>> I'm leaning a bit towards 1 if we have to do something (which is my
>> proposed, untested patch).
> 
> Thanks, this solution is okay for me.
> 

That seems to make sense to me as well.

	-hpa

  reply	other threads:[~2017-01-20  3:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-16 18:50 Denys Vlasenko
2017-01-16 18:52 ` Denys Vlasenko
2017-01-17  4:36 ` Theodore Ts'o
2017-01-17  8:21   ` Denys Vlasenko
2017-01-17 17:15     ` Theodore Ts'o
2017-01-17 17:34       ` Denys Vlasenko
2017-01-17 22:29         ` H. Peter Anvin
2017-01-17 23:41           ` Theodore Ts'o
2017-01-18  1:54             ` H. Peter Anvin
2017-01-18 15:44           ` Denys Vlasenko
2017-01-18 18:07             ` Theodore Ts'o
2017-01-19 21:45               ` Denys Vlasenko
2017-01-20  3:17                 ` H. Peter Anvin [this message]
2017-02-15 17:55               ` Denys Vlasenko

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=0754295f-b10d-21ce-5767-937d1cd79090@linux.intel.com \
    --to=hpa@linux.intel.com \
    --cc=dvlasenk@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=vda.linux@googlemail.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

all inboxes | Powered by JetHome®