Messages in this thread | | | From | "Jason A. Donenfeld" <> | Date | Tue, 27 Sep 2022 16:53:56 +0200 | Subject | Re: [PATCH v2] utsname: contribute changes to RNG |
| |
On Tue, Sep 27, 2022 at 4:25 PM Kees Cook <keescook@chromium.org> wrote:> > + add_device_randomness(tmp_data, sizeof(tmp_data)); > > Does this matter that we're dumping the same same trailing bytes into > the RNG? (i.e. only min(lenp, table->maxlen) has changed.) > > If that's okay (and maybe a comment should be added): > > Reviewed-by: Kees Cook <keescook@chromium.org>
It doesn't matter. You can call add_device_randomness() as often as you want on whatever data you want, and it is never bad.
I mentioned in my Linux Plumbers talk that I'd like to see various subsystems add whatever they can find, provided it's not a performance bottleneck. add_device_randomness() is good for things that /could/ be random, but might not be. Right after my talk, somebody posted this, which I was happy to see: https://lore.kernel.org/all/20220915004117.1562703-2-bryan.odonoghue@linaro.org/
There's also this commit from a few months ago that I was quite happy about: https://lore.kernel.org/all/20220425205442.1347837-1-linus.walleij@linaro.org/
This one here is part of that same general trend. If you have more ideas on odd drivers or hooks or whatever else where that might be useful, feel free to submit patches.
Jason
| |