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 0E97DC74A4B for ; Thu, 11 Jul 2019 11:35:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DC14720665 for ; Thu, 11 Jul 2019 11:35:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562844931; bh=+UQfbtK9Yv2RzPL3hJKwvmqWvux4owcaJvTE5aDs9lc=; h=Subject:To:Cc:From:Date:List-ID:From; b=kcKAiTpojpGgwriGDPG2keMGPyVnO8ndhbxie2rrkwmzHRWbe4dDCZjmSSgtHg7ra MQmLhpYHw3tOn7UbaQZeUYp72OWlX1IeXwEYNrGfaMA/L0bpoIWJ+b3tz5lZQr12qU ErHnq61nkm8U8olUXBTPjJx70hLbiYTncVSwvpy4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728147AbfGKLfb (ORCPT ); Thu, 11 Jul 2019 07:35:31 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:59489 "EHLO wout3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728026AbfGKLfb (ORCPT ); Thu, 11 Jul 2019 07:35:31 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 4AFFE4C2; Thu, 11 Jul 2019 07:35:30 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 11 Jul 2019 07:35:30 -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=ktndRl 7/AoNjvQ/OAkPDt1o3AOaz8QExNt3VSGQ3wzA=; b=h2Ed5jmCvtgWZ+dsvWGu6h b7qGFB5wJJk/ZadWezZGfU4W4Eh+llVXbezKj6oPjJpKkk65qE4uW8gZGmWsfhuh HgUdpmZelAT8JXpdLbQW20WATJjzay8SXr0jdkV/Q36OdifKxCOC1w8JMfN2/6I0 lHn2tG3iVMnEZXYOgPZHBlbLtUB0KAFw/bQFQZF6TDA/fSkVY9j3cg/Dctp1rX9G l5pja9szg2xpWcfvqpjmaRBj16khBABUgWjZ0uW5H9xYB+uPtJBP5Z+Jw7Qsg07v wmUHJmJ+Nn/8/tHSDWbr6LpnkVXu+Lqv0vesTddCsLlRJcgjooDHZkfPtdG9lq2A == 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 798828005A; Thu, 11 Jul 2019 07:35:29 -0400 (EDT) Subject: FAILED: patch "[PATCH] tpm: Fix TPM 1.2 Shutdown sequence to prevent future TPM" failed to apply to 4.4-stable tree To: sukhomlinov@google.com, dianders@chromium.org, jarkko.sakkinen@linux.intel.com Cc: From: Date: Thu, 11 Jul 2019 13:35:17 +0200 Message-ID: <1562844917083@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.4-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; }