linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tpm: allow TCPA log area to be empty
@ 2018-03-10 16:16 Jarkko Sakkinen
  2018-03-12 11:09 ` Jarkko Sakkinen
  2018-03-12 15:02 ` Jason Gunthorpe
  0 siblings, 2 replies; 11+ messages in thread
From: Jarkko Sakkinen @ 2018-03-10 16:16 UTC (permalink / raw)
  To: linux-integrity
  Cc: linux-security-module, Sahil Rihan, Alexei Starovoitov,
	Jarkko Sakkinen, stable, Peter Huewe, Jason Gunthorpe,
	Arnd Bergmann, Greg Kroah-Hartman, open list

TCPA log are can be empty when the TPM is disabled. This commit changes the
behavior of tpm_read_log_acpi() to return successfully in this case.

Cc: stable@vger.kernel.org
Fixes: 55a82ab3181b ("[PATCH] tpm: add bios measurement log")
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
 drivers/char/tpm/tpm_eventlog_acpi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/char/tpm/tpm_eventlog_acpi.c b/drivers/char/tpm/tpm_eventlog_acpi.c
index 66f19e93c216..f5f66dcd6f30 100644
--- a/drivers/char/tpm/tpm_eventlog_acpi.c
+++ b/drivers/char/tpm/tpm_eventlog_acpi.c
@@ -84,8 +84,8 @@ int tpm_read_log_acpi(struct tpm_chip *chip)
 		break;
 	}
 	if (!len) {
-		dev_warn(&chip->dev, "%s: TCPA log area empty\n", __func__);
-		return -EIO;
+		dev_info(&chip->dev, "TCPA log area is empty\n");
+		return 0;
 	}
 
 	/* malloc EventLog space */
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] tpm: allow TCPA log area to be empty
  2018-03-10 16:16 [PATCH] tpm: allow TCPA log area to be empty Jarkko Sakkinen
@ 2018-03-12 11:09 ` Jarkko Sakkinen
  2018-03-12 15:02 ` Jason Gunthorpe
  1 sibling, 0 replies; 11+ messages in thread
From: Jarkko Sakkinen @ 2018-03-12 11:09 UTC (permalink / raw)
  To: linux-integrity
  Cc: linux-security-module, Sahil Rihan, Alexei Starovoitov, stable,
	Peter Huewe, Jason Gunthorpe, Arnd Bergmann, Greg Kroah-Hartman,
	open list

On Sat, Mar 10, 2018 at 06:16:37PM +0200, Jarkko Sakkinen wrote:
> TCPA log are can be empty when the TPM is disabled. This commit changes the
> behavior of tpm_read_log_acpi() to return successfully in this case.
> 
> Cc: stable@vger.kernel.org
> Fixes: 55a82ab3181b ("[PATCH] tpm: add bios measurement log")
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

Already applied to my master (bleeding edge) branch in order to
facilitate testing:

git://git.infradead.org/users/jjs/linux-tpmdd.git

/Jarkko

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] tpm: allow TCPA log area to be empty
  2018-03-10 16:16 [PATCH] tpm: allow TCPA log area to be empty Jarkko Sakkinen
  2018-03-12 11:09 ` Jarkko Sakkinen
@ 2018-03-12 15:02 ` Jason Gunthorpe
  2018-03-16 12:55   ` Jarkko Sakkinen
  1 sibling, 1 reply; 11+ messages in thread
From: Jason Gunthorpe @ 2018-03-12 15:02 UTC (permalink / raw)
  To: Jarkko Sakkinen
  Cc: linux-integrity, linux-security-module, Sahil Rihan,
	Alexei Starovoitov, stable, Peter Huewe, Arnd Bergmann,
	Greg Kroah-Hartman, open list

On Sat, Mar 10, 2018 at 06:16:37PM +0200, Jarkko Sakkinen wrote:
> TCPA log are can be empty when the TPM is disabled. This commit changes the
> behavior of tpm_read_log_acpi() to return successfully in this case.

The commit should explain why we'd want this..

eg Why does it matter to create the extra sysfs files to report an empty
log?

Jason

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] tpm: allow TCPA log area to be empty
  2018-03-12 15:02 ` Jason Gunthorpe
