Re: [PATCH v28 07/12] LRNG - add kernel crypto API PRNG extension

Randy Dunlap
2020-01-16T00:16:23Z

On 1/15/20 2:34 AM, Stephan Müller wrote:
>
> CC: "Eric W. Biederman" <ebiederm@xmission.com>
> CC: "Alexander E. Patrakov" <patrakov@gmail.com>
> CC: "Ahmed S. Darwish" <darwish.07@gmail.com>
> CC: "Theodore Y. Ts'o" <tytso@mit.edu>
> CC: Willy Tarreau <w@1wt.eu>
> CC: Matthew Garrett <mjg59@srcf.ucam.org>
> CC: Vito Caputo <vcaputo@pengaru.com>
> CC: Andreas Dilger <adilger.kernel@dilger.ca>
> CC: Jan Kara <jack@suse.cz>
> CC: Ray Strode <rstrode@redhat.com>
> CC: William Jon McCann <mccann@jhu.edu>
> CC: zhangjs <zachary@baishancloud.com>
> CC: Andy Lutomirski <luto@kernel.org>
> CC: Florian Weimer <fweimer@redhat.com>
> CC: Lennart Poettering <mzxreary@0pointer.de>
> CC: Nicolai Stange <nstange@suse.de>
> Reviewed-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
> Reviewed-by: Roman Drahtmueller <draht@schaltsekun.de>
> Tested-by: Roman Drahtmüller <draht@schaltsekun.de>
> Tested-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
> Tested-by: Neil Horman <nhorman@redhat.com>
> Signed-off-by: Stephan Mueller <smueller@chronox.de>
> ---
> drivers/char/lrng/Kconfig | 10 +
> drivers/char/lrng/Makefile | 1 +
> drivers/char/lrng/lrng_kcapi.c | 327 +++++++++++++++++++++++++++++++++
> 3 files changed, 338 insertions(+)
> create mode 100644 drivers/char/lrng/lrng_kcapi.c
>
> diff --git a/drivers/char/lrng/Kconfig b/drivers/char/lrng/Kconfig
> index 15fb623d9d1f..0d070a3897dd 100644
> --- a/drivers/char/lrng/Kconfig
> +++ b/drivers/char/lrng/Kconfig
> @@ -80,6 +80,16 @@ config LRNG_DRBG
> Enable the SP800-90A DRBG support for the LRNG. Once the
> module is loaded, output from /dev/random, /dev/urandom,
> getrandom(2), or get_random_bytes is provided by a DRBG.
> +
> +config LRNG_KCAPI
> + tristate "Kernel Crypto API support for the LRNG"
> + select CRYPTO_RNG

Don't select CRYPTO_RNG unless you know that CRYPTO is set/enabled.

> + help
> + Enable the support for generic pseudo-random number
> + generators offered by the kernel crypto API with the
> + LRNG. Once the module is loaded, output from /dev/random,
> + /dev/urandom, getrandom(2), or get_random_bytes is
> + provided by the selected kernel crypto API RNG.
> endif # LRNG_DRNG_SWITCH
>
> endif # LRNG

--
~Randy
Reported-by: Randy Dunlap <rdunlap@infradead.org>