This is a note to let you know that I've just added the patch titled random: document add_hwgenerator_randomness() with other input functions 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-document-add_hwgenerator_randomness-with-other-input-functions.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: Mark Brown <broonie@xxxxxxxxxx> Date: Wed, 1 Dec 2021 17:44:49 +0000 Subject: random: document add_hwgenerator_randomness() with other input functions From: Mark Brown <broonie@xxxxxxxxxx> commit 2b6c6e3d9ce3aa0e547ac25d60e06fe035cd9f79 upstream. The section at the top of random.c which documents the input functions available does not document add_hwgenerator_randomness() which might lead a reader to overlook it. Add a brief note about it. Signed-off-by: Mark Brown <broonie@xxxxxxxxxx> [Jason: reorganize position of function in doc comment and also document add_bootloader_randomness() while we're at it.] Signed-off-by: Jason A. Donenfeld <Jason@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/char/random.c | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -202,6 +202,9 @@ * unsigned int value); * void add_interrupt_randomness(int irq, int irq_flags); * void add_disk_randomness(struct gendisk *disk); + * void add_hwgenerator_randomness(const char *buffer, size_t count, + * size_t entropy); + * void add_bootloader_randomness(const void *buf, unsigned int size); * * add_device_randomness() is for adding data to the random pool that * is likely to differ between two devices (or possibly even per boot). @@ -228,6 +231,14 @@ * particular randomness source. They do this by keeping track of the * first and second order deltas of the event timings. * + * add_hwgenerator_randomness() is for true hardware RNGs, and will credit + * entropy as specified by the caller. If the entropy pool is full it will + * block until more entropy is needed. + * + * add_bootloader_randomness() is the same as add_hwgenerator_randomness() or + * add_device_randomness(), depending on whether or not the configuration + * option CONFIG_RANDOM_TRUST_BOOTLOADER is set. + * * Ensuring unpredictability at system startup * ============================================ * Patches currently in stable-queue which might be from broonie@xxxxxxxxxx are queue-4.14/random-split-primary-secondary-crng-init-paths.patch queue-4.14/linux-random.h-remove-arch_has_random-arch_has_random_seed.patch queue-4.14/powerpc-remove-arch_has_random-arch_has_random_seed.patch queue-4.14/random-add-arch_get_random_-long_early.patch queue-4.14/random-document-add_hwgenerator_randomness-with-other-input-functions.patch queue-4.14/powerpc-use-bool-in-archrandom.h.patch queue-4.14/s390-remove-arch_has_random-arch_has_random_seed.patch queue-4.14/linux-random.h-mark-config_arch_random-functions-__must_check.patch queue-4.14/linux-random.h-use-false-with-bool.patch queue-4.14/x86-remove-arch_has_random-arch_has_random_seed.patch