lkml.org 
[lkml]   [2022]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/2] random: fix locking in crng_fast_load()
Hi Dominik,

Does this introduce a lock nesting inversion situation?

With your patch, crng_fast_load() now does:

lock(primary_crng)
invalidate_batched_entropy()
lock(batch_lock)
unlock(batch_lock)
unlock(primary_crng)

While get_random_{u32,u64}() does:

lock(batch_lock)
extract_crng()
lock(primary_crng)
unlock(primary_crng)
unlock(batch_lock)

Is this correct? If so, we might have to defer this patch until after
<https://git.kernel.org/pub/scm/linux/kernel/git/crng/random.git/commit/?id=2dfab1b1>
or something like it lands, which attempts to get rid of the batched
entropy lock.

If that analysis seems right to you, I could pull this patch into that
development branch for poking and prodding.

Jason

\
 
 \ /
  Last update: 2022-02-05 14:19    [W:0.055 / U:0.636 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site