linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] random: inform about bootloader-provided randomness
@ 2019-10-05 11:36 Dominik Brodowski
  2019-10-15  0:40 ` Will Deacon
  0 siblings, 1 reply; 3+ messages in thread
From: Dominik Brodowski @ 2019-10-05 11:36 UTC (permalink / raw)
  To: Ard Biesheuvel, Hsin-Yi Wang, Stephen Boyd, Rob Herring,
	Theodore Ts'o, Will Deacon
  Cc: linux-kernel

Inform how many bits of randomness were provided by the bootloader,
and whether we trust that input.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Hsin-Yi Wang <hsinyi@chromium.org>
Cc: Stephen Boyd <swboyd@chromium.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Will Deacon <will@kernel.org>

diff --git a/drivers/char/random.c b/drivers/char/random.c
index de434feb873a..673375e05c0d 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -2515,6 +2515,10 @@ EXPORT_SYMBOL_GPL(add_hwgenerator_randomness);
  */
 void add_bootloader_randomness(const void *buf, unsigned int size)
 {
+	pr_notice("random: adding %u bits of %sbootloader-provided randomness",
+		size * 8,
+		IS_ENABLED(CONFIG_RANDOM_TRUST_BOOTLOADER) ? "trusted " : "");
+
 	if (IS_ENABLED(CONFIG_RANDOM_TRUST_BOOTLOADER))
 		add_hwgenerator_randomness(buf, size, size * 8);
 	else

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] random: inform about bootloader-provided randomness
  2019-10-05 11:36 [PATCH] random: inform about bootloader-provided randomness Dominik Brodowski
@ 2019-10-15  0:40 ` Will Deacon
  2019-10-15  9:44   ` Hsin-Yi Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Will Deacon @ 2019-10-15  0:40 UTC (permalink / raw)
  To: Dominik Brodowski
  Cc: Ard Biesheuvel, Hsin-Yi Wang, Stephen Boyd, Rob Herring,
	Theodore Ts'o, linux-kernel

On Sat, Oct 05, 2019 at 01:36:32PM +0200, Dominik Brodowski wrote:
> Inform how many bits of randomness were provided by the bootloader,
> and whether we trust that input.
> 
> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Hsin-Yi Wang <hsinyi@chromium.org>
> Cc: Stephen Boyd <swboyd@chromium.org>
> Cc: Rob Herring <robh@kernel.org>
> Cc: Theodore Ts'o <tytso@mit.edu>
> Cc: Will Deacon <will@kernel.org>
> 
> diff --git a/drivers/char/random.c b/drivers/char/random.c
> index de434feb873a..673375e05c0d 100644
> --- a/drivers/char/random.c
> +++ b/drivers/char/random.c
> @@ -2515,6 +2515,10 @@ EXPORT_SYMBOL_GPL(add_hwgenerator_randomness);
>   */
>  void add_bootloader_randomness(const void *buf, unsigned int size)
>  {
> +	pr_notice("random: adding %u bits of %sbootloader-provided randomness",
> +		size * 8,
> +		IS_ENABLED(CONFIG_RANDOM_TRUST_BOOTLOADER) ? "trusted " : "");
> +
>  	if (IS_ENABLED(CONFIG_RANDOM_TRUST_BOOTLOADER))
>  		add_hwgenerator_randomness(buf, size, size * 8);
>  	else

Looks fine to me:

Acked-by: Will Deacon <will@kernel.org>

Will

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] random: inform about bootloader-provided randomness
  2019-10-15  0:40 ` Will Deacon
@ 2019-10-15  9:44   ` Hsin-Yi Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Hsin-Yi Wang @ 2019-10-15  9:44 UTC (permalink / raw)
  To: Will Deacon
  Cc: Dominik Brodowski, Ard Biesheuvel, Stephen Boyd, Rob Herring,
	Theodore Ts'o, lkml

On Tue, Oct 15, 2019 at 8:40 AM Will Deacon <will@kernel.org> wrote:
>
> On Sat, Oct 05, 2019 at 01:36:32PM +0200, Dominik Brodowski wrote:
> > Inform how many bits of randomness were provided by the bootloader,
> > and whether we trust that input.
> >
> > Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
> > Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > Cc: Hsin-Yi Wang <hsinyi@chromium.org>
> > Cc: Stephen Boyd <swboyd@chromium.org>
> > Cc: Rob Herring <robh@kernel.org>
> > Cc: Theodore Ts'o <tytso@mit.edu>
> > Cc: Will Deacon <will@kernel.org>
> >
> > diff --git a/drivers/char/random.c b/drivers/char/random.c
> > index de434feb873a..673375e05c0d 100644
> > --- a/drivers/char/random.c
> > +++ b/drivers/char/random.c
> > @@ -2515,6 +2515,10 @@ EXPORT_SYMBOL_GPL(add_hwgenerator_randomness);
> >   */
> >  void add_bootloader_randomness(const void *buf, unsigned int size)
> >  {
> > +     pr_notice("random: adding %u bits of %sbootloader-provided randomness",
> > +             size * 8,
> > +             IS_ENABLED(CONFIG_RANDOM_TRUST_BOOTLOADER) ? "trusted " : "");
> > +
> >       if (IS_ENABLED(CONFIG_RANDOM_TRUST_BOOTLOADER))
> >               add_hwgenerator_randomness(buf, size, size * 8);
> >       else
>
> Looks fine to me:
>
> Acked-by: Will Deacon <will@kernel.org>
>
> Will

Thanks.

Acked-by: Hsin-Yi Wang <hsinyi@chromium.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-15  9:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-05 11:36 [PATCH] random: inform about bootloader-provided randomness Dominik Brodowski
2019-10-15  0:40 ` Will Deacon
2019-10-15  9:44   ` Hsin-Yi Wang

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).