Skip to contentSkip to conversation

TPM: fix pcrread

PATCH In review Rajiv Andrade 3 participants 3 messages Sep 30, 2009 TPM device driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 TPM: fix pcrread

The previously sent patch:

http://marc.info/?l=tpmdd-devel&m=125208945007834&w=2

Had its first hunk cropped when merged, submitting only this first hunk again.

---
 drivers/char/tpm/tpm.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/char/tpm/tpm.c +1 -2
index 45d5800..47c2d27 100644
@@ -696,8 +696,7 @@ int __tpm_pcr_read(struct tpm_chip *chip, int pcr_idx, u8 *res_buf)
 
 	cmd.header.in = pcrread_header;
 	cmd.params.pcrread_in.pcr_idx = cpu_to_be32(pcr_idx);
-	BUG_ON(cmd.header.in.length > READ_PCR_RESULT_SIZE);
-	rc = transmit_cmd(chip, &cmd, cmd.header.in.length,
+	rc = transmit_cmd(chip, &cmd, READ_PCR_RESULT_SIZE,
 			  "attempting to read a pcr value");
 
 	if (rc == 0)
Signature · 1 line
1.6.3.1
Acked-by on v1 1/1
#1 lore raw
Quoted 22 lines · Rajiv Andrade

The previously sent patch:

http://marc.info/?l=tpmdd-devel&m=125208945007834&w=2

Had its first hunk cropped when merged, submitting only this first hunk again.

---
 drivers/char/tpm/tpm.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/char/tpm/tpm.c +0 -0
index 45d5800..47c2d27 100644

drivers/char/tpm/tpm.c int __tpm_pcr_read(struct tpm_chip *chip, int pcr_idx, u8 *res_buf) · line 702

Quoted 9 lines
drivers/char/tpm/tpm.c +1 -2
@@ -696,8 +696,7 @@ int __tpm_pcr_read(struct tpm_chip *chip, int pcr_idx, u8 *res_buf)
 
 	cmd.header.in = pcrread_header;
 	cmd.params.pcrread_in.pcr_idx = cpu_to_be32(pcr_idx);
-	BUG_ON(cmd.header.in.length > READ_PCR_RESULT_SIZE);
-	rc = transmit_cmd(chip, &cmd, cmd.header.in.length,
+	rc = transmit_cmd(chip, &cmd, READ_PCR_RESULT_SIZE,
 			  "attempting to read a pcr value");
 
 	if (rc == 0)

Compiled and tested patch.

#2 lore raw
Quoted 9 lines · Mimi Zohar

drivers/char/tpm/tpm.c int __tpm_pcr_read(struct tpm_chip *chip, int pcr_idx, u8 *res_buf) · line 702

Quoted 4 lines · Rajiv Andrade
drivers/char/tpm/tpm.c +1 -0
+	rc = transmit_cmd(chip, &cmd, READ_PCR_RESULT_SIZE,
 			  "attempting to read a pcr value");
 
 	if (rc == 0)

Compiled and tested patch.

Thanks.

Applied to
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6#next

Signature · 1 line
James Morris <[email protected]>