This is a note to let you know that I've just added the patch titled random: ignore GRND_RANDOM in getentropy(2) to the 4.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: random-ignore-grnd_random-in-getentropy-2.patch and it can be found in the queue-4.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From foo@baz Thu Jun 16 07:08:33 PM CEST 2022 From: Andy Lutomirski <luto@xxxxxxxxxx> Date: Mon, 23 Dec 2019 00:20:47 -0800 Subject: random: ignore GRND_RANDOM in getentropy(2) From: Andy Lutomirski <luto@xxxxxxxxxx> commit 48446f198f9adcb499b30332488dfd5bc3f176f6 upstream. The separate blocking pool is going away. Start by ignoring GRND_RANDOM in getentropy(2). This should not materially break any API. Any code that worked without this change should work at least as well with this change. Signed-off-by: Andy Lutomirski <luto@xxxxxxxxxx> Link: https://lore.kernel.org/r/705c5a091b63cc5da70c99304bb97e0109be0a26.1577088521.git.luto@xxxxxxxxxx Signed-off-by: Theodore Ts'o <tytso@xxxxxxx> Signed-off-by: Jason A. Donenfeld <Jason@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/char/random.c | 3 --- include/uapi/linux/random.h | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -2147,9 +2147,6 @@ SYSCALL_DEFINE3(getrandom, char __user * if (count > INT_MAX) count = INT_MAX; - if (flags & GRND_RANDOM) - return _random_read(flags & GRND_NONBLOCK, buf, count); - if (!(flags & GRND_INSECURE) && !crng_ready()) { if (flags & GRND_NONBLOCK) return -EAGAIN; --- a/include/uapi/linux/random.h +++ b/include/uapi/linux/random.h @@ -48,7 +48,7 @@ struct rand_pool_info { * Flags for getrandom(2) * * GRND_NONBLOCK Don't block and return EAGAIN instead - * GRND_RANDOM Use the /dev/random pool instead of /dev/urandom + * GRND_RANDOM No effect * GRND_INSECURE Return non-cryptographic random bytes */ #define GRND_NONBLOCK 0x0001 Patches currently in stable-queue which might be from luto@xxxxxxxxxx are queue-4.14/random-remove-kernel.random.read_wakeup_threshold.patch queue-4.14/random-initialize-chacha20-constants-with-correct-endianness.patch queue-4.14/random-make-dev-random-be-almost-like-dev-urandom.patch queue-4.14/random-remove-batched-entropy-locking.patch queue-4.14/random-remove-the-blocking-pool.patch queue-4.14/random-ignore-grnd_random-in-getentropy-2.patch queue-4.14/random-delete-code-to-pull-data-into-pools.patch queue-4.14/random-don-t-wake-crng_init_wait-when-crng_init-1.patch queue-4.14/random-add-a-urandom_read_nowait-for-random-apis-that-don-t-warn.patch queue-4.14/random-remove-dead-code-left-over-from-blocking-pool.patch queue-4.14/random-try-to-actively-add-entropy-rather-than-passively-wait-for-it.patch queue-4.14/random-add-grnd_insecure-to-return-best-effort-non-cryptographic-bytes.patch