Skip to content

random: fix write locking for crng_init

Dominik Brodowski linux-crypto lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2random: fix locking in crng_fast_load()drivers/char/random.c+3 -23 replies
2/2random: fix locking for crng_init in crng_reseed()drivers/char/random.c+15 -50 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchEric Biggers
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] random: fix write locking for crng_init

According to a comment in random.c, crng_init is protected by primary_crng->lock. These two patches fix the locking for writing tp (that is: increasing) crng_init in call sites where it may matter. At rand_initialize() time (precisely: either in crng_initialize_primary() or in crng_finalize_init()), crng_init is set to 2 without the lock being held. However, then the kernel is running with IRQs disabled and only the boot CPU active (but not yet in PID 1).

Dominik Brodowski (2):
random: fix locking in crng_fast_load()
random: fix locking for crng_init in crng_reseed()

 drivers/char/random.c | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)
Signature · 1 line
2.35.1