@ 2018-03-16 12:55   ` Jarkko Sakkinen
  2018-03-19  2:13     ` Jason Gunthorpe
  0 siblings, 1 reply; 11+ messages in thread
From: Jarkko Sakkinen @ 2018-03-16 12:55 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: linux-integrity, linux-security-module, Sahil Rihan,
	Alexei Starovoitov, stable, Peter Huewe, Arnd Bergmann,
	Greg Kroah-Hartman, open list

On Mon, Mar 12, 2018 at 09:02:32AM -0600, Jason Gunthorpe wrote:
> On Sat, Mar 10, 2018 at 06:16:37PM +0200, Jarkko Sakkinen wrote:
> > TCPA log are can be empty when the TPM is disabled. This commit changes the
> > behavior of tpm_read_log_acpi() to return successfully in this case.
> 
> The commit should explain why we'd want this..
> 
> eg Why does it matter to create the extra sysfs files to report an empty
> log?
> 
> Jason

The initialization of the driver will fail otherwise. Not sure if I
understand your question.

/Jarkko

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] tpm: allow TCPA log area to be empty
  2018-03-16 12:55   ` Jarkko Sakkinen
@ 2018-03-19  2:13     ` Jason Gunthorpe
  2018-03-19 21:24       ` Jarkko Sakkinen
  0 siblings, 1 reply; 11+ messages in thread
From: Jason Gunthorpe @ 2018-03-19  2:13 UTC (permalink / raw)
  To: Jarkko Sakkinen
  Cc: linux-integrity, linux-security-module, Sahil Rihan,
	Alexei Starovoitov, stable, Peter Huewe, Arnd Bergmann,
	Greg Kroah-Hartman, open list

On Fri, Mar 16, 2018 at 02:55:25PM +0200, Jarkko Sakkinen wrote:
> On Mon, Mar 12, 2018 at 09:02:32AM -0600, Jason Gunthorpe wrote:
> > On Sat, Mar 10, 2018 at 06:16:37PM +0200, Jarkko Sakkinen wrote:
> > > TCPA log are can be empty when the TPM is disabled. This commit changes the
> > > behavior of tpm_read_log_acpi() to return successfully in this case.
> > 
> > The commit should explain why we'd want this..
> > 
> > eg Why does it matter to create the extra sysfs files to report an empty
> > log?
> > 
> > Jason
> 
> The initialization of the driver will fail otherwise. Not sure if I
> understand your question.

Well, I mean in the sense of what is broken and why is this the right
fix. Why not return -ENODEV?

Jason

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] tpm: allow TCPA log area to be empty
  2018-03-19  2:13     ` Jason Gunthorpe
@ 2018-03-19 21:24       ` Jarkko Sakkinen
  2018-03-20 22:29         ` Sahil Rihan
  0 siblings, 1 reply; 11+ messages in thread
From: Jarkko Sakkinen @ 2018-03-19 21:24 UTC (permalink / raw)
  To: Jason Gunthorpe, Sahil Rihan
  Cc: linux-integrity, linux-security-module, Alexei Starovoitov,
	stable, Peter Huewe, Arnd Bergmann, Greg Kroah-Hartman,
	open list

