diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-06-08 02:42:50 +0200 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2017-06-20 04:06:28 +0200 |
commit | 51b0817b0d23d51223575eff14629b3602a93cd4 (patch) | |
tree | ff0b22a01ed295f1300e810d0aa915be563319a5 /fs | |
parent | random: add get_random_{bytes,u32,u64,int,long,once}_wait family (diff) | |
download | linux-51b0817b0d23d51223575eff14629b3602a93cd4.tar.xz linux-51b0817b0d23d51223575eff14629b3602a93cd4.zip |
cifs: use get_random_u32 for 32-bit lock random
Using get_random_u32 here is faster, more fitting of the use case, and
just as cryptographically secure. It also has the benefit of providing
better randomness at early boot, which is sometimes when this is used.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Cc: Steve French <sfrench@samba.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/cifsfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 9a1667e0e8d6..fe0c8dcc7dc7 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -1359,7 +1359,7 @@ init_cifs(void) spin_lock_init(&cifs_tcp_ses_lock); spin_lock_init(&GlobalMid_Lock); - get_random_bytes(&cifs_lock_secret, sizeof(cifs_lock_secret)); + cifs_lock_secret = get_random_u32(); if (cifs_max_pending < 2) { cifs_max_pending = 2; |