Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1547781

[PATCH 3/8] random: trigger random_ready callback upon crng_init == 1

From Stephan Müller <smueller@chronox.de>
Newsgroups linux.kernel
Subject [PATCH 3/8] random: trigger random_ready callback upon crng_init == 1
Date 2016-12-27 23:50 +0100
Message-ID <sT8Jb-86X-7@gated-at.bofh.it> (permalink)
References <sT8Jb-86X-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The random_ready callback mechanism is intended to replicate the
getrandom system call behavior to in-kernel users. As the getrandom
system call unblocks with crng_init == 1, trigger the random_ready
wakeup call at the same time.

Signed-off-by: Stephan Mueller <smueller@chronox.de>
---
 drivers/char/random.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/char/random.c b/drivers/char/random.c
index 482531d..5c26b1c 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -810,6 +810,7 @@ static int crng_fast_load(const char *cp, size_t len)
 	}
 	if (crng_init_cnt >= CRNG_INIT_CNT_THRESH) {
 		crng_init = 1;
+		process_random_ready_list();
 		wake_up_interruptible(&crng_init_wait);
 		pr_notice("random: fast init done\n");
 	}
-- 
2.9.3

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/8] random: cleanup of code after removal of nonblocking pool Stephan Müller <smueller@chronox.de> - 2016-12-27 23:50 +0100
  [PATCH 3/8] random: trigger random_ready callback upon crng_init == 1 Stephan Müller <smueller@chronox.de> - 2016-12-27 23:50 +0100
  [PATCH 2/8] random: remove stale urandom_init_wait Stephan Müller <smueller@chronox.de> - 2016-12-27 23:50 +0100
  [PATCH 5/8] random: remove variable limit Stephan Müller <smueller@chronox.de> - 2016-12-27 23:50 +0100
  [PATCH 1/8] random: remove stale maybe_reseed_primary_crng Stephan Müller <smueller@chronox.de> - 2016-12-27 23:50 +0100
  [PATCH 8/8] random: move FIPS continuous test to output functions Stephan Müller <smueller@chronox.de> - 2016-12-27 23:50 +0100

csiph-web