* [PATCH 3/3] tpm: Fix TPM 1.2 Shutdown sequence to prevent future TPM operations
[not found] <20190924140202.11360-1-jarkko.sakkinen@linux.intel.com>
@ 2019-09-24 14:02 ` Jarkko Sakkinen
0 siblings, 0 replies; 12+ messages in thread
From: Jarkko Sakkinen @ 2019-09-24 14:02 UTC (permalink / raw)
To: linux-stable
Cc: Vadim Sukhomlinov, stable, Douglas Anderson, Jarkko Sakkinen,
Peter Huewe, Jason Gunthorpe, Arnd Bergmann, Greg Kroah-Hartman,
open list:TPM DEVICE DRIVER, open list
From: Vadim Sukhomlinov <sukhomlinov@google.com>
commit db4d8cb9c9f2af71c4d087817160d866ed572cc9 upstream
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 <sukhomlinov@google.com>
[dianders: resolved merge conflicts with mainline]
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
drivers/char/tpm/tpm-chip.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c
index 0eca20c5a80c..ede8c1deca97 100644
--- a/drivers/char/tpm/tpm-chip.c
+++ b/drivers/char/tpm/tpm-chip.c
@@ -158,12 +158,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);
tpm2_shutdown(chip, TPM2_SU_CLEAR);
chip->ops = NULL;
up_write(&chip->ops_sem);
}
+ chip->ops = NULL;
+ up_write(&chip->ops_sem);
return 0;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/3] tpm: Fix TPM 1.2 Shutdown sequence to prevent future TPM operations
[not found] <20190925101532.31280-1-jarkko.sakkinen@linux.intel.com>
@ 2019-09-25 10:15 ` Jarkko Sakkinen
2019-09-26 23:22 ` Sasha Levin
0 siblings, 1 reply; 12+ messages in thread
From: Jarkko Sakkinen @ 2019-09-25 10:15 UTC (permalink / raw)
To: linux-integrity
Cc: Vadim Sukhomlinov, stable, Douglas Anderson, Jarkko Sakkinen,
Peter Huewe, Jason Gunthorpe, Arnd Bergmann, Greg Kroah-Hartman,
open list
From: Vadim Sukhomlinov <sukhomlinov@google.com>
commit db4d8cb9c9f2af71c4d087817160d866ed572cc9 upstream
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 <sukhomlinov@google.com>
[dianders: resolved merge conflicts with mainline]
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
drivers/char/tpm/tpm-chip.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c
index 0eca20c5a80c..ede8c1deca97 100644
--- a/drivers/char/tpm/tpm-chip.c
+++ b/drivers/char/tpm/tpm-chip.c
@@ -158,12 +158,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);
tpm2_shutdown(chip, TPM2_SU_CLEAR);
chip->ops = NULL;
up_write(&chip->ops_sem);
}
+ chip->ops = NULL;
+ up_write(&chip->ops_sem);
return 0;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] tpm: Fix TPM 1.2 Shutdown sequence to prevent future TPM operations
2019-09-25 10:15 ` Jarkko Sakkinen
@ 2019-09-26 23:22 ` Sasha Levin
0 siblings, 0 replies; 12+ messages in thread
From: Sasha Levin @ 2019-09-26 23:22 UTC (permalink / raw)
To: Jarkko Sakkinen
Cc: linux-integrity, Vadim Sukhomlinov, stable, Douglas Anderson,
Peter Huewe, Jason Gunthorpe, Arnd Bergmann, Greg Kroah-Hartman,
open list
On Wed, Sep 25, 2019 at 01:15:32PM +0300, Jarkko Sakkinen wrote:
>From: Vadim Sukhomlinov <sukhomlinov@google.com>
>
>commit db4d8cb9c9f2af71c4d087817160d866ed572cc9 upstream
>
>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 <sukhomlinov@google.com>
>[dianders: resolved merge conflicts with mainline]
>Signed-off-by: Douglas Anderson <dianders@chromium.org>
>Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
>Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
I've queued it up for 4.19 and 4.14, thanks!
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 3/3] tpm: Fix TPM 1.2 Shutdown sequence to prevent future TPM operations
[not found] <20191002131445.7793-1-jarkko.sakkinen@linux.intel.com>
@ 2019-10-02 13:14 ` Jarkko Sakkinen
2019-10-02 13:57 ` Greg KH
0 siblings, 1 reply; 12+ messages in thread
From: Jarkko Sakkinen @ 2019-10-02 13:14 UTC (permalink / raw)
To: linux-stabley
Cc: Vadim Sukhomlinov, stable, Douglas Anderson, Jarkko Sakkinen,
Peter Huewe, Jason Gunthorpe, open list:TPM DEVICE DRIVER,
open list
From: Vadim Sukhomlinov <sukhomlinov@google.com>
commit db4d8cb9c9f2af71c4d087817160d866ed572cc9 upstream
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 <sukhomlinov@google.com>
[dianders: resolved merge conflicts with mainline]
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
drivers/char/tpm/tpm-chip.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c
index 0eca20c5a80c..dcf5bb153495 100644
--- a/drivers/char/tpm/tpm-chip.c
+++ b/drivers/char/tpm/tpm-chip.c
@@ -158,12 +158,13 @@ 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);
tpm2_shutdown(chip, TPM2_SU_CLEAR);
chip->ops = NULL;
- up_write(&chip->ops_sem);
}
+ chip->ops = NULL;
+ up_write(&chip->ops_sem);
return 0;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] tpm: Fix TPM 1.2 Shutdown sequence to prevent future TPM operations
2019-10-02 13:14 ` [PATCH 3/3] tpm: Fix TPM 1.2 Shutdown sequence to prevent future TPM operations Jarkko Sakkinen
@ 2019-10-02 13:57 ` Greg KH
2019-10-02 15:17 ` Sasha Levin
0 siblings, 1 reply; 12+ messages in thread
From: Greg KH @ 2019-10-02 13:57 UTC (permalink / raw)
To: Jarkko Sakkinen
Cc: linux-stabley, Vadim Sukhomlinov, stable, Douglas Anderson,
Peter Huewe, Jason Gunthorpe, open list:TPM DEVICE DRIVER,
open list
On Wed, Oct 02, 2019 at 04:14:44PM +0300, Jarkko Sakkinen wrote:
> From: Vadim Sukhomlinov <sukhomlinov@google.com>
>
> commit db4d8cb9c9f2af71c4d087817160d866ed572cc9 upstream
>
> 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 <sukhomlinov@google.com>
> [dianders: resolved merge conflicts with mainline]
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> ---
> drivers/char/tpm/tpm-chip.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
What kernel version(s) is this for?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] tpm: Fix TPM 1.2 Shutdown sequence to prevent future TPM operations
2019-10-02 13:57 ` Greg KH
@ 2019-10-02 15:17 ` Sasha Levin
2019-10-02 15:31 ` Jerry Snitselaar
0 siblings, 1 reply; 12+ messages in thread
From: Sasha Levin @ 2019-10-02 15:17 UTC (permalink / raw)
To: Greg KH
Cc: Jarkko Sakkinen, linux-stabley, Vadim Sukhomlinov, stable,
Douglas Anderson, Peter Huewe, Jason Gunthorpe,
open list:TPM DEVICE DRIVER, open list
On Wed, Oct 02, 2019 at 03:57:58PM +0200, Greg KH wrote:
>On Wed, Oct 02, 2019 at 04:14:44PM +0300, Jarkko Sakkinen wrote:
>> From: Vadim Sukhomlinov <sukhomlinov@google.com>
>>
>> commit db4d8cb9c9f2af71c4d087817160d866ed572cc9 upstream
>>
>> 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 <sukhomlinov@google.com>
>> [dianders: resolved merge conflicts with mainline]
>> Signed-off-by: Douglas Anderson <dianders@chromium.org>
>> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
>> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
>> ---
>> drivers/char/tpm/tpm-chip.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>
>What kernel version(s) is this for?
It would go to 4.19, we've recently reverted an incorrect backport of
this patch.
Jarkko, why is this patch 3/3? We haven't seen the first two on the
mailing list, do we need anything besides this patch?
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] tpm: Fix TPM 1.2 Shutdown sequence to prevent future TPM operations
2019-10-02 15:17 ` Sasha Levin
@ 2019-10-02 15:31 ` Jerry Snitselaar
2019-10-02 15:42 ` Jerry Snitselaar
0 siblings, 1 reply; 12+ messages in thread
From: Jerry Snitselaar @ 2019-10-02 15:31 UTC (permalink / raw)
To: Sasha Levin
Cc: Greg KH, Jarkko Sakkinen, linux-stabley, Vadim Sukhomlinov,
stable, Douglas Anderson, Peter Huewe, Jason Gunthorpe,
open list:TPM DEVICE DRIVER, open list
On Wed Oct 02 19, Sasha Levin wrote:
>On Wed, Oct 02, 2019 at 03:57:58PM +0200, Greg KH wrote:
>>On Wed, Oct 02, 2019 at 04:14:44PM +0300, Jarkko Sakkinen wrote:
>>>From: Vadim Sukhomlinov <sukhomlinov@google.com>
>>>
>>>commit db4d8cb9c9f2af71c4d087817160d866ed572cc9 upstream
>>>
>>>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 <sukhomlinov@google.com>
>>>[dianders: resolved merge conflicts with mainline]
>>>Signed-off-by: Douglas Anderson <dianders@chromium.org>
>>>Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
>>>Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
>>>---
>>> drivers/char/tpm/tpm-chip.c | 5 +++--
>>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>>What kernel version(s) is this for?
>
>It would go to 4.19, we've recently reverted an incorrect backport of
>this patch.
>
>Jarkko, why is this patch 3/3? We haven't seen the first two on the
>mailing list, do we need anything besides this patch?
>
>--
>Thanks,
>Sasha
It looks like there was a problem mailing the earlier patchset, and patches 1 and 2
weren't cc'd to stable, but patch 3 was.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] tpm: Fix TPM 1.2 Shutdown sequence to prevent future TPM operations
2019-10-02 15:31 ` Jerry Snitselaar
@ 2019-10-02 15:42 ` Jerry Snitselaar
2019-10-02 16:09 ` Greg KH
2019-10-03 11:24 ` Jarkko Sakkinen
0 siblings, 2 replies; 12+ messages in thread
From: Jerry Snitselaar @ 2019-10-02 15:42 UTC (permalink / raw)
To: Sasha Levin, Greg KH, Jarkko Sakkinen, linux-stabley,
Vadim Sukhomlinov, stable, Douglas Anderson, Peter Huewe,
Jason Gunthorpe, open list:TPM DEVICE DRIVER, open list
On Wed Oct 02 19, Jerry Snitselaar wrote:
>On Wed Oct 02 19, Sasha Levin wrote:
>>On Wed, Oct 02, 2019 at 03:57:58PM +0200, Greg KH wrote:
>>>On Wed, Oct 02, 2019 at 04:14:44PM +0300, Jarkko Sakkinen wrote:
>>>>From: Vadim Sukhomlinov <sukhomlinov@google.com>
>>>>
>>>>commit db4d8cb9c9f2af71c4d087817160d866ed572cc9 upstream
>>>>
>>>>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 <sukhomlinov@google.com>
>>>>[dianders: resolved merge conflicts with mainline]
>>>>Signed-off-by: Douglas Anderson <dianders@chromium.org>
>>>>Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
>>>>Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
>>>>---
>>>>drivers/char/tpm/tpm-chip.c | 5 +++--
>>>>1 file changed, 3 insertions(+), 2 deletions(-)
>>>
>>>What kernel version(s) is this for?
>>
>>It would go to 4.19, we've recently reverted an incorrect backport of
>>this patch.
>>
>>Jarkko, why is this patch 3/3? We haven't seen the first two on the
>>mailing list, do we need anything besides this patch?
>>
>>--
>>Thanks,
>>Sasha
>
>It looks like there was a problem mailing the earlier patchset, and patches 1 and 2
>weren't cc'd to stable, but patch 3 was.
Is linux-stabley@vger.kernel.org a valid address?
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] tpm: Fix TPM 1.2 Shutdown sequence to prevent future TPM operations
2019-10-02 15:42 ` Jerry Snitselaar
@ 2019-10-02 16:09 ` Greg KH
2019-10-03 11:24 ` Jarkko Sakkinen
1 sibling, 0 replies; 12+ messages in thread
From: Greg KH @ 2019-10-02 16:09 UTC (permalink / raw)
To: Sasha Levin, Jarkko Sakkinen, linux-stabley, Vadim Sukhomlinov,
stable, Douglas Anderson, Peter Huewe, Jason Gunthorpe,
open list:TPM DEVICE DRIVER, open list
On Wed, Oct 02, 2019 at 08:42:04AM -0700, Jerry Snitselaar wrote:
> On Wed Oct 02 19, Jerry Snitselaar wrote:
> > On Wed Oct 02 19, Sasha Levin wrote:
> > > On Wed, Oct 02, 2019 at 03:57:58PM +0200, Greg KH wrote:
> > > > On Wed, Oct 02, 2019 at 04:14:44PM +0300, Jarkko Sakkinen wrote:
> > > > > From: Vadim Sukhomlinov <sukhomlinov@google.com>
> > > > >
> > > > > commit db4d8cb9c9f2af71c4d087817160d866ed572cc9 upstream
> > > > >
> > > > > 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 <sukhomlinov@google.com>
> > > > > [dianders: resolved merge conflicts with mainline]
> > > > > Signed-off-by: Douglas Anderson <dianders@chromium.org>
> > > > > Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > > > > Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > > > > ---
> > > > > drivers/char/tpm/tpm-chip.c | 5 +++--
> > > > > 1 file changed, 3 insertions(+), 2 deletions(-)
> > > >
> > > > What kernel version(s) is this for?
> > >
> > > It would go to 4.19, we've recently reverted an incorrect backport of
> > > this patch.
> > >
> > > Jarkko, why is this patch 3/3? We haven't seen the first two on the
> > > mailing list, do we need anything besides this patch?
> > >
> > > --
> > > Thanks,
> > > Sasha
> >
> > It looks like there was a problem mailing the earlier patchset, and patches 1 and 2
> > weren't cc'd to stable, but patch 3 was.
>
> Is linux-stabley@vger.kernel.org a valid address?
>
Heh, no :)
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 3/3] tpm: Fix TPM 1.2 Shutdown sequence to prevent future TPM operations
[not found] <20191003112424.9036-1-jarkko.sakkinen@linux.intel.com>
@ 2019-10-03 11:24 ` Jarkko Sakkinen
0 siblings, 0 replies; 12+ messages in thread
From: Jarkko Sakkinen @ 2019-10-03 11:24 UTC (permalink / raw)
To: linux-stable
Cc: Vadim Sukhomlinov, stable, Douglas Anderson, Jarkko Sakkinen,
Peter Huewe, Jason Gunthorpe, Arnd Bergmann, Greg Kroah-Hartman,
open list:TPM DEVICE DRIVER, open list
From: Vadim Sukhomlinov <sukhomlinov@google.com>
commit db4d8cb9c9f2af71c4d087817160d866ed572cc9 upstream
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 <sukhomlinov@google.com>
[dianders: resolved merge conflicts with mainline]
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
drivers/char/tpm/tpm-chip.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c
index 0eca20c5a80c..dcf5bb153495 100644
--- a/drivers/char/tpm/tpm-chip.c
+++ b/drivers/char/tpm/tpm-chip.c
@@ -158,12 +158,13 @@ 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);
tpm2_shutdown(chip, TPM2_SU_CLEAR);
chip->ops = NULL;
- up_write(&chip->ops_sem);
}
+ chip->ops = NULL;
+ up_write(&chip->ops_sem);
return 0;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] tpm: Fix TPM 1.2 Shutdown sequence to prevent future TPM operations
2019-10-02 15:42 ` Jerry Snitselaar
2019-10-02 16:09 ` Greg KH
@ 2019-10-03 11:24 ` Jarkko Sakkinen
2019-10-03 11:25 ` Jarkko Sakkinen
1 sibling, 1 reply; 12+ messages in thread
From: Jarkko Sakkinen @ 2019-10-03 11:24 UTC (permalink / raw)
To: Sasha Levin, Greg KH, linux-stabley, Vadim Sukhomlinov, stable,
Douglas Anderson, Peter Huewe, Jason Gunthorpe,
open list:TPM DEVICE DRIVER, open list
On Wed, Oct 02, 2019 at 08:42:04AM -0700, Jerry Snitselaar wrote:
> On Wed Oct 02 19, Jerry Snitselaar wrote:
> > On Wed Oct 02 19, Sasha Levin wrote:
> > > On Wed, Oct 02, 2019 at 03:57:58PM +0200, Greg KH wrote:
> > > > On Wed, Oct 02, 2019 at 04:14:44PM +0300, Jarkko Sakkinen wrote:
> > > > > From: Vadim Sukhomlinov <sukhomlinov@google.com>
> > > > >
> > > > > commit db4d8cb9c9f2af71c4d087817160d866ed572cc9 upstream
> > > > >
> > > > > 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 <sukhomlinov@google.com>
> > > > > [dianders: resolved merge conflicts with mainline]
> > > > > Signed-off-by: Douglas Anderson <dianders@chromium.org>
> > > > > Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > > > > Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > > > > ---
> > > > > drivers/char/tpm/tpm-chip.c | 5 +++--
> > > > > 1 file changed, 3 insertions(+), 2 deletions(-)
> > > >
> > > > What kernel version(s) is this for?
> > >
> > > It would go to 4.19, we've recently reverted an incorrect backport of
> > > this patch.
> > >
> > > Jarkko, why is this patch 3/3? We haven't seen the first two on the
> > > mailing list, do we need anything besides this patch?
> > >
> > > --
> > > Thanks,
> > > Sasha
> >
> > It looks like there was a problem mailing the earlier patchset, and patches 1 and 2
> > weren't cc'd to stable, but patch 3 was.
>
> Is linux-stabley@vger.kernel.org a valid address?
>
No, did a resend :-(
/Jarkko
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] tpm: Fix TPM 1.2 Shutdown sequence to prevent future TPM operations
2019-10-03 11:24 ` Jarkko Sakkinen
@ 2019-10-03 11:25 ` Jarkko Sakkinen
0 siblings, 0 replies; 12+ messages in thread
From: Jarkko Sakkinen @ 2019-10-03 11:25 UTC (permalink / raw)
To: Sasha Levin, Greg KH, linux-stabley, Vadim Sukhomlinov, stable,
Douglas Anderson, Peter Huewe, Jason Gunthorpe,
open list:TPM DEVICE DRIVER, open list
On Thu, Oct 03, 2019 at 02:24:42PM +0300, Jarkko Sakkinen wrote:
> On Wed, Oct 02, 2019 at 08:42:04AM -0700, Jerry Snitselaar wrote:
> > On Wed Oct 02 19, Jerry Snitselaar wrote:
> > > On Wed Oct 02 19, Sasha Levin wrote:
> > > > On Wed, Oct 02, 2019 at 03:57:58PM +0200, Greg KH wrote:
> > > > > On Wed, Oct 02, 2019 at 04:14:44PM +0300, Jarkko Sakkinen wrote:
> > > > > > From: Vadim Sukhomlinov <sukhomlinov@google.com>
> > > > > >
> > > > > > commit db4d8cb9c9f2af71c4d087817160d866ed572cc9 upstream
> > > > > >
> > > > > > 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 <sukhomlinov@google.com>
> > > > > > [dianders: resolved merge conflicts with mainline]
> > > > > > Signed-off-by: Douglas Anderson <dianders@chromium.org>
> > > > > > Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > > > > > Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > > > > > ---
> > > > > > drivers/char/tpm/tpm-chip.c | 5 +++--
> > > > > > 1 file changed, 3 insertions(+), 2 deletions(-)
> > > > >
> > > > > What kernel version(s) is this for?
> > > >
> > > > It would go to 4.19, we've recently reverted an incorrect backport of
> > > > this patch.
> > > >
> > > > Jarkko, why is this patch 3/3? We haven't seen the first two on the
> > > > mailing list, do we need anything besides this patch?
> > > >
> > > > --
> > > > Thanks,
> > > > Sasha
> > >
> > > It looks like there was a problem mailing the earlier patchset, and patches 1 and 2
> > > weren't cc'd to stable, but patch 3 was.
> >
> > Is linux-stabley@vger.kernel.org a valid address?
> >
>
> No, did a resend :-(
New version sent to stableish@vger.kernel.org.
/Jarkko
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2019-10-03 11:25 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20191002131445.7793-1-jarkko.sakkinen@linux.intel.com>
2019-10-02 13:14 ` [PATCH 3/3] tpm: Fix TPM 1.2 Shutdown sequence to prevent future TPM operations Jarkko Sakkinen
2019-10-02 13:57 ` Greg KH
2019-10-02 15:17 ` Sasha Levin
2019-10-02 15:31 ` Jerry Snitselaar
2019-10-02 15:42 ` Jerry Snitselaar
2019-10-02 16:09 ` Greg KH
2019-10-03 11:24 ` Jarkko Sakkinen
2019-10-03 11:25 ` Jarkko Sakkinen
[not found] <20191003112424.9036-1-jarkko.sakkinen@linux.intel.com>
2019-10-03 11:24 ` Jarkko Sakkinen
[not found] <20190925101532.31280-1-jarkko.sakkinen@linux.intel.com>
2019-09-25 10:15 ` Jarkko Sakkinen
2019-09-26 23:22 ` Sasha Levin
[not found] <20190924140202.11360-1-jarkko.sakkinen@linux.intel.com>
2019-09-24 14:02 ` Jarkko Sakkinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).