lkml.org 
[lkml]   [2022]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] mips: allow firmware to pass RNG seed to kernel
Hi Philippe,

On Tue, Oct 4, 2022 at 12:07 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> > + add_bootloader_randomness(rng_seed, len);
>
> So we call char/random code with len=0. Is it safe?
> Maybe simply safer to check len before calling hex2bin?

add_bootloader_randomness() is safe for all input sizes, and is
written to be callable with len=0 and have no effect. So this function
should be good as-is; there's no need to special case an unlikely
instance that's already handled by add_bootloader_randomness().

Jason

\
 
 \ /
  Last update: 2022-10-04 00:31    [W:0.059 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site