> > Hello tech@, > > > > Here is a minor diff to do a little more strict checking on the device id > > for > > urandom. It would be a shame if someone replaced a genuine urandom with a > > /dev/null or some other predictable device. > > that's what the ioctl is for
Actually, the ioctl does not do actually gaurantee that. Some other type of device driver could respond to #define RNDGETENTCNT _IOR( 'R', 0x00, int ) Somewhat like in the BSD's, ioctl's are encoded in a fashion that makes their numbers not strictly exclusive to a specific driver. While there is some attempt to keep these unique, there is no gaurantee in the drivers. I've not checked specifically, why would I.. it is the Linux kernel. Here is a writeup which seems to explain the situation. It's old, but probably still correct. http://www.mjmwired.net/kernel/Documentation/ioctl-number.txt