Thread (42 messages) 42 messages, 4 authors, 2019-02-08

Re: [PATCH v11 00/16] Remove nested TPM operations

From: Jarkko Sakkinen <hidden>
Date: 2019-02-08 13:12:38
Also in: linux-integrity, lkml

On Fri, Feb 08, 2019 at 07:22:48AM -0500, Stefan Berger wrote:
On 2/8/19 6:50 AM, Jarkko Sakkinen wrote:
quoted
On Thu, Feb 07, 2019 at 09:14:54PM -0500, Stefan Berger wrote:
quoted
      chip->ops = NULL;
      up_write(&chip->ops_sem);
  }
diff --git a/drivers/char/tpm/tpm-interface.c
b/drivers/char/tpm/tpm-interface.c
index 02e8cffd1163..fcd845ad8c3c 100644
--- a/drivers/char/tpm/tpm-interface.c
+++ b/drivers/char/tpm/tpm-interface.c
@@ -124,6 +124,8 @@ static ssize_t tpm_try_transmit(struct tpm_chip *chip,
void *buf, size_t bufsiz)
          dev_err(&chip->dev, "tpm_transmit: tpm_recv: error %d\n", rc);
      } else if (len < TPM_HEADER_SIZE || len != be32_to_cpu(header->length))
          rc = -EFAULT;
+    else
+        rc = 0;
Why is this needed?
Because it holds a non-zero value, which is wrong at this point. Below it
is:

return rc ? rc : len;

It will always return that rc and never 'len'.

It's not just needed for bisecting. I still need it with your latest tree.
That's the only change I need with my current testing of tpm_vtpm_proxy, TIS
+ TPM 1.2 , TIS + TPM 2.0 , and CRB + TPM 2.0 (with QEMU :-) ).
The code is unchaged. If there was a regression that would have been
ages.

/Jarkko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help