On Sun, Mar 18, 2018 at 08:13:23PM -0600, Jason Gunthorpe wrote:
> On Fri, Mar 16, 2018 at 02:55:25PM +0200, Jarkko Sakkinen wrote:
> > On Mon, Mar 12, 2018 at 09:02:32AM -0600, Jason Gunthorpe wrote:
> > > On Sat, Mar 10, 2018 at 06:16:37PM +0200, Jarkko Sakkinen wrote:
> > > > TCPA log are can be empty when the TPM is disabled. This commit changes the
> > > > behavior of tpm_read_log_acpi() to return successfully in this case.
> > > 
> > > The commit should explain why we'd want this..
> > > 
> > > eg Why does it matter to create the extra sysfs files to report an empty
> > > log?
> > > 
> > > Jason
> > 
> > The initialization of the driver will fail otherwise. Not sure if I
> > understand your question.
> 
> Well, I mean in the sense of what is broken and why is this the right
> fix. Why not return -ENODEV?

Well, because then the device initialization would fail.

Just noticed that this is missing:

Reported-by: Sahil Rihan <srihan@fb.com>

Sahil, would you care to try if this fixes the issue that you are
having or not?

/Jarkko

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] tpm: allow TCPA log area to be empty
  2018-03-19 21:24       ` Jarkko Sakkinen
@ 2018-03-20 22:29         ` Sahil Rihan
  2018-03-22 14:20           ` Jarkko Sakkinen
  0 siblings, 1 reply; 11+ messages in thread
From: Sahil Rihan @ 2018-03-20 22:29 UTC (permalink / raw)
  To: Jarkko Sakkinen, Jason Gunthorpe
  Cc: linux-integrity, linux-security-module, Alexei Starovoitov,
	stable, Peter Huewe, Arnd Bergmann, Greg Kroah-Hartman,
	open list

> On 3/19/18, 2:25 PM, "Jarkko Sakkinen" <jarkko.sakkinen@linux.intel.com> wrote:
>     
>    Sahil, would you care to try if this fixes the issue that you are
>    having or not?

Yes, we can test this out. Might take a day or two.

Sahil

 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] tpm: allow TCPA log area to be empty
  2018-03-20 22:29         ` Sahil Rihan
@ 2018-03-22 14:20           ` Jarkko Sakkinen
  2018-03-27  0:07             ` Sahil Rihan
  0 siblings, 1 reply; 11+ messages in thread
From: Jarkko Sakkinen @ 2018-03-22 14:20 UTC (permalink / raw)
  To: Sahil Rihan, Jason Gunthorpe
  Cc: linux-integrity, linux-security-module, Alexei Starovoitov,
	stable, Peter Huewe, Arnd Bergmann, Greg Kroah-Hartman,
	open list

On Tue, 2018-03-20 at 22:29 +0000, Sahil Rihan wrote:
> > On 3/19/18, 2:25 PM, "Jarkko Sakkinen" <jarkko.sakkinen@linux.intel.com>
> > wrote:
> >     
> >    Sahil, would you care to try if this fixes the issue that you are
> >    having or not?
> 
> Yes, we can test this out. Might take a day or two.

Awesome, thank you. I'll add

Reported-by: Sahil Rihan <srihan@fb.com>

if that is OK for you?

/Jarkko

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] tpm: allow TCPA log area to be empty
  2018-03-22 14:20           ` Jarkko Sakkinen
@ 2018-03-27  0:07             ` Sahil Rihan
  2018-03-27  8:05               ` Jarkko Sakkinen
  0 siblings, 1 reply; 11+ messages in thread
From: Sahil Rihan @ 2018-03-27  0:07 UTC (permalink / raw)
  To: Jarkko Sakkinen, Jason Gunthorpe
  Cc: linux-integrity, linux-security-module, Alexei Starovoitov,
	stable, Peter Huewe, Arnd Bergmann, Greg Kroah-Hartman,
	open list

> On 3/22/18, 7:20 AM, "Jarkko Sakkinen" <jarkko.sakkinen@linux.intel.com> wrote:
>
>   On Tue, 2018-03-20 at 22:29 +0000, Sahil Rihan wrote:
>   > > On 3/19/18, 2:25 PM, "Jarkko Sakkinen" <jarkko.sakkinen@linux.intel.com>
>   > > wrote:
>   > >     
>   > >    Sahil, would you care to try if this fixes the issue that you are
>   > >    having or not?
>   > 
>   > Yes, we can test this out. Might take a day or two.
>    
>   Awesome, thank you. I'll add
>    
>   Reported-by: Sahil Rihan <srihan@fb.com>
>    
>   if that is OK for you?

Jarkko, 

We applied your patch to a 4.11 kernel (unfortunately not the latest upstream) and were able to confirm that the char device is now being created correctly. The sysfs enabled node is also present.

And yes, please add the "Reported-by" line.

Thanks,
Sahil
 



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] tpm: allow TCPA log area to be empty
  2018-03-27  0:07             ` Sahil Rihan
