Skip to content

Commit 51b0817

Browse files
zx2c4tytso
authored andcommitted
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 <[email protected]> Cc: Steve French <[email protected]> Signed-off-by: Theodore Ts'o <[email protected]>
1 parent da9ba56 commit 51b0817

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/cifs/cifsfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,7 @@ init_cifs(void)
13591359
spin_lock_init(&cifs_tcp_ses_lock);
13601360
spin_lock_init(&GlobalMid_Lock);
13611361

1362-
get_random_bytes(&cifs_lock_secret, sizeof(cifs_lock_secret));
1362+
cifs_lock_secret = get_random_u32();
13631363

13641364
if (cifs_max_pending < 2) {
13651365
cifs_max_pending = 2;

0 commit comments

Comments
 (0)