Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2206186rwb; Mon, 7 Nov 2022 10:23:16 -0800 (PST) X-Google-Smtp-Source: AMsMyM5hDhnVTHuoAlLQYoJa9a0jdRljDLQ53RRYyMbZ6xtsVkVXGhx69vz9kqrBvY/zLFJAPP95 X-Received: by 2002:a17:902:f7d3:b0:187:ecb:20d5 with SMTP id h19-20020a170902f7d300b001870ecb20d5mr48457527plw.101.1667845395792; Mon, 07 Nov 2022 10:23:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667845395; cv=none; d=google.com; s=arc-20160816; b=QTJjSF0mXZ/vnYv7LRRkUx2fqc6lpC3gcn0u/wUi1kyUUGk5DLdXxT5ymyaHspbrgP FqFLqi0rjGDCrF+/N8Gvb4OoXpwVpv0y8qmmpIl8mRzsn4Tl64i2F6R5y+TeZG9vA/kI EzFc91fEaD2RMI2y9trNfIthAeZkVE2CJf0fHFL0oosRAGtao86kuqrO0uf5yNt8TYvr ybnfXRfJgCmDVi8IqAmj81LyzyBDLVIVdstbcVGxCzAGjECdP0iwMYQuWvNo5565GfdQ S6ytitTUVq058rQnKjQq1hEESkRf9SLEX5Z87M9ZqHS0rE7vGc5WOWAs1RoFS9PzPcwF P3tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=t9OovNNP6gP/kJ0L+cQmKHEMLOb6cvJFE784hcRwJdM=; b=XsJjFv6MvEaf0NQN20nrVNDVNv01SkfGE+bmiaxODCb/jLKOnfIlZ0XMaKQOdSM1a1 7UH+a2X4WVb5CcR0PLctJI6C3ppHqqnbd8OSJg6+A58iOhkMDMSyPNQwm8bp6NMm6pjd PhhWZX9LMkk1q9kGYqNo/X+q9ZOjecUiYDUEjhHeAoyhwoDuXrqvFautC95XdF1zXbqq msp3XGMuyD7+R3NlPtNPnHqPBTexN0tHRTwACXu51CyJEa9lcn4mVaFTvbbyyijj5REn VsAa4Es+YDlMxNMZChtNAsclyJzR4JU30NJ6gEmm/OUq99I7RvIwBZkHb5AnernmZY+3 opnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hTf35uVa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x16-20020a17090a165000b0020d4f9a4b4dsi9100939pje.49.2022.11.07.10.23.03; Mon, 07 Nov 2022 10:23:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hTf35uVa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231888AbiKGR2h (ORCPT + 92 others); Mon, 7 Nov 2022 12:28:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231974AbiKGR2f (ORCPT ); Mon, 7 Nov 2022 12:28:35 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A29ED201A1; Mon, 7 Nov 2022 09:28:34 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 54441B81604; Mon, 7 Nov 2022 17:28:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBE54C4347C; Mon, 7 Nov 2022 17:28:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667842112; bh=Ru6g7W+wGFDyyGJ07Lb68mzCziUt9sT/p5kpehRvmf4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=hTf35uVaJ2NdmjJ8BWwrFAe2/tLvd5jRUPvkU0hON8duYnS/0ZWP1IlEeraN/hcuM u+0X/fH+3ltrDDABl4/EYi7LJgy8N8c+gIKPFDqsnhX4qp8j4xhMUaU+menuLrWXnP OkM9S8l0KE13RlQlZXAo+w3mpJdA+hvZc3+QHJ7D6CPS923CMQxZpw1NMgIjHFBeuD 0GyGn7qI8FBXvrFTfvz2dy4l/4CFNCWePVwTYhC/5JP1JUDWasBzNR6RWqBR/Z1mkm aI3gbuDPBe6aS1AKJUPgYzPj75/9kYB9JWbDZtSB/LaFz4PKBfgQWkqN1pjQN6zFN4 fwyeWsfZuEYMg== Received: by mail-lj1-f169.google.com with SMTP id a15so17354768ljb.7; Mon, 07 Nov 2022 09:28:31 -0800 (PST) X-Gm-Message-State: ACrzQf1rTmKHMeet56AKZCvRHmPduYAlQf9cnPt1bIl3iqUn4AotL3de FunZp3KmxfTFrdeDgl0v3qm8ZDzz4TaMbjfmrg== X-Received: by 2002:a05:651c:114a:b0:25d:5ae6:42a4 with SMTP id h10-20020a05651c114a00b0025d5ae642a4mr17881311ljo.255.1667842109994; Mon, 07 Nov 2022 09:28:29 -0800 (PST) MIME-Version: 1.0 References: <20221105014613.113503-1-Jason@zx2c4.com> In-Reply-To: <20221105014613.113503-1-Jason@zx2c4.com> From: Rob Herring Date: Mon, 7 Nov 2022 11:28:20 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] of: fdt: parse early params before adding bootloader randomness To: "Jason A. Donenfeld" Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Frank Rowand Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 4, 2022 at 8:46 PM Jason A. Donenfeld wrote: > > 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 > Cc: Frank Rowand > Signed-off-by: Jason A. Donenfeld > --- > 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(); I don't think it's good that the timing of calling this is dependent on "rng-seed" being present or not. So perhaps move it up to after the cmdline is set. Either way, the other issue is the cmdline is not necessarily fixed at this point with some architectures doing their own append/prepend/override of the cmdline. We can't seem to get common implementation there finished. I'm doubtful that corner case would actually be hit though. Rob