4 ms·
Is there a patch to make /dev/random behave like /dev/urandom? I've had at least some server software stall blocking on /dev/random, and I already build my own
by aidenn0 11y ago
Is there a patch to make /dev/random behave like /dev/urandom? I've had at least some server software stall blocking on /dev/random, and I already build my own kernels, so incorporating such a patch is easy.
- throwaway2048 11y agoyou could probly edit udev rules to make random be the same device major/minor as urandom
- iso-8859-1 11y agomaybe it is doable with overlayfs?
- mappu 11y agorm /dev/random && mknod -m 444 /dev/random c 1 9
- throwaway2048 11y agothis wont survive reboot, you need udev rules.
- viraptor 11y agoOr run the app in its own namespace with custom /dev.
- robmccoll 11y agomount --bind /dev/urandom /dev/random
- DiabloD3 11y agoThat won't stick across reboots, and at that point, I think you can just rm /dev/random; ln -s /dev/urandom /dev/random.
- mikekchar 11y agoAlthough in most cases it doesn't matter, I wouldn't do this. Remember that the PRNG will only output unpredictable values as long as the initial seed was unpredictable (and unknown). As stated in the article, there is actually one time where you care if you have enough entropy -- the first time you grab a random number. After that the PRNG is seeded with an unknown value and you are fine (assuming you waited until you had enough entropy). Before that, you aren't. BSD's implementation seems sensible -- block the first time and then don't block again. Or potentially block if you haven't reseeded in X amount of time (X being configurable), to defeat the situation where someone figures out your seed. Although, I have a tough time understanding how someone will figure out your seed without completely compromising your system anyway... but systems are supposed to be robust against attacks that one can't immediately imagine ;-)
- aidenn0 11y agoIs there a linux kernel patch to use BSD's implementation then?
- nshepperd 11y agoI use a solution based on udev rules, here: https://superuser.com/questions/309840/how-can-i-point-dev-random-to-dev-urandom https://superuser.com/questions/309840/how-can-i-point-dev-r...
- matheweis 11y agoAn easy hack is to use rngd with /dev/urandom as an "entropy source" (risky if you are going to use /dev/random for anything that REQUIRES true entropy, but otherwise should be safe as the article suggests).