On Mon, Jul 25, 2022 at 01:10:38PM +0200, Jason A. Donenfeld wrote:
> Borislav pointed out during the review of "random: handle archrandom
> with multiple longs" that people might actually use this function, which
> might not be good because the function has surprising semantics. This of
> course was also the case before that patch, and indeed RDSEED-like
> functions across architectures often behave surprisingly, failing often.
> While random.c has been written specifically to work with that behavior,
> not much else is well equipped for that.
>
> So add a comment suggesting that this is not for general consumption.
> Fortunately, nobody uses this for general consumption anyway, and people
> who try quickly find themselves in trouble. But adding this comment out
> of an abundance of caution was nonetheless suggested, and it at least
> means there will be easier justification for cleaning up potential
> misuses of the function later.
>
> Cc: Borislav Petkov <[email protected]>
> Cc: Heiko Carstens <[email protected]>
> Cc: Catalin Marinas <[email protected]>
> Cc: Mark Rutland <[email protected]>
> Cc: Michael Ellerman <[email protected]>
> Cc: Johannes Berg <[email protected]>
> Suggested-by: Borislav Petkov <[email protected]>
> Signed-off-by: Jason A. Donenfeld <[email protected]>
> ---
> arch/arm64/include/asm/archrandom.h | 13 +++++++++++++
> arch/powerpc/include/asm/archrandom.h | 8 ++++++++
> arch/s390/include/asm/archrandom.h | 8 ++++++++
> arch/um/include/asm/archrandom.h | 8 ++++++++
> arch/x86/include/asm/archrandom.h | 9 ++++++---
> include/asm-generic/archrandom.h | 8 ++++++++
> 6 files changed, 51 insertions(+), 3 deletions(-)
Acked-by: Borislav Petkov <[email protected]>
Thx.
--
Regards/Gruss,
Boris.
SUSE Software Solutions Germany GmbH
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Martje Boudien Moerman
(HRB 36809, AG Nürnberg)