linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Theodore Tso <tytso@mit.edu>,
	Dominik Brodowski <linux@dominikbrodowski.net>,
	Eric Biggers <ebiggers@google.com>,
	"Jason A. Donenfeld" <Jason@zx2c4.com>
Subject: [PATCH 5.15 067/145] random: group crng functions
Date: Fri, 27 May 2022 10:49:28 +0200	[thread overview]
Message-ID: <20220527084858.605487304@linuxfoundation.org> (raw)
In-Reply-To: <20220527084850.364560116@linuxfoundation.org>

From: "Jason A. Donenfeld" <Jason@zx2c4.com>

commit 3655adc7089da4f8ca74cec8fcef73ea5101430e upstream.

This pulls all of the crng-focused functions into the second labeled
section.

No functional changes.

Cc: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/char/random.c |  792 +++++++++++++++++++++++++-------------------------
 1 file changed, 410 insertions(+), 382 deletions(-)

--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -380,122 +380,27 @@ static void _warn_unseeded_randomness(co
 }
 
 
-enum {
-	POOL_BITS = BLAKE2S_HASH_SIZE * 8,
-	POOL_MIN_BITS = POOL_BITS /* No point in settling for less. */
-};
-
-/*
- * Static global variables
- */
-static DECLARE_WAIT_QUEUE_HEAD(random_write_wait);
-
-static int crng_init_cnt = 0;
-
-/**********************************************************************
+/*********************************************************************
  *
- * OS independent entropy store.   Here are the functions which handle
- * storing entropy in an entropy pool.
+ * Fast key erasure RNG, the "crng".
  *
- **********************************************************************/
-
-static struct {
-	struct blake2s_state hash;
-	spinlock_t lock;
-	unsigned int entropy_count;
-} input_pool = {
-	.hash.h = { BLAKE2S_IV0 ^ (0x01010000 | BLAKE2S_HASH_SIZE),
-		    BLAKE2S_IV1, BLAKE2S_IV2, BLAKE2S_IV3, BLAKE2S_IV4,
-		    BLAKE2S_IV5, BLAKE2S_IV6, BLAKE2S_IV7 },
-	.hash.outlen = BLAKE2S_HASH_SIZE,
-	.lock = __SPIN_LOCK_UNLOCKED(input_pool.lock),
-};
-
-static void extract_entropy(void *buf, size_t nbytes);
-static bool drain_entropy(void *buf, size_t nbytes);
-
-static void crng_reseed(void);
-
-/*
- * This function adds bytes into the entropy "pool".  It does not
- * update the entropy estimate.  The caller should call
- * credit_entropy_bits if this is appropriate.
- */
-static void _mix_pool_bytes(const void *in, size_t nbytes)
-{
-	blake2s_update(&input_pool.hash, in, nbytes);
-}
-
-static void mix_pool_bytes(const void *in, size_t nbytes)
-{
-	unsigned long flags;
-
-	spin_lock_irqsave(&input_pool.lock, flags);
-	_mix_pool_bytes(in, nbytes);
-	spin_unlock_irqrestore(&input_pool.lock, flags);
-}
-
-struct fast_pool {
-	union {
-		u32 pool32[4];
-		u64 pool64[2];
-	};
-	unsigned long last;
-	u16 reg_idx;
-	u8 count;
-};
-
-/*
- * This is a fast mixing routine used by the interrupt randomness
- * collector.  It's hardcoded for an 128 bit pool and assumes that any
- * locks that might be needed are taken by the caller.
- */
-static void fast_mix(u32 pool[4])
-{
-	u32 a = pool[0],	b = pool[1];
-	u32 c = pool[2],	d = pool[3];
-
-	a += b;			c += d;
-	b = rol32(b, 6);	d = rol32(d, 27);
-	d ^= a;			b ^= c;
-
-	a += b;			c += d;
-	b = rol32(b, 16);	d = rol32(d, 14);
-	d ^= a;			b ^= c;
-
-	a += b;			c += d;
-	b = rol32(b, 6);	d = rol32(d, 27);
-	d ^= a;			b ^= c;
-
-	a += b;			c += d;
-	b = rol32(b, 16);	d = rol32(d, 14);
-	d ^= a;			b ^= c;
-
-	pool[0] = a;  pool[1] = b;
-	pool[2] = c;  pool[3] = d;
-}
-
-static void credit_entropy_bits(size_t nbits)
-{
-	unsigned int entropy_count, orig, add;
-
-	if (!nbits)
-		return;
-
-	add = min_t(size_t, nbits, POOL_BITS);
-
-	do {
-		orig = READ_ONCE(input_pool.entropy_count);
-		entropy_count = min_t(unsigned int, POOL_BITS, orig + add);
-	} while (cmpxchg(&input_pool.entropy_count, orig, entropy_count) != orig);
-
-	if (crng_init < 2 && entropy_count >= POOL_MIN_BITS)
-		crng_reseed();
-}
-
-/*********************************************************************
+ * These functions expand entropy from the entropy extractor into
+ * long streams for external consumption using the "fast key erasure"
+ * RNG described at <https://blog.cr.yp.to/20170723-random.html>.
+ *
+ * There are a few exported interfaces for use by other drivers:
  *
- * CRNG using CHACHA20
+ *	void get_random_bytes(void *buf, size_t nbytes)
+ *	u32 get_random_u32()
+ *	u64 get_random_u64()
+ *	unsigned int get_random_int()
+ *	unsigned long get_random_long()
+ *
+ * These interfaces will return the requested number of random bytes
+ * into the given buffer or as a return value. This is equivalent to
+ * a read from /dev/urandom. The integer family of functions may be
+ * higher performance for one-off random integers, because they do a
+ * bit of buffering.
  *
  *********************************************************************/
 
