Re: [PATCH] random: add blocking facility to urandom

Jarod Wilson
2011-09-12T14:07:11Z

Ted Ts'o wrote:
> On Wed, Sep 07, 2011 at 02:26:35PM -0400, Jarod Wilson wrote:
>> We're looking for a generic solution here that doesn't require
>> re-educating every single piece of userspace. And anything done in
>> userspace is going to be full of possible holes -- there needs to be
>> something in place that actually *enforces* the policy, and
>> centralized accounting/tracking, lest you wind up with multiple
>> processes racing to grab the entropy.
>
> Yeah, but there are userspace programs that depend on urandom not
> blocking... so your proposed change would break them.

I'm already consigned to the fact this isn't going to fly, but I'm still
curious to know examples of programs that are going to break here, for
my own education. Its already possible for urandom reads to fail as the
code is now (-ERESTARTSYS and -EFAULT are possible), so a sane program
ought to already be handling error cases, though not -EAGAIN, which this
would add.

--
Jarod Wilson
jarod@redhat.com