Re: lustre: why does cfs_get_random_bytes() exist?

2013-10-05 Thread Dilger, Andreas
On 2013/10/03 5:45 PM, Theodore Ts'o ty...@mit.edu wrote: On Thu, Oct 03, 2013 at 11:06:58PM +, Dilger, Andreas wrote: The Lustre cfs_get_random_bytes() incorporates (via cfs_rand()) a seed which also hashes in the addresses from any network interfaces that are configured. Conversely,

Re: lustre: why does cfs_get_random_bytes() exist?

2013-10-05 Thread Christoph Hellwig
On Sat, Oct 05, 2013 at 10:21:21AM -0400, Theodore Ts'o wrote: add_device_randomness() is called from __dev_open() and dev_set_mac_address() in net/core/dev.c. This is above the ethernet and infiniband level. So as long as it looks like a Linux network device, and they are setting the

Re: lustre: why does cfs_get_random_bytes() exist?

2013-10-03 Thread Greg KH
On Thu, Oct 03, 2013 at 12:39:08PM -0400, Theodore Ts'o wrote: I've been auditing uses of get_random_bytes() since there are places where get_random_bytes() is getting used where something weaker, such as prandom_u32() is quite sufficient. Basically, if kernel code just needs a random number

Re: lustre: why does cfs_get_random_bytes() exist?

2013-10-03 Thread Theodore Ts'o
On Thu, Oct 03, 2013 at 10:26:21AM -0700, Greg KH wrote: Does this sound reasonable? Sounds reasonable to me, care to send a patch to do so? I can do that, but I was waiting for Andras, Peng or Nikita to let me now if there was something I was missing or not. I'm pretty sure it's

Re: lustre: why does cfs_get_random_bytes() exist?

2013-10-03 Thread Theodore Ts'o
On Thu, Oct 03, 2013 at 11:06:58PM +, Dilger, Andreas wrote: The Lustre cfs_get_random_bytes() incorporates (via cfs_rand()) a seed which also hashes in the addresses from any network interfaces that are configured. Conversely, cfs_rand() also is seeded at startup from