@@ -524,70 +429,14 @@ static DEFINE_PER_CPU(struct crng, crngs
 	.lock = INIT_LOCAL_LOCK(crngs.lock),
 };
 
-/*
- * crng_fast_load() can be called by code in the interrupt service
- * path.  So we can't afford to dilly-dally. Returns the number of
- * bytes processed from cp.
- */
-static size_t crng_fast_load(const void *cp, size_t len)
-{
-	unsigned long flags;
-	const u8 *src = (const u8 *)cp;
-	size_t ret = 0;
-
-	if (!spin_trylock_irqsave(&base_crng.lock, flags))
-		return 0;
-	if (crng_init != 0) {
-		spin_unlock_irqrestore(&base_crng.lock, flags);
-		return 0;
-	}
-	while (len > 0 && crng_init_cnt < CRNG_INIT_CNT_THRESH) {
-		base_crng.key[crng_init_cnt % sizeof(base_crng.key)] ^= *src;
-		src++; crng_init_cnt++; len--; ret++;
-	}
-	if (crng_init_cnt >= CRNG_INIT_CNT_THRESH) {
-		++base_crng.generation;
-		crng_init = 1;
-	}
-	spin_unlock_irqrestore(&base_crng.lock, flags);
-	if (crng_init == 1)
-		pr_notice("fast init done\n");
-	return ret;
-}
+/* Used by crng_reseed() to extract a new seed from the input pool. */
+static bool drain_entropy(void *buf, size_t nbytes);
 
 /*
- * crng_slow_load() is called by add_device_randomness, which has two
- * attributes.  (1) We can't trust the buffer passed to it is
- * guaranteed to be unpredictable (so it might not have any entropy at
- * all), and (2) it doesn't have the performance constraints of
- * crng_fast_load().
- *
- * So, we simply hash the contents in with the current key. Finally,
- * we do *not* advance crng_init_cnt since buffer we may get may be
- * something like a fixed DMI table (for example), which might very
- * well be unique to the machine, but is otherwise unvarying.
+ * This extracts a new crng key from the input pool, but only if there is a
+ * sufficient amount of entropy available, in order to mitigate bruteforcing
+ * of newly added bits.
  */