@ 2018-03-27  8:05               ` Jarkko Sakkinen
  2018-03-27 15:37                 ` Sahil Rihan
  0 siblings, 1 reply; 11+ messages in thread
From: Jarkko Sakkinen @ 2018-03-27  8:05 UTC (permalink / raw)
  To: Sahil Rihan
  Cc: Jason Gunthorpe, linux-integrity, linux-security-module,
	Alexei Starovoitov, stable, Peter Huewe, Arnd Bergmann,
	Greg Kroah-Hartman, open list

On Tue, Mar 27, 2018 at 12:07:14AM +0000, Sahil Rihan wrote:
> > On 3/22/18, 7:20 AM, "Jarkko Sakkinen" <jarkko.sakkinen@linux.intel.com> wrote:
> >
> >   On Tue, 2018-03-20 at 22:29 +0000, Sahil Rihan wrote:
> >   > > On 3/19/18, 2:25 PM, "Jarkko Sakkinen" <jarkko.sakkinen@linux.intel.com>
> >   > > wrote:
> >   > >     
> >   > >    Sahil, would you care to try if this fixes the issue that you are
> >   > >    having or not?
> >   > 
> >   > Yes, we can test this out. Might take a day or two.
> >    
> >   Awesome, thank you. I'll add
> >    
> >   Reported-by: Sahil Rihan <srihan@fb.com>
> >    
> >   if that is OK for you?
> 
> Jarkko, 
> 
> We applied your patch to a 4.11 kernel (unfortunately not the latest upstream) and were able to confirm that the char device is now being created correctly. The sysfs enabled node is also present.
> 
> And yes, please add the "Reported-by" line.
> 
> Thanks,
> Sahil

And also

Tested-by: Sahil Rihan <srihan@fb.com>

?

/Jarkko

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] tpm: allow TCPA log area to be empty
  2018-03-27  8:05               ` Jarkko Sakkinen
@ 2018-03-27 15:37                 ` Sahil Rihan
  0 siblings, 0 replies; 11+ messages in thread
From: Sahil Rihan @ 2018-03-27 15:37 UTC (permalink / raw)
  To: Jarkko Sakkinen
  Cc: Jason Gunthorpe, linux-integrity, linux-security-module,
	Alexei Starovoitov, stable, Peter Huewe, Arnd Bergmann,
	Greg Kroah-Hartman, open list

> And also
>
> Tested-by: Sahil Rihan <srihan@fb.com>

Sure!

   



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-03-27 15:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-10 16:16 [PATCH] tpm: allow TCPA log area to be empty Jarkko Sakkinen
2018-03-12 11:09 ` Jarkko Sakkinen
2018-03-12 15:02 ` Jason Gunthorpe
2018-03-16 12:55   ` Jarkko Sakkinen
2018-03-19  2:13     ` Jason Gunthorpe
2018-03-19 21:24       ` Jarkko Sakkinen
2018-03-20 22:29         ` Sahil Rihan
2018-03-22 14:20           ` Jarkko Sakkinen
2018-03-27  0:07             ` Sahil Rihan
2018-03-27  8:05               ` Jarkko Sakkinen
2018-03-27 15:37                 ` Sahil Rihan

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).