4 ms·
Here is a problem: /dev/random and /dev/urandom have security attributes: ownership and permission. The newly proposed syscall makes no security checks whatsoe
by kazinator 12y ago
Here is a problem:
/dev/random and /dev/urandom have security attributes: ownership and permission. The newly proposed syscall makes no security checks whatsoever to protect the entropy resource: it punches a hole through these perms, effectively.
- syncsynchalt 12y agoWhat's the security case for locking down /dev/random?
- kazinator 12y agoA security case for protecting a source of random bits is that they are important and that cryptographic applications and middleware can malfunction if these bits are not available. A world-readable /dev/random means that anyone can drain out random bits, making them unavailable to these applications. Someone somewhere could be setting up permissions in their Linux-based system based on this type of reasoning. It's a security regression if a character device can be suddenly accessed through a back-channel that ignores permissions.
- seabee 12y agoAFAIK isn't this the kind of thing SELinux can take care of? There needn't be any security regression with this change.
- kzrdude 12y agoand seccomp
- clarry 12y agoIf you don't trust a CSPRNG, then you pretty much might as well turn off all your crypto because you can't trust it. If you can trust a CSPRNG, then you should be able to trust urandom, as long as it's been properly initialized once. It won't drain out. It doesn't run out of bits. One application reading it doesn't make it unavailable for others. The same is true of the syscall.
- seabee 12y ago/dev/random is a CSPRNG with finite output over a fixed time period, so it is susceptible to denial-of-service attacks.
- tptacek 12y agoWhich is why secure software doesn't use /dev/random, and prefers instead urandom.
- binarycrusader 12y agoMaybe on Linux, but as I pointed out somewhere else; this doesn't apply to all *NIXes with a /dev/random or /dev/urandom: https://blogs.oracle.com/darren/entry/solaris_random_number_generation Short version is, on Solaris, you should use /dev/random for long-term keys and other high-value keying material. /dev/urandom should be used for everything else such as less demanding or shorter-term cryptographic uses like short-term session keys, paddings, and challenge strings.
- tptacek 12y agoI have two concerns with this comment: 1. It's not safe to use a weak RNG for session keys or even padding. Cryptosystems often fail catastrophically when their most obscure parameters are weak --- in fact, more exploitable cryptosystem flaws derive from issues like padding and IVs than keys. 2. FIPS 186-2 is a SHA-based DRBG. It doesn't "run out of entropy". What am I missing? The situation on Solaris w/r/t urandom appears to be identical to that of Linux.
- binarycrusader 12y ago1. The Solaris crypto designers / developers believe their rng is is appropriate for short-term session keys and padding. Read the post I linked before as to why the believe that. 2. /dev/random basically only uses bits from entropy sources while /dev/urandom just uses a few bits from /dev/random as a seed. Read the post I linked again. Again, I would reiterate, the situation is somewhat different for Solaris. Usage of /dev/random vs. /dev/urandom is actually considered different.
- maccam94 12y agoI think the concern is that a process could then exhaust all available entropy, and DOS any other processes depending on /dev/random. Currently, a chroot could protect against that.
- X-Istence 12y agoYes, and it is exactly that chroot that is cause for concern and why this system call is being introduced...
- deleted 12y ago[deleted]
- justincormack 12y agoConsuming all the entropy. But its not a good argument. The BSDs manage and Linux has syscall controls.
- gregkh 12y agoAnd take a look at those permissions on your machine and see what they show for you: crw-rw-rw- 1 root root 1, 8 Jul 15 11:27 /dev/random crw-rw-rw- 1 root root 1, 9 Jul 15 11:27 /dev/urandom So, if the default permission is read/write by any user, what limitation should this new syscall add?