Messages in this thread | | | Date | Sat, 19 Oct 2019 12:13:53 +0200 (CEST) | From | Thomas Gleixner <> | Subject | Re: [PATCH] random: make try_to_generate_entropy() more robust |
| |
On Sat, 19 Oct 2019, Ingo Molnar wrote: > * Linus Torvalds <torvalds@linux-foundation.org> wrote: > > On Fri, Oct 18, 2019 at 4:42 PM Jörn Engel <joern@purestorage.com> wrote: > > But from a softirq or threaded irq context that 'interrupted' regs > context might potentially be NULL. > > NULL isn't a good thing to pass to mix_pool_bytes(), because the first > use of 'in' (='bytes') in _mix_pool_bytes() is a dereference without a > NULL check AFAICS: > > w = rol32(*bytes++, input_rotate); > > So at minimum I'd only mix this entropy into the pool if 'regs' is > non-zero. This would automatically do the right thing and not crash the > kernel on weird irq execution models such as threaded-only or -rt.
You don't even need threaded-only or RT. The timer is fired in the softirq which very well can happen from thread context in mainline.
Thanks,
tglx | |