[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221105014613.113503-1-Jason@zx2c4.com>
Date: Sat, 5 Nov 2022 02:46:13 +0100
From: "Jason A. Donenfeld" <Jason@...c4.com>
To: devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
robh@...nel.org
Cc: "Jason A. Donenfeld" <Jason@...c4.com>,
Frank Rowand <frowand.list@...il.com>
Subject: [PATCH] of: fdt: parse early params before adding bootloader randomness
FDT is examined so early that it's before the first incidental call to
parse_early_param(). This is similar to EFI, except EFI actually added
an explicitly call to parse_early_param(). Let's do the same here, so
that specifying `random.trust_bootloader=0` is not ignored.
Fixes: d97c68d178fb ("random: treat bootloader trust toggle the same way as cpu trust toggle")
Cc: Rob Herring <robh@...nel.org>
Cc: Frank Rowand <frowand.list@...il.com>
Signed-off-by: Jason A. Donenfeld <Jason@...c4.com>
---
drivers/of/fdt.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 7b571a631639..6d959117fd4f 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -1195,6 +1195,9 @@ int __init early_init_dt_scan_chosen(char *cmdline)
rng_seed = of_get_flat_dt_prop(node, "rng-seed", &l);
if (rng_seed && l > 0) {
+ /* Parse random.trust_bootloader if it's in command line. */
+ parse_early_param();
+
add_bootloader_randomness(rng_seed, l);
/* try to clear seed so it won't be found. */
--
2.38.1
Powered by blists - more mailing lists