Skip to contentSkip to conversation

tpm: allow TCPA log area to be empty

PATCH In review Jarkko Sakkinen 3 participants 11 messages Mar 10, 2018 – Mar 27, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tpm: allow TCPA log area to be empty

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 at vger.kernel.org
Fixes 55a82ab3181b ("[PATCH] tpm: add bios measurement log")
---
 drivers/char/tpm/tpm_eventlog_acpi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/char/tpm/tpm_eventlog_acpi.c +2 -2
index 66f19e93c216..f5f66dcd6f30 100644
@@ -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 */
Signature · 6 lines
2.15.1

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#1 lore raw
Quoted 6 lines · Jarkko Sakkinen

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 at vger.kernel.org
Fixes 55a82ab3181b ("[PATCH] tpm: add bios measurement log")

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

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

/Jarkko
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
In reply to Jarkko Sakkinen
Quoted 2 lines · Jarkko Sakkinen

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
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 10 lines · Jason Gunthorpe
Quoted 2 lines · Jarkko Sakkinen

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
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
Quoted 7 lines · Jarkko Sakkinen
Quoted 6 lines · Jason Gunthorpe
Quoted 2 lines · Jarkko Sakkinen

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

Quoted 7 lines
Quoted 4 lines

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
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
Quoted 11 lines · Jason Gunthorpe
Quoted 10 lines · Jarkko Sakkinen
Quoted 9 lines · Jason Gunthorpe
Quoted 2 lines · Jarkko Sakkinen

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?

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

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:

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

/Jarkko
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw
Quoted 4 lines · Jarkko Sakkinen

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

????{.n?+???????+%?????????w??{.n?+????{??????????v?^?)????w*jg??????????j????G?????? ???j:+v???w?j?m????????w?????f???h?????????

#7 lore raw
Quoted 7 lines · Sahil Rihan
Quoted 5 lines

On 3/19/18, 2:25 PM, "Jarkko Sakkinen" <[email protected]> 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

if that is OK for you?

/Jarkko
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw
Quoted 9 lines · Jarkko Sakkinen
Quoted 6 lines · Sahil Rihan
Quoted 5 lines

On 3/19/18, 2:25 PM, "Jarkko Sakkinen" <[email protected]> wrote:

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

Quoted 7 lines
Quoted 1 line

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

Awesome, thank you. I'll add

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

????{.n?+???????+%?????????w??{.n?+????{??????????v?^?)????w*jg??????????j????G?????? ???j:+v???w?j?m????????w?????f???h?????????

author Tested-by Sahil Rihan
#9 lore raw
Quoted 17 lines · Sahil Rihan
Quoted 9 lines · Jarkko Sakkinen
Quoted 6 lines · Sahil Rihan
Quoted 5 lines

On 3/19/18, 2:25 PM, "Jarkko Sakkinen" <[email protected]> wrote:

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

Quoted 7 lines
Quoted 1 line

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

Awesome, thank you. I'll add

if that is OK for you?

Quoted 8 lines

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

?

/Jarkko
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html