Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1638184

Re: [PATCH] tpm: fix byte order related arithmetic inconsistency in tpm_getcap()

From Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Newsgroups linux.kernel
Subject Re: [PATCH] tpm: fix byte order related arithmetic inconsistency in tpm_getcap()
Date 2017-05-09 17:20 +0200
Message-ID <tFf5E-3uz-7@gated-at.bofh.it> (permalink)
References <tECxl-3oj-63@gated-at.bofh.it> <tFe9A-2OU-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, May 09, 2017 at 05:13:53PM +0300, Jarkko Sakkinen wrote:
> On Sun, May 07, 2017 at 08:50:02PM +0300, Jarkko Sakkinen wrote:
> > You should not do arithmetic with __be32 or __le32 types because
> > sometimes it results incorrect results. Calculations must be done only
> > with integers that are in in the CPU byte order. This commit migrates
> > tpm_getcap() to struct tpm_buf in order to sort out these issues.
> > 
> > Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > Now this should work as Robertos patches move byte order conversion
> > where it should be. Sadly I'm out of reach to my Dell E6400 laptop
> > that I use for TPM 1.2 testing.
> >  drivers/char/tpm/tpm-interface.c | 30 ++++++++++++++++--------------
> >  drivers/char/tpm/tpm.h           | 13 -------------
> >  2 files changed, 16 insertions(+), 27 deletions(-)
> 
> I've now tested this with TPM 1.2. Any complains?

Seems reasonable, but which linke had the problematic arithmetic?

Jason

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] tpm: fix byte order related arithmetic inconsistency in tpm_getcap() Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-05-08 00:10 +0200
  Re: [PATCH] tpm: fix byte order related arithmetic inconsistency in  tpm_getcap() Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-05-09 16:20 +0200
    Re: [PATCH] tpm: fix byte order related arithmetic inconsistency in  tpm_getcap() Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2017-05-09 17:20 +0200
      Re: [PATCH] tpm: fix byte order related arithmetic inconsistency in  tpm_getcap() Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-05-10 14:40 +0200
        Re: [PATCH] tpm: fix byte order related arithmetic inconsistency in tpm_getcap() Luc Van Oostenryck <luc.vanoostenryck@gmail.com> - 2017-05-11 01:50 +0200
          Re: [PATCH] tpm: fix byte order related arithmetic inconsistency in  tpm_getcap() Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-05-11 12:20 +0200

csiph-web