Re: [PATCH v3] random: handle archrandom with multiple longs

2022-08-01 Thread Harald Freudenberger
On 2022-07-19 15:02, Jason A. Donenfeld wrote: The archrandom interface was originally designed for x86, which supplies RDRAND/RDSEED for receiving random words into registers, resulting in one function to generate an int and another to generate a long. However, other architectures don't

Re: [PATCH v3] random: handle archrandom with multiple longs

2022-07-25 Thread Borislav Petkov
On Tue, Jul 19, 2022 at 03:02:07PM +0200, Jason A. Donenfeld wrote: > The archrandom interface was originally designed for x86, which supplies > RDRAND/RDSEED for receiving random words into registers, resulting in > one function to generate an int and another to generate a long. However, > other

RE: [PATCH v3] random: handle archrandom with multiple longs

2022-07-25 Thread David Laight
... > More directly, the reason we don't want to error is because the use case > has fallbacks meant to handle errors. The cascade looks like this > (quoting from the other email): > > unsigned long array[whatever]; > for (i = 0; i < ARRAY_SIZE(array);) { > longs =

Re: [PATCH v3] random: handle archrandom with multiple longs

2022-07-25 Thread Borislav Petkov
On Tue, Jul 19, 2022 at 03:02:07PM +0200, Jason A. Donenfeld wrote: > Since callers need to check this return value and loop anyway, each arch > implementation does not bother implementing its own loop to try again to > fill the maximum number of longs. Additionally, all existing callers > pass in

Re: [PATCH v3] random: handle archrandom with multiple longs

2022-07-22 Thread Heiko Carstens
On Tue, Jul 19, 2022 at 03:02:07PM +0200, Jason A. Donenfeld wrote: > The archrandom interface was originally designed for x86, which supplies > RDRAND/RDSEED for receiving random words into registers, resulting in > one function to generate an int and another to generate a long. However, > other