Skip to content

Commit dd54fd7

Browse files
committed
random: use init_utsname() instead of utsname()
Rather than going through the current-> indirection for utsname, at this point in boot, init_utsname()==utsname(), so just use it directly that way. Additionally, init_utsname() appears to be available nearly always, so move it into random_init_early(). Suggested-by: Kees Cook <[email protected]> Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Jason A. Donenfeld <[email protected]>
1 parent 08475da commit dd54fd7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/char/random.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,7 @@ void __init random_init_early(const char *command_line)
802802
++i;
803803
}
804804

805+
_mix_pool_bytes(init_utsname(), sizeof(*(init_utsname())));
805806
_mix_pool_bytes(command_line, strlen(command_line));
806807

807808
/* Reseed if already seeded by earlier phases. */
@@ -820,7 +821,6 @@ void __init random_init(void)
820821
unsigned long entropy = random_get_entropy();
821822
ktime_t now = ktime_get_real();
822823

823-
_mix_pool_bytes(utsname(), sizeof(*(utsname())));
824824
_mix_pool_bytes(&now, sizeof(now));
825825
_mix_pool_bytes(&entropy, sizeof(entropy));
826826
add_latent_entropy();

0 commit comments

Comments
 (0)