On 2017-06-15 00:33:12 [+0200], Jason A. Donenfeld wrote:
> There's a potential race that I fixed in my v5 of that patch set, but
> Ted only took v4, and for whatever reason has been to busy to submit
> the additional patch I already posted showing the diff between v4&v5.
> Hopefully he actually gets around to it and sends this for the next
> rc. Here it is:
So you replace "crng_init < 2" with use_lock instead. That is not what I
am talking about. Again:
in that order while the code path
-> _extract_crng() spin_lock_irqsave(&crng->lock, );
which allocates the same lock in opposite order.
So T1 waits for batched_entropy_reset_lock holding primary_crng.lock and
T2 waits for primary_crng.lock holding batched_entropy_reset_lock.