-static void crng_slow_load(const void *cp, size_t len)
-{
-	unsigned long flags;
-	struct blake2s_state hash;
-
-	blake2s_init(&hash, sizeof(base_crng.key));
-
-	if (!spin_trylock_irqsave(&base_crng.lock, flags))
-		return;
-	if (crng_init != 0) {
-		spin_unlock_irqrestore(&base_crng.lock, flags);
-		return;
-	}
-
-	blake2s_update(&hash, base_crng.key, sizeof(base_crng.key));
-	blake2s_update(&hash, cp, len);
-	blake2s_final(&hash, base_crng.key);
-
-	spin_unlock_irqrestore(&base_crng.lock, flags);
-}
-
 static void crng_reseed(void)
 {
 	unsigned long flags;
@@ -637,13 +486,11 @@ static void crng_reseed(void)
 }
 
 /*
- * The general form here is based on a "fast key erasure RNG" from
- * <https://blog.cr.yp.to/20170723-random.html>. It generates a ChaCha
- * block using the provided key, and then immediately overwites that
- * key with half the block. It returns the resultant ChaCha state to the
- * user, along with the second half of the block containing 32 bytes of
- * random data that may be used; random_data_len may not be greater than
- * 32.
+ * This generates a ChaCha block using the provided key, and then
+ * immediately overwites that key with half the block. It returns
+ * the resultant ChaCha state to the user, along with the second
+ * half of the block containing 32 bytes of random data that may
+ * be used; random_data_len may not be greater than 32.
  */
 static void crng_fast_key_erasure(u8 key[CHACHA_KEY_SIZE],
 				  u32 chacha_state[CHACHA_STATE_WORDS],
@@ -730,6 +577,126 @@ static void crng_make_state(u32 chacha_s
 	local_unlock_irqrestore(&crngs.lock, flags);
 }
 
+/*
+ * This function is for crng_init == 0 only.
+ *
+ * crng_fast_load() can be called by code in the interrupt service
+ * path.  So we can't afford to dilly-dally. Returns the number of
+ * bytes processed from cp.
+ */
+static size_t crng_fast_load(const void *cp, size_t len)
+{
+	static int crng_init_cnt = 0;
+	unsigned long flags;
+	const u8 *src = (const u8 *)cp;
+	size_t ret = 0;
+
+	if (!spin_trylock_irqsave(&base_crng.lock, flags))
+		return 0;
+	if (crng_init != 0) {
+		spin_unlock_irqrestore(&base_crng.lock, flags);
+		return 0;
+	}
+	while (len > 0 && crng_init_cnt < CRNG_INIT_CNT_THRESH) {
+		base_crng.key[crng_init_cnt % sizeof(base_crng.key)] ^= *src;
+		src++; crng_init_cnt++; len--; ret++;
+	}
+	if (crng_init_cnt >= CRNG_INIT_CNT_THRESH) {
+		++base_crng.generation;
+		crng_init = 1;
+	}
+	spin_unlock_irqrestore(&base_crng.lock, flags);
+	if (crng_init == 1)
+		pr_notice("fast init done\n");
+	return ret;
+}
+
+/*
+ * This function is for crng_init == 0 only.
+ *
+ * crng_slow_load() is called by add_device_randomness, which has two
+ * attributes.  (1) We can't trust the buffer passed to it is
+ * guaranteed to be unpredictable (so it might not have any entropy at
+ * all), and (2) it doesn't have the performance constraints of
+ * crng_fast_load().
+ *
+ * So, we simply hash the contents in with the current key. Finally,
+ * we do *not* advance crng_init_cnt since buffer we may get may be
+ * something like a fixed DMI table (for example), which might very
+ * well be unique to the machine, but is otherwise unvarying.
+ */
+static void crng_slow_load(const void *cp, size_t len)
+{
+	unsigned long flags;
+	struct blake2s_state hash;
+
+	blake2s_init(&hash, sizeof(base_crng.key));
+
+	if (!spin_trylock_irqsave(&base_crng.lock, flags))
+		return;
+	if (crng_init != 0) {
+		spin_unlock_irqrestore(&base_crng.lock, flags);
+		return;
+	}
+
+	blake2s_update(&hash, base_crng.key, sizeof(base_crng.key));
+	blake2s_update(&hash, cp, len);
+	blake2s_final(&hash, base_crng.key);
+
+	spin_unlock_irqrestore(&base_crng.lock, flags);
+}
+
+static void _get_random_bytes(void *buf, size_t nbytes)
+{
+	u32 chacha_state[CHACHA_STATE_WORDS];
+	u8 tmp[CHACHA_BLOCK_SIZE];
+	size_t len;
+
+	if (!nbytes)
+		return;
+
+	len = min_t(size_t, 32, nbytes);
+	crng_make_state(chacha_state, buf, len);
+	nbytes -= len;
+	buf += len;
+
+	while (nbytes) {
+		if (nbytes < CHACHA_BLOCK_SIZE) {
+			chacha20_block(chacha_state, tmp);
+			memcpy(buf, tmp, nbytes);
+			memzero_explicit(tmp, sizeof(tmp));
+			break;
+		}
+
+		chacha20_block(chacha_state, buf);
+		if (unlikely(chacha_state[12] == 0))
+			++chacha_state[13];
+		nbytes -= CHACHA_BLOCK_SIZE;
+		buf += CHACHA_BLOCK_SIZE;
+	}
+
+	memzero_explicit(chacha_state, sizeof(chacha_state));
+}
+
+/*
+ * This function is the exported kernel interface.  It returns some
+ * number of good random numbers, suitable for key generation, seeding
+ * TCP sequence numbers, etc.  It does not rely on the hardware random
+ * number generator.  For random bytes direct from the hardware RNG
+ * (when available), use get_random_bytes_arch(). In order to ensure
+ * that the randomness provided by this function is okay, the function
+ * wait_for_random_bytes() should be called and return 0 at least once
+ * at any point prior.
+ */
+void get_random_bytes(void *buf, size_t nbytes)
+{
+	static void *previous;
+
+	warn_unseeded_randomness(&previous);
+	_get_random_bytes(buf, nbytes);
+}
+EXPORT_SYMBOL(get_random_bytes);
+
 static ssize_t get_random_bytes_user(void __user *buf, size_t nbytes)
 {
 	bool large_request = nbytes > 256;
@@ -777,6 +744,268 @@ static ssize_t get_random_bytes_user(voi
 	return ret;
 }
 
+/*
+ * Batched entropy returns random integers. The quality of the random
+ * number is good as /dev/urandom. In order to ensure that the randomness
+ * provided by this function is okay, the function wait_for_random_bytes()
+ * should be called and return 0 at least once at any point prior.
+ */
+struct batched_entropy {
+	union {
+		/*
+		 * We make this 1.5x a ChaCha block, so that we get the
+		 * remaining 32 bytes from fast key erasure, plus one full
+		 * block from the detached ChaCha state. We can increase
+		 * the size of this later if needed so long as we keep the
+		 * formula of (integer_blocks + 0.5) * CHACHA_BLOCK_SIZE.
+		 */
+		u64 entropy_u64[CHACHA_BLOCK_SIZE * 3 / (2 * sizeof(u64))];
+		u32 entropy_u32[CHACHA_BLOCK_SIZE * 3 / (2 * sizeof(u32))];
+	};
+	local_lock_t lock;
+	unsigned long generation;
+	unsigned int position;
+};
+
+
+static DEFINE_PER_CPU(struct batched_entropy, batched_entropy_u64) = {
+	.lock = INIT_LOCAL_LOCK(batched_entropy_u64.lock),
+	.position = UINT_MAX
+};
+
+u64 get_random_u64(void)
+{
+	u64 ret;
+	unsigned long flags;
+	struct batched_entropy *batch;
+	static void *previous;
+	unsigned long next_gen;
+
+	warn_unseeded_randomness(&previous);
+
+	local_lock_irqsave(&batched_entropy_u64.lock, flags);
+	batch = raw_cpu_ptr(&batched_entropy_u64);
+
+	next_gen = READ_ONCE(base_crng.generation);
+	if (batch->position >= ARRAY_SIZE(batch->entropy_u64) ||
+	    next_gen != batch->generation) {
+		_get_random_bytes(batch->entropy_u64, sizeof(batch->entropy_u64));
+		batch->position = 0;
+		batch->generation = next_gen;
+	}
+
+	ret = batch->entropy_u64[batch->position];
+	batch->entropy_u64[batch->position] = 0;
+	++batch->position;
+	local_unlock_irqrestore(&batched_entropy_u64.lock, flags);
+	return ret;
+}
+EXPORT_SYMBOL(get_random_u64);
+
+static DEFINE_PER_CPU(struct batched_entropy, batched_entropy_u32) = {
+	.lock = INIT_LOCAL_LOCK(batched_entropy_u32.lock),
+	.position = UINT_MAX
+};
+
+u32 get_random_u32(void)
+{
+	u32 ret;
+	unsigned long flags;
+	struct batched_entropy *batch;
+	static void *previous;
+	unsigned long next_gen;
+
+	warn_unseeded_randomness(&previous);
+
+	local_lock_irqsave(&batched_entropy_u32.lock, flags);
+	batch = raw_cpu_ptr(&batched_entropy_u32);
+
+	next_gen = READ_ONCE(base_crng.generation);
+	if (batch->position >= ARRAY_SIZE(batch->entropy_u32) ||
+	    next_gen != batch->generation) {
+		_get_random_bytes(batch->entropy_u32, sizeof(batch->entropy_u32));
+		batch->position = 0;
+		batch->generation = next_gen;
+	}
+
+	ret = batch->entropy_u32[batch->position];
+	batch->entropy_u32[batch->position] = 0;
+	++batch->position;
+	local_unlock_irqrestore(&batched_entropy_u32.lock, flags);
+	return ret;
+}
+EXPORT_SYMBOL(get_random_u32);
+
+/**
+ * randomize_page - Generate a random, page aligned address
+ * @start:	The smallest acceptable address the caller will take.
+ * @range:	The size of the area, starting at @start, within which the
+ *		random address must fall.
+ *
+ * If @start + @range would overflow, @range is capped.
+ *
+ * NOTE: Historical use of randomize_range, which this replaces, presumed that
+ * @start was already page aligned.  We now align it regardless.
+ *
+ * Return: A page aligned address within [start, start + range).  On error,
+ * @start is returned.
+ */
+unsigned long randomize_page(unsigned long start, unsigned long range)
+{
+	if (!PAGE_ALIGNED(start)) {
+		range -= PAGE_ALIGN(start) - start;
+		start = PAGE_ALIGN(start);
+	}
+
+	if (start > ULONG_MAX - range)
+		range = ULONG_MAX - start;
+
+	range >>= PAGE_SHIFT;
+
+	if (range == 0)
+		return start;
+
+	return start + (get_random_long() % range << PAGE_SHIFT);
+}
+
+/*
+ * This function will use the architecture-specific hardware random
+ * number generator if it is available. It is not recommended for
+ * use. Use get_random_bytes() instead. It returns the number of
+ * bytes filled in.
+ */
+size_t __must_check get_random_bytes_arch(void *buf, size_t nbytes)
+{
+	size_t left = nbytes;
+	u8 *p = buf;
+
+	while (left) {
+		unsigned long v;
+		size_t chunk = min_t(size_t, left, sizeof(unsigned long));
+
+		if (!arch_get_random_long(&v))
+			break;
+
+		memcpy(p, &v, chunk);
+		p += chunk;
+		left -= chunk;
+	}
+
+	return nbytes - left;
+}
+EXPORT_SYMBOL(get_random_bytes_arch);
+
+enum {
+	POOL_BITS = BLAKE2S_HASH_SIZE * 8,
+	POOL_MIN_BITS = POOL_BITS /* No point in settling for less. */
+};
+
+/*
+ * Static global variables
+ */
+static DECLARE_WAIT_QUEUE_HEAD(random_write_wait);
+
+/**********************************************************************
+ *
+ * OS independent entropy store.   Here are the functions which handle
+ * storing entropy in an entropy pool.
+ *
+ **********************************************************************/
+
+static struct {
+	struct blake2s_state hash;
+	spinlock_t lock;
+	unsigned int entropy_count;
+} input_pool = {
+	.hash.h = { BLAKE2S_IV0 ^ (0x01010000 | BLAKE2S_HASH_SIZE),
+		    BLAKE2S_IV1, BLAKE2S_IV2, BLAKE2S_IV3, BLAKE2S_IV4,
+		    BLAKE2S_IV5, BLAKE2S_IV6, BLAKE2S_IV7 },
+	.hash.outlen = BLAKE2S_HASH_SIZE,
+	.lock = __SPIN_LOCK_UNLOCKED(input_pool.lock),
+};
+
+static void extract_entropy(void *buf, size_t nbytes);
+static bool drain_entropy(void *buf, size_t nbytes);
+
+static void crng_reseed(void);
+
+/*
+ * This function adds bytes into the entropy "pool".  It does not
+ * update the entropy estimate.  The caller should call
+ * credit_entropy_bits if this is appropriate.
+ */
+static void _mix_pool_bytes(const void *in, size_t nbytes)
+{
+	blake2s_update(&input_pool.hash, in, nbytes);
+}
+
+static void mix_pool_bytes(const void *in, size_t nbytes)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&input_pool.lock, flags);
+	_mix_pool_bytes(in, nbytes);
+	spin_unlock_irqrestore(&input_pool.lock, flags);
+}
+
+struct fast_pool {
+	union {
+		u32 pool32[4];
+		u64 pool64[2];
+	};
+	unsigned long last;
+	u16 reg_idx;
+	u8 count;
+};
+
+/*
+ * This is a fast mixing routine used by the interrupt randomness
+ * collector.  It's hardcoded for an 128 bit pool and assumes that any
+ * locks that might be needed are taken by the caller.
+ */
+static void fast_mix(u32 pool[4])
+{
+	u32 a = pool[0],	b = pool[1];
+	u32 c = pool[2],	d = pool[3];
+
+	a += b;			c += d;
+	b = rol32(b, 6);	d = rol32(d, 27);
+	d ^= a;			b ^= c;
+
+	a += b;			c += d;
+	b = rol32(b, 16);	d = rol32(d, 14);
+	d ^= a;			b ^= c;
+
+	a += b;			c += d;
+	b = rol32(b, 6);	d = rol32(d, 27);
+	d ^= a;			b ^= c;
+
+	a += b;			c += d;
+	b = rol32(b, 16);	d = rol32(d, 14);
+	d ^= a;			b ^= c;
+
+	pool[0] = a;  pool[1] = b;
+	pool[2] = c;  pool[3] = d;
+}
+
+static void credit_entropy_bits(size_t nbits)
+{
+	unsigned int entropy_count, orig, add;
+
+	if (!nbits)
+		return;
+
+	add = min_t(size_t, nbits, POOL_BITS);
+
+	do {
+		orig = READ_ONCE(input_pool.entropy_count);
+		entropy_count = min_t(unsigned int, POOL_BITS, orig + add);
+	} while (cmpxchg(&input_pool.entropy_count, orig, entropy_count) != orig);
+
+	if (crng_init < 2 && entropy_count >= POOL_MIN_BITS)
+		crng_reseed();
+}
+
 /*********************************************************************
  *
  * Entropy input management
@@ -1045,57 +1274,6 @@ static bool drain_entropy(void *buf, siz
 }
 
 /*
- * This function is the exported kernel interface.  It returns some
- * number of good random numbers, suitable for key generation, seeding
- * TCP sequence numbers, etc.  It does not rely on the hardware random
- * number generator.  For random bytes direct from the hardware RNG
- * (when available), use get_random_bytes_arch(). In order to ensure
- * that the randomness provided by this function is okay, the function
- * wait_for_random_bytes() should be called and return 0 at least once
- * at any point prior.
- */
-static void _get_random_bytes(void *buf, size_t nbytes)
-{
-	u32 chacha_state[CHACHA_STATE_WORDS];
-	u8 tmp[CHACHA_BLOCK_SIZE];
-	size_t len;
-
-	if (!nbytes)
-		return;
-
-	len = min_t(size_t, 32, nbytes);
-	crng_make_state(chacha_state, buf, len);
-	nbytes -= len;
-	buf += len;
-
-	while (nbytes) {
-		if (nbytes < CHACHA_BLOCK_SIZE) {
-			chacha20_block(chacha_state, tmp);
-			memcpy(buf, tmp, nbytes);
-			memzero_explicit(tmp, sizeof(tmp));
-			break;
-		}
-
-		chacha20_block(chacha_state, buf);
-		if (unlikely(chacha_state[12] == 0))
-			++chacha_state[13];
-		nbytes -= CHACHA_BLOCK_SIZE;
-		buf += CHACHA_BLOCK_SIZE;
-	}
-
-	memzero_explicit(chacha_state, sizeof(chacha_state));
-}
-
-void get_random_bytes(void *buf, size_t nbytes)
-{
-	static void *previous;
-
-	warn_unseeded_randomness(&previous);
-	_get_random_bytes(buf, nbytes);
-}
-EXPORT_SYMBOL(get_random_bytes);
-
-/*
  * Each time the timer fires, we expect that we got an unpredictable
  * jump in the cycle counter. Even if the timer is running on another
  * CPU, the timer activity will be touching the stack of the CPU that is
@@ -1144,33 +1322,6 @@ static void try_to_generate_entropy(void
 	mix_pool_bytes(&stack.now, sizeof(stack.now));
 }
 
-/*
- * This function will use the architecture-specific hardware random
- * number generator if it is available. It is not recommended for
- * use. Use get_random_bytes() instead. It returns the number of
- * bytes filled in.
- */
-size_t __must_check get_random_bytes_arch(void *buf, size_t nbytes)
-{
-	size_t left = nbytes;
-	u8 *p = buf;
-
-	while (left) {
-		unsigned long v;
-		size_t chunk = min_t(size_t, left, sizeof(unsigned long));
-
-		if (!arch_get_random_long(&v))
-			break;
-
-		memcpy(p, &v, chunk);
-		p += chunk;
-		left -= chunk;
-	}
-
-	return nbytes - left;
-}
-EXPORT_SYMBOL(get_random_bytes_arch);
-
 static bool trust_cpu __ro_after_init = IS_ENABLED(CONFIG_RANDOM_TRUST_CPU);
 static int __init parse_trust_cpu(char *arg)
 {
@@ -1523,129 +1674,6 @@ struct ctl_table random_table[] = {
 };
 #endif	/* CONFIG_SYSCTL */
 
-struct batched_entropy {
-	union {
-		/*
-		 * We make this 1.5x a ChaCha block, so that we get the
-		 * remaining 32 bytes from fast key erasure, plus one full
-		 * block from the detached ChaCha state. We can increase
-		 * the size of this later if needed so long as we keep the
-		 * formula of (integer_blocks + 0.5) * CHACHA_BLOCK_SIZE.
-		 */
-		u64 entropy_u64[CHACHA_BLOCK_SIZE * 3 / (2 * sizeof(u64))];
-		u32 entropy_u32[CHACHA_BLOCK_SIZE * 3 / (2 * sizeof(u32))];
-	};
-	local_lock_t lock;
-	unsigned long generation;
-	unsigned int position;
-};
-
-/*
- * Get a random word for internal kernel use only. The quality of the random
- * number is good as /dev/urandom. In order to ensure that the randomness
- * provided by this function is okay, the function wait_for_random_bytes()
- * should be called and return 0 at least once at any point prior.
- */
-static DEFINE_PER_CPU(struct batched_entropy, batched_entropy_u64) = {
-	.lock = INIT_LOCAL_LOCK(batched_entropy_u64.lock),
-	.position = UINT_MAX
-};
-
-u64 get_random_u64(void)
-{
-	u64 ret;
-	unsigned long flags;
-	struct batched_entropy *batch;
-	static void *previous;
-	unsigned long next_gen;
-
-	warn_unseeded_randomness(&previous);
-
-	local_lock_irqsave(&batched_entropy_u64.lock, flags);
-	batch = raw_cpu_ptr(&batched_entropy_u64);
-
-	next_gen = READ_ONCE(base_crng.generation);
-	if (batch->position >= ARRAY_SIZE(batch->entropy_u64) ||
-	    next_gen != batch->generation) {
-		_get_random_bytes(batch->entropy_u64, sizeof(batch->entropy_u64));
-		batch->position = 0;
-		batch->generation = next_gen;
-	}
-
-	ret = batch->entropy_u64[batch->position];
-	batch->entropy_u64[batch->position] = 0;
-	++batch->position;
-	local_unlock_irqrestore(&batched_entropy_u64.lock, flags);
-	return ret;
-}
-EXPORT_SYMBOL(get_random_u64);
-
-static DEFINE_PER_CPU(struct batched_entropy, batched_entropy_u32) = {
-	.lock = INIT_LOCAL_LOCK(batched_entropy_u32.lock),
-	.position = UINT_MAX
-};
-
-u32 get_random_u32(void)
-{
-	u32 ret;
-	unsigned long flags;
-	struct batched_entropy *batch;
-	static void *previous;
-	unsigned long next_gen;
-
-	warn_unseeded_randomness(&previous);
-
-	local_lock_irqsave(&batched_entropy_u32.lock, flags);
-	batch = raw_cpu_ptr(&batched_entropy_u32);
-
-	next_gen = READ_ONCE(base_crng.generation);
-	if (batch->position >= ARRAY_SIZE(batch->entropy_u32) ||
-	    next_gen != batch->generation) {
-		_get_random_bytes(batch->entropy_u32, sizeof(batch->entropy_u32));
-		batch->position = 0;
-		batch->generation = next_gen;
-	}
-
-	ret = batch->entropy_u32[batch->position];
-	batch->entropy_u32[batch->position] = 0;
-	++batch->position;
-	local_unlock_irqrestore(&batched_entropy_u32.lock, flags);
-	return ret;
-}
-EXPORT_SYMBOL(get_random_u32);
-
-/**
- * randomize_page - Generate a random, page aligned address
- * @start:	The smallest acceptable address the caller will take.
- * @range:	The size of the area, starting at @start, within which the
- *		random address must fall.
- *
- * If @start + @range would overflow, @range is capped.
- *
- * NOTE: Historical use of randomize_range, which this replaces, presumed that
- * @start was already page aligned.  We now align it regardless.
- *
- * Return: A page aligned address within [start, start + range).  On error,
- * @start is returned.
- */
-unsigned long randomize_page(unsigned long start, unsigned long range)
-{
-	if (!PAGE_ALIGNED(start)) {
-		range -= PAGE_ALIGN(start) - start;
-		start = PAGE_ALIGN(start);
-	}
-
-	if (start > ULONG_MAX - range)
-		range = ULONG_MAX - start;
-
-	range >>= PAGE_SHIFT;
-
-	if (range == 0)
-		return start;
-
-	return start + (get_random_long() % range << PAGE_SHIFT);
-}
-
 /* Interface for in-kernel drivers of true hardware RNGs.
  * Those devices may produce endless random bits and will be throttled
  * when our pool is full.



  parent reply	other threads:[~2022-05-27 12:01 UTC|newest]

Thread overview: 152+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-27  8:48 [PATCH 5.15 000/145] 5.15.44-rc1 review Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 001/145] HID: amd_sfh: Add support for sensor discovery Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 002/145] KVM: x86/mmu: fix NULL pointer dereference on guest INVPCID Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 003/145] [PATCH 5.15] ice: fix crash at allocation failure Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 004/145] ACPI: sysfs: Fix BERT error region memory mapping Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 005/145] MAINTAINERS: co-maintain random.c Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 006/145] MAINTAINERS: add git tree for random.c Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 007/145] lib/crypto: blake2s: include as built-in Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 008/145] lib/crypto: blake2s: move hmac construction into wireguard Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 009/145] lib/crypto: sha1: re-roll loops to reduce code size Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 010/145] lib/crypto: blake2s: avoid indirect calls to compression function for Clang CFI Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 011/145] random: document add_hwgenerator_randomness() with other input functions Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 012/145] random: remove unused irq_flags argument from add_interrupt_randomness() Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 013/145] random: use BLAKE2s instead of SHA1 in extraction Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 014/145] random: do not sign extend bytes for rotation when mixing Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 015/145] random: do not re-init if crng_reseed completes before primary init Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 016/145] random: mix bootloader randomness into pool Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 017/145] random: harmonize "crng init done" messages Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 018/145] random: use IS_ENABLED(CONFIG_NUMA) instead of ifdefs Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 019/145] random: early initialization of ChaCha constants Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 020/145] random: avoid superfluous call to RDRAND in CRNG extraction Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 021/145] random: dont reset crng_init_cnt on urandom_read() Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 022/145] random: fix typo in comments Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 023/145] random: cleanup poolinfo abstraction Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 024/145] random: cleanup integer types Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 025/145] random: remove incomplete last_data logic Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 026/145] random: remove unused extract_entropy() reserved argument Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 027/145] random: rather than entropy_store abstraction, use global Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 028/145] random: remove unused OUTPUT_POOL constants Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 029/145] random: de-duplicate INPUT_POOL constants Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 030/145] random: prepend remaining pool constants with POOL_ Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 031/145] random: cleanup fractional entropy shift constants Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 032/145] random: access input_pool_data directly rather than through pointer Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 033/145] random: selectively clang-format where it makes sense Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 034/145] random: simplify arithmetic function flow in account() Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 035/145] random: continually use hwgenerator randomness Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 036/145] random: access primary_pool directly rather than through pointer Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 037/145] random: only call crng_finalize_init() for primary_crng Greg Kroah-Hartman
2022-05-27  8:48 ` [PATCH 5.15 038/145] random: use computational hash for entropy extraction Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 039/145] random: simplify entropy debiting Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 040/145] random: use linear min-entropy accumulation crediting Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 041/145] random: always wake up entropy writers after extraction Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 042/145] random: make credit_entropy_bits() always safe Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 043/145] random: remove use_input_pool parameter from crng_reseed() Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 044/145] random: remove batched entropy locking Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 045/145] random: fix locking in crng_fast_load() Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 046/145] random: use RDSEED instead of RDRAND in entropy extraction Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 047/145] random: get rid of secondary crngs Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 048/145] random: inline leaves of rand_initialize() Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 049/145] random: ensure early RDSEED goes through mixer on init Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 050/145] random: do not xor RDRAND when writing into /dev/random Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 051/145] random: absorb fast pool into input pool after fast load Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 052/145] random: use simpler fast key erasure flow on per-cpu keys Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 053/145] random: use hash function for crng_slow_load() Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 054/145] random: make more consistent use of integer types Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 055/145] random: remove outdated INT_MAX >> 6 check in urandom_read() Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 056/145] random: zero buffer after reading entropy from userspace Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 057/145] random: fix locking for crng_init in crng_reseed() Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 058/145] random: tie batched entropy generation to base_crng generation Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 059/145] random: remove ifdefd out interrupt bench Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 060/145] random: remove unused tracepoints Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 061/145] random: add proper SPDX header Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 062/145] random: deobfuscate irq u32/u64 contributions Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 063/145] random: introduce drain_entropy() helper to declutter crng_reseed() Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 064/145] random: remove useless header comment Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 065/145] random: remove whitespace and reorder includes Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 066/145] random: group initialization wait functions Greg Kroah-Hartman
2022-05-27  8:49 ` Greg Kroah-Hartman [this message]
2022-05-27  8:49 ` [PATCH 5.15 068/145] random: group entropy extraction functions Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 069/145] random: group entropy collection functions Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 070/145] random: group userspace read/write functions Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 071/145] random: group sysctl functions Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 072/145] random: rewrite header introductory comment Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 073/145] random: defer fast pool mixing to worker Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 074/145] random: do not take pool spinlock at boot Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 075/145] random: unify early init crng load accounting Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 076/145] random: check for crng_init == 0 in add_device_randomness() Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 077/145] random: pull add_hwgenerator_randomness() declaration into random.h Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 078/145] random: clear fast pool, crng, and batches in cpuhp bring up Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 079/145] random: round-robin registers as ulong, not u32 Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 080/145] random: only wake up writers after zap if threshold was passed Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 081/145] random: cleanup UUID handling Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 082/145] random: unify cycles_t and jiffies usage and types Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 083/145] random: do crng pre-init loading in worker rather than irq Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 084/145] random: give sysctl_random_min_urandom_seed a more sensible value Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 085/145] random: dont let 644 read-only sysctls be written to Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 086/145] random: replace custom notifier chain with standard one Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 087/145] random: use SipHash as interrupt entropy accumulator Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 088/145] random: make consistent usage of crng_ready() Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 089/145] random: reseed more often immediately after booting Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 090/145] random: check for signal and try earlier when generating entropy Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 091/145] random: skip fast_init if hwrng provides large chunk of entropy Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 092/145] random: treat bootloader trust toggle the same way as cpu trust toggle Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 093/145] random: re-add removed comment about get_random_{u32,u64} reseeding Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 094/145] random: mix build-time latent entropy into pool at init Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 095/145] random: do not split fast init input in add_hwgenerator_randomness() Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 096/145] random: do not allow user to keep crng key around on stack Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 097/145] random: check for signal_pending() outside of need_resched() check Greg Kroah-Hartman
2022-05-27  8:49 ` [PATCH 5.15 098/145] random: check for signals every PAGE_SIZE chunk of /dev/[u]random Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 099/145] random: allow partial reads if later user copies fail Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 100/145] random: make random_get_entropy() return an unsigned long Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 101/145] random: document crng_fast_key_erasure() destination possibility Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 102/145] random: fix sysctl documentation nits Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 103/145] init: call time_init() before rand_initialize() Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 104/145] ia64: define get_cycles macro for arch-override Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 105/145] s390: " Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 106/145] parisc: " Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 107/145] alpha: " Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 108/145] powerpc: " Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 109/145] timekeeping: Add raw clock fallback for random_get_entropy() Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 110/145] m68k: use fallback for random_get_entropy() instead of zero Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 111/145] riscv: " Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 112/145] mips: use fallback for random_get_entropy() instead of just c0 random Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 113/145] arm: use fallback for random_get_entropy() instead of zero Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 114/145] nios2: " Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 115/145] x86/tsc: Use " Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 116/145] um: use " Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 117/145] sparc: " Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 118/145] xtensa: " Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 119/145] random: insist on random_get_entropy() existing in order to simplify Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 120/145] random: do not use batches when !crng_ready() Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 121/145] random: use first 128 bits of input as fast init Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 122/145] random: do not pretend to handle premature next security model Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 123/145] random: order timer entropy functions below interrupt functions Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 124/145] random: do not use input pool from hard IRQs Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 125/145] random: help compiler out with fast_mix() by using simpler arguments Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 126/145] siphash: use one source of truth for siphash permutations Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 127/145] random: use symbolic constants for crng_init states Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 128/145] random: avoid initializing twice in credit race Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 129/145] random: move initialization out of reseeding hot path Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 130/145] random: remove ratelimiting for in-kernel unseeded randomness Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 131/145] random: use proper jiffies comparison macro Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 132/145] random: handle latent entropy and command line from random_init() Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 133/145] random: credit architectural init the exact amount Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 134/145] random: use static branch for crng_ready() Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 135/145] random: remove extern from functions in header Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 136/145] random: use proper return types on get_random_{int,long}_wait() Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 137/145] random: make consistent use of buf and len Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 138/145] random: move initialization functions out of hot pages Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 139/145] random: move randomize_page() into mm where it belongs Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 140/145] random: unify batched entropy implementations Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 141/145] random: convert to using fops->read_iter() Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 142/145] random: convert to using fops->write_iter() Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 143/145] random: wire up fops->splice_{read,write}_iter() Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 144/145] random: check for signals after page of pool writes Greg Kroah-Hartman
2022-05-27  8:50 ` [PATCH 5.15 145/145] ALSA: ctxfi: Add SB046x PCI ID Greg Kroah-Hartman
2022-05-27 22:39 ` [PATCH 5.15 000/145] 5.15.44-rc1 review Guenter Roeck
2022-05-28  6:29 ` Bagas Sanjaya
2022-05-28 10:52 ` Naresh Kamboju
2022-05-28 15:27 ` Sudip Mukherjee
2022-05-28 21:08 ` Ron Economos
2022-05-29  0:35 ` Fox Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220527084858.605487304@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=Jason@zx2c4.com \
    --cc=ebiggers@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=stable@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).