FAILED: patch "[PATCH] tpm: Fix TPM 1.2 Shutdown sequence to prevent future TPM" failed to apply to 4.4-stable tree
Subsystems (2)
[email protected]
maintainerThe 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 <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From db4d8cb9c9f2af71c4d087817160d866ed572cc9 Mon Sep 17 00:00:00 2001
From: Vadim Sukhomlinov <[email protected]>
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.
drivers/char/tpm/tpm-chip.c +3 -3
@@ -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 ; }