All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: "Fábio Urquiza" <flus-/PpS1Qp42A70xEqrn79Vhg@public.gmane.org>
Cc: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH] tpm_i2c_atmel: fix i2c_atmel_recv() when response is greater than 35 bytes
Date: Thu, 24 Nov 2016 15:04:02 +0200	[thread overview]
Message-ID: <20161124130402.tblatokp6pakx5e7@intel.com> (raw)
In-Reply-To: <CANX2WTY5ZnULO5BJppR=qoiBFMJb_46pXEb6Dv4qsA9-EpGkow-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Tue, Nov 22, 2016 at 02:47:37PM -0300, Fábio Urquiza wrote:
> On Tue, Nov 22, 2016 at 2:08 PM, Jason Gunthorpe
> <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> wrote:
> >
> > On Tue, Nov 22, 2016 at 09:40:07AM -0300, Fabio Urquiza wrote:
> > > If the variable expected_len is greater than 35 bytes, i2c_atmel_recv()
> > > ignores the amount of data already read in i2c_atmel_read_status() and
> > > request more data than what the device is ready to supply. As result the
> > > TPM data sent to the upper layers will miss the first 35 bytes of the
> > > response and will be filled with garbage in the end.
> >
> > I'm concerned your chip is not behaving the same as mine, I have to
> > dig out my hardware and check. I'm fairly certain I would have hit
> > this..
> >
> > Do you know the revision code for your chip?
> >
> > IIRC my TPM re-read the message starting from byte 0, which is why the
> > code is like this.
> >
> > Jason
> 
> I'm working on an emulator for that chip and I don't have the real
> hardware to check.
> 
> That behavior makes sense. I will change the emulator to follow that.
> 
> You can ignore that patch, then.
> 
> Thanks,
> 
> -Fabio Urquiza

Thanks guys. I was going to ask if someone is able to test this. Good
that you sorted this out.

/Jarkko

------------------------------------------------------------------------------

      parent reply	other threads:[~2016-11-24 13:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-22 12:40 [PATCH] tpm_i2c_atmel: fix i2c_atmel_recv() when response is greater than 35 bytes Fabio Urquiza
     [not found] ` <20161122124007.16487-1-flus-/PpS1Qp42A70xEqrn79Vhg@public.gmane.org>
2016-11-22 17:08   ` Jason Gunthorpe
     [not found]     ` <20161122170822.GF3956-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-11-22 17:47       ` Fábio Urquiza
     [not found]         ` <CANX2WTY5ZnULO5BJppR=qoiBFMJb_46pXEb6Dv4qsA9-EpGkow-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-11-24 13:04           ` Jarkko Sakkinen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161124130402.tblatokp6pakx5e7@intel.com \
    --to=jarkko.sakkinen-vuqaysv1563yd54fqh9/ca@public.gmane.org \
    --cc=flus-/PpS1Qp42A70xEqrn79Vhg@public.gmane.org \
    --cc=tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.