On Sat, 19 Oct 2019, Ingo Molnar wrote: > * Linus Torvalds <torva...@linux-foundation.org> wrote: > > On Fri, Oct 18, 2019 at 4:42 PM Jörn Engel <jo...@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