lkml.org 
[lkml]   [2022]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] random: remove get_random_bytes_arch() and add rng_has_arch_random()
On Sat 2022-05-14 13:23:07, Jason A. Donenfeld wrote:
> The RNG incorporates RDRAND into its state at boot and every time it
> reseeds, so there's no reason for callers to use it directly. The
> hashing that the RNG does on it is preferable to using the bytes raw.
>
> The only current use case of it is vsprintf's siphash key for pointer
> hashing, which uses it to initialize the pointer secret earlier than
> usual if RDRAND is available. In order to replace this narrow use case,
> just expose whether RDRAND is available. With that taken care of, there
> are no users of get_random_bytes_arch() left, so the function can be
> removed.
>
> Later if trust_cpu gets turned on by default (as most distros are
> doing), this one use of rng_has_arch_random() can probably go away as
> well.
>
> Cc: Petr Mladek <pmladek@suse.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>

Looks good to me. Thanks for the clean up.

Acked-by: Petr Mladek <pmladek@suse.com> # for vsprintf.c

Best Regards,
Petr

\
 
 \ /
  Last update: 2022-05-17 09:55    [W:0.065 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site