Re: short read from /dev/urandom

From: H. Peter Anvin
Date: Fri Jan 14 2005 - 21:37:04 EST


Followup to: <41E833F4.8090800@xxxxxxxxxx>
By author: Ulrich Drepper <drepper@xxxxxxxxxx>
In newsgroup: linux.dev.kernel
>
> The code in question comes from a crypto library which is in wide use
> (http://www.cryptopp.com) and it is using urandom under this assumption.
> I fear there is quite a bit more code like this out there. Changing
> the ABI after the fact is no good and dangerous in this case.
>
> I know this is making the device special, but I really think the
> no-short-reads property should be perserved for urandom.
>

Does *anything* have it, including files?

I think read() always has the option of returning a short read on
signal delivery.

What urandom has is a no-block guarantee, i.e. the behaviour should be
identical in the presense of the O_NONBLOCK flag, and select/poll
should always indicate that data can be read.

-hpa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/