From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D5A5C74A52 for ; Thu, 11 Jul 2019 11:35:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 66B2E20665 for ; Thu, 11 Jul 2019 11:35:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562844930; bh=zSPdVecjRrYz8S8m/pHWDN3UQlzOLiatM+BdtNYgbyQ=; h=Subject:To:Cc:From:Date:List-ID:From; b=d5IsiEoVR/JwdN8vRN1YUr20xutG+OigzvIVNRsM1By7KDNNiuvZrop17XTf8oS+W ehm5dYBIfznKr6/FMAyPy+jtGkPoi2/rB1Xt6N+w9ITdLN14kiJuFyIZoVA4HKOVja Y48KNcd9uAmOfCCX4hgwBox5VQrW0oMrqkT/wlDg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728178AbfGKLfa (ORCPT ); Thu, 11 Jul 2019 07:35:30 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:51553 "EHLO wout3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728147AbfGKLf3 (ORCPT ); Thu, 11 Jul 2019 07:35:29 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id CCFF94BE; Thu, 11 Jul 2019 07:35:28 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 11 Jul 2019 07:35:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=K/a/OC 3E4WUTRStR2pAcpFQZ0e01R+eXZImQKfNsXw0=; b=NO6eigrFIE0TIhacrL43I/ HmUFBDdStJN9trpX7j6eqO1ryqX/U4KOhC26JGyER+tNSo16ITP/Cbq5ROOf93dh ScRjdILjQHQVGZV0E0M9dl0po7Ed3EQV5/BfhVN9Q5PCBwtNls/85chYILJ7eaJm E6/8Mt2kNhLaoZ6uwca8hu6znItzzjxX5/AcoIeqDYDxLG6qRGArlZdEkjQmxnca CwBROgZZ5N+qk8JnpJN2x16bzt0jP5I6jmODy/dSTaDuj5bdsXD6Bncf1r5KAvxr EgTYNoG0mVle1mBm7LyiPFVFPPXBHStTkJa5MpWTAoAR99a5ifzfRrtbNWpapoQQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrgeekgdegfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertddttd flnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhg qeenucfkphepkeefrdekiedrkeelrddutdejnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hgrhgvgheskhhrohgrhhdrtghomhenucevlhhushhtvghrufhiiigvpeei X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id E23618005B; Thu, 11 Jul 2019 07:35:27 -0400 (EDT) Subject: FAILED: patch "[PATCH] tpm: Fix TPM 1.2 Shutdown sequence to prevent future TPM" failed to apply to 4.9-stable tree To: sukhomlinov@google.com, dianders@chromium.org, jarkko.sakkinen@linux.intel.com Cc: From: Date: Thu, 11 Jul 2019 13:35:16 +0200 Message-ID: <1562844916186241@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.9-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From db4d8cb9c9f2af71c4d087817160d866ed572cc9 Mon Sep 17 00:00:00 2001 From: Vadim Sukhomlinov Date: Mon, 10 Jun 2019 15:01:18 -0700 Subject: [PATCH] tpm: Fix TPM 1.2 Shutdown sequence to prevent future TPM operations TPM 2.0 Shutdown involve sending TPM2_Shutdown to TPM chip and disabling future TPM operations. TPM 1.2 behavior was different, future TPM operations weren't disabled, causing rare issues. This patch ensures that future TPM operations are disabled. Fixes: d1bd4a792d39 ("tpm: Issue a TPM2_Shutdown for TPM2 devices.") Cc: stable@vger.kernel.org Signed-off-by: Vadim Sukhomlinov [dianders: resolved merge conflicts with mainline] Signed-off-by: Douglas Anderson Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c index 90325e1749fb..d47ad10a35fe 100644 --- a/drivers/char/tpm/tpm-chip.c +++ b/drivers/char/tpm/tpm-chip.c @@ -289,15 +289,15 @@ static int tpm_class_shutdown(struct device *dev) { struct tpm_chip *chip = container_of(dev, struct tpm_chip, dev); + down_write(&chip->ops_sem); if (chip->flags & TPM_CHIP_FLAG_TPM2) { - down_write(&chip->ops_sem); if (!tpm_chip_start(chip)) { tpm2_shutdown(chip, TPM2_SU_CLEAR); tpm_chip_stop(chip); } - chip->ops = NULL; - up_write(&chip->ops_sem); } + chip->ops = NULL; + up_write(&chip->ops_sem); return 0; }