Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp511032rwb; Fri, 4 Aug 2023 17:14:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGGcAaSxbQXawRGpcR/ujq3TQ9Pkbf1dlhRbJQVKtKfpTcVMde+Dw1nvpzv2gc7xcspjf5I X-Received: by 2002:a05:6402:104a:b0:51b:c714:a2a1 with SMTP id e10-20020a056402104a00b0051bc714a2a1mr2843623edu.7.1691194465533; Fri, 04 Aug 2023 17:14:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691194465; cv=none; d=google.com; s=arc-20160816; b=iKGZ1Wy1WzVx1bGuY4gzFaxZwx0S6bBAJw8BM3jdNMY9doHtxUg+ap3rLrwKTwKBdA qHyYW7GJW5k+FotLcCvOqLFFTNYEkvqJzGPVXZv5fCe9e4wurcQbaFFKPvIU/uykggk7 OUuU1ijqdKezNuoEntWuM5xJmbFfJvCzWv8wAlZo0Cz8ZCSNFJDXaOQBXcnX/r5XUTQ1 uiX73fWjnXUcYuP4eFjhE5NsA4IVozjgqjwGDakVLTcV8hHIBPSMW2Cz34YkWutMvyDU a3pO4a6Pp3HI2UD8+YwXdZcxpN1AeTXNHEkqPdAnkx8DXLlbVLi4on/hyR0Wt3BkrIcf CodQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:references:to:from:subject:cc :message-id:date:content-transfer-encoding:mime-version :dkim-signature; bh=GC9dXn2tSqS0bsf/sYdVuidJ1E4QtY4G+dFSYnmRr28=; fh=74luaoxf6Pi8lWtSeYalz15DXOS/YvQp4RQ802Doud0=; b=UybTzDzG8zgJAyD8rvcUicvp9BWAOa+Ps62iIVmuZad2fj0MUEL+ZHAGY12hU2f0E+ 6geuhSrKNJUs+nww+TyvmDueQLkmY0Kiy9cxhexqcJCGX9fDtqM8CcaNiUxsfc70iJ+a 9Y5/Z92EvdKsQOg7a4Wq7KP4xYp6jaiH0j8mv7pSTopLASDFnE4T02F41OLMIDScsFAD kBFA6Dqm24PCFKnO2zR6JU8YZS85Cbz76D3QlN0QH9lnMKStswImA39C15p8K36AcePG m1fHBxUhOfzIlovB7084E8uTOgQ5tMuHmImRy2FpCqZL4+gx1Js9fohZ9lnFEo2APciT KRNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DAi1vg4e; 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 l25-20020aa7c3d9000000b0051e0d7f1e3esi2251633edr.419.2023.08.04.17.14.01; Fri, 04 Aug 2023 17:14:25 -0700 (PDT) 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=DAi1vg4e; 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 S229555AbjHDWwX (ORCPT + 99 others); Fri, 4 Aug 2023 18:52:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbjHDWwW (ORCPT ); Fri, 4 Aug 2023 18:52:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B030E1BE; Fri, 4 Aug 2023 15:52:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4A69262153; Fri, 4 Aug 2023 22:52:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60FF5C433C8; Fri, 4 Aug 2023 22:52:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691189540; bh=JTeFe3yU6FTfVxHVzbN6FFW+rwd+24FgVbF4IkXJvlw=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=DAi1vg4eGxZeRFG/j0+u3c83hJLIbyd5rrNPN+GakXezFYR7UzPD4UHChAxacNgfJ DcHb5ebX5RuJU9SDUDhWp7T10+i/KIChH3R+I/R1AY/bBii49/ffrK4qqlt+11sLTZ WMkUwGvNs5uDHae2qEcp2LQGpBVcV7kknLzhad2qf9XpbYa+ENQ90hEVHzt+y73UEj pWDVwAtSpidxjyqKN8gZguNdOuJXaMTGrMVNlEyQZoYE+zl6Yk+nmQW8nOzxknDgQX i++eBS8qKRsmFzwEd2SWdBTN3lCynHfhK0OLxWTqcyf1rvGdThOrxomXXiplL3HMFp xZT3e6RUognhQ== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sat, 05 Aug 2023 01:52:17 +0300 Message-Id: Cc: , , , Subject: Re: [PATCH 1/3] tpm: Add a missing check for TPM_CHIP_FLAG_HWRNG_DISABLED From: "Jarkko Sakkinen" To: "Jason A. Donenfeld" , "Mario Limonciello" X-Mailer: aerc 0.15.2 References: <20230803015015.915-1-mario.limonciello@amd.com> <20230803015015.915-2-mario.limonciello@amd.com> In-Reply-To: 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 Thu Aug 3, 2023 at 4:50 PM EEST, Jason A. Donenfeld wrote: > On Thu, Aug 03, 2023 at 06:35:36AM -0500, Mario Limonciello wrote: > > On 8/3/23 03:59, Jarkko Sakkinen wrote: > > > On Thu Aug 3, 2023 at 4:50 AM EEST, Mario Limonciello wrote: > > >> If the TPM is opted out of hwrng the error handling for > > >> tpm_chip_register() needs to know this so it doesn't try to clean > > >> up an uninitialized chip->hwrng. > > >> > > >> Signed-off-by: Mario Limonciello > > >> --- > > >> drivers/char/tpm/tpm-chip.c | 3 ++- > > >> 1 file changed, 2 insertions(+), 1 deletion(-) > > >> > > >> diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip= .c > > >> index e904aae9771be..8f61b784810d6 100644 > > >> --- a/drivers/char/tpm/tpm-chip.c > > >> +++ b/drivers/char/tpm/tpm-chip.c > > >> @@ -629,7 +629,8 @@ int tpm_chip_register(struct tpm_chip *chip) > > >> return 0; > > >> =20 > > >> out_hwrng: > > >> - if (IS_ENABLED(CONFIG_HW_RANDOM_TPM) && !tpm_is_firmware_upgrade(c= hip)) > > >> + if (IS_ENABLED(CONFIG_HW_RANDOM_TPM) && !tpm_is_firmware_upgrade(c= hip) && > > >> + !(chip->flags & TPM_CHIP_FLAG_HWRNG_DISABLED)) > > >> hwrng_unregister(&chip->hwrng); > > >> out_ppi: > > >> tpm_bios_log_teardown(chip); > > >> --=20 > > >> 2.34.1 > > >=20 > > > Please add a fixes tag. > > >=20 > > > BR, Jarkko > >=20 > > I didn't add a fixes tag because you hadn't sent a PR for the other one= =20 > > yet so I wasn't sure the hash would be stable. Also I thought it might= =20 > > just make sense to squash into it. > >=20 > > If the hash is now stable, could you just just commit and add that tag= =20 > > with it yourself? Or do you want me to re-send as a v2 with that? > > What about just sending a v3 of the patch that this patch fixes? The > stable@/fixes tags in that are wrong/incomplete so Jarkko's tree will > need to be fixed before pushing to Linus anyway. Sounds reasonable. I can hold the PR to rc6 and send it on Monday. BR, Jarkko