From patchwork Mon Mar 20 11:15:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: James Bottomley X-Patchwork-Id: 13181045 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BAE7C7618A for ; Mon, 20 Mar 2023 11:17:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230368AbjCTLRo (ORCPT ); Mon, 20 Mar 2023 07:17:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231229AbjCTLRL (ORCPT ); Mon, 20 Mar 2023 07:17:11 -0400 Received: from bedivere.hansenpartnership.com (bedivere.hansenpartnership.com [96.44.175.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 196164EDF for ; Mon, 20 Mar 2023 04:15:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1679310956; bh=exZ+3P/94LPmSvcJJ78/XPU0RxAl6qqxpEcxgrN5IKE=; h=Message-ID:Subject:From:To:Date:From; b=B+fRDkVHfqQu9yghWAZh/gPeO8rpj5MoLKDEIUuNU3ZqWRq6dZc7epu03v33Cpcok KE2mUv0n82q6Wt2yzUotkp9JPQdmS9zq7onuQsdW8ovXbmXsQFtwW8WRWPp32qwMN1 +ra+iByt6JyLd7hR2u0soI1zx5K7b/CuVWjL7xLU= Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 675C91285E71; Mon, 20 Mar 2023 07:15:56 -0400 (EDT) Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavis, port 10024) with ESMTP id PYQ_y0O1JCG4; Mon, 20 Mar 2023 07:15:56 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1679310956; bh=exZ+3P/94LPmSvcJJ78/XPU0RxAl6qqxpEcxgrN5IKE=; h=Message-ID:Subject:From:To:Date:From; b=B+fRDkVHfqQu9yghWAZh/gPeO8rpj5MoLKDEIUuNU3ZqWRq6dZc7epu03v33Cpcok KE2mUv0n82q6Wt2yzUotkp9JPQdmS9zq7onuQsdW8ovXbmXsQFtwW8WRWPp32qwMN1 +ra+iByt6JyLd7hR2u0soI1zx5K7b/CuVWjL7xLU= Received: from [172.20.7.43] (96-86-69-187-static.hfc.comcastbusiness.net [96.86.69.187]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id B83D412819BC; Mon, 20 Mar 2023 07:15:55 -0400 (EDT) Message-ID: Subject: tpm: fix build break in tpm-chip.c caused by AMD fTPM quirk From: James Bottomley To: linux-integrity@vger.kernel.org Cc: Jarkko Sakkinen , "Jason A. Donenfeld" , Mario Limonciello Date: Mon, 20 Mar 2023 07:15:52 -0400 User-Agent: Evolution 3.42.4 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org The test for the AMD fTPM problem, which just went in, actually uses the wrong function template for request_locality(). It's missing an argument so the build breaks: drivers/char/tpm/tpm-chip.c:568:8: error: too few arguments to function ‘tpm_request_locality’ ret = tpm_request_locality(chip); ^~~~~~~~~~~~~~~~~~~~ drivers/char/tpm/tpm-chip.c:43:12: note: declared here static int tpm_request_locality(struct tpm_chip *chip, int locality) ^~~~~~~~~~~~~~~~~~~~ Fix this by requesting zero locality. Signed-off-by: James Bottomley Fixes: f1324bbc4011 ("tpm: disable hwrng for fTPM on some AMD designs") diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c index c04d101c7779..fee061780468 100644 --- a/drivers/char/tpm/tpm-chip.c +++ b/drivers/char/tpm/tpm-chip.c @@ -565,7 +565,7 @@ static bool tpm_amd_is_rng_defective(struct tpm_chip *chip) if (!(chip->flags & TPM_CHIP_FLAG_TPM2)) return false; - ret = tpm_request_locality(chip); + ret = tpm_request_locality(chip, 0); if (ret) return false;