[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wja26UmHQCu48n_HN5t5w3fa6ocm5d_VrJe6-RhCU_x9A@mail.gmail.com>
Date: Wed, 20 Sep 2023 11:48:26 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Eric Biggers <ebiggers@...nel.org>
Cc: "Jason A. Donenfeld" <Jason@...c4.com>,
linux-kernel@...r.kernel.org, linux-crypto@...r.kernel.org,
"Theodore Ts'o" <tytso@....edu>,
Dominik Brodowski <linux@...inikbrodowski.net>,
Jann Horn <jannh@...gle.com>
Subject: Re: [RFC] Should writes to /dev/urandom immediately affect reads?
On Tue, 19 Sept 2023 at 23:06, Eric Biggers <ebiggers@...nel.org> wrote:
>
> This would be the potential change, BTW:
Entirely regardless of your fundamental question, no, that's not the
potential change.
That causes a crng_reseed() even if the write fails completely and
returns -EFAULT.
So at a *minimum*, I'd expect the patch to be be something like
memzero_explicit(block, sizeof(block));
- return ret ? ret : -EFAULT;
+ if (!ret)
+ return -EFAULT;
+ crng_reseed(NULL);
+ return ret;
but even then I'd ask
- wouldn't we want some kind of minimum check?
- do we really trust writes to add any actual entropy at all and at what point?
which are admittedly likely the same question just in different guises.
Also, are there any relevant architectures where
"try_to_generate_entropy()" doesn't work? IOW, why do you even care?
Linus
Powered by blists - more mailing lists