[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5B8DA87D05A7694D9FA63FD143655C1B9D9F52A9@hasmsx109.ger.corp.intel.com>
Date: Wed, 17 Oct 2018 23:08:46 +0000
From: "Winkler, Tomas" <tomas.winkler@...el.com>
To: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
CC: Jason Gunthorpe <jgg@...pe.ca>,
Nayna Jain <nayna@...ux.vnet.ibm.com>,
"Usyskin, Alexander" <alexander.usyskin@...el.com>,
"Struk, Tadeusz" <tadeusz.struk@...el.com>,
"linux-integrity@...r.kernel.org" <linux-integrity@...r.kernel.org>,
"linux-security-module@...r.kernel.org"
<linux-security-module@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] tpm: tpm_try_transmit() ignore value of go_to_idle()
> -----Original Message-----
> From: Jarkko Sakkinen [mailto:jarkko.sakkinen@...ux.intel.com]
> Sent: Thursday, October 18, 2018 02:01
> To: Winkler, Tomas <tomas.winkler@...el.com>
> Cc: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>; Jason Gunthorpe
> <jgg@...pe.ca>; Nayna Jain <nayna@...ux.vnet.ibm.com>; Usyskin,
> Alexander <alexander.usyskin@...el.com>; Struk, Tadeusz
> <tadeusz.struk@...el.com>; linux-integrity@...r.kernel.org; linux-security-
> module@...r.kernel.org; linux-kernel@...r.kernel.org
> Subject: Re: [PATCH] tpm: tpm_try_transmit() ignore value of go_to_idle()
>
> On Mon, 15 Oct 2018, Tomas Winkler wrote:
> > Ignore the return value of go_to_idle() in tpm_try_transmit().
> > Once it may shadow the return value of actual tpm operation, second
> > the consequent command will fail as well and the error will be caought
> > anyway.
> > Last fix wrong goto, that jumped back instead of forward.
> >
> > Fixes: 627448e85c76 ("tpm: separate cmd_ready/go_idle from
> > runtime_pm")
> > Signed-off-by: Tomas Winkler <tomas.winkler@...el.com>
> > ---
> > drivers/char/tpm/tpm-interface.c | 4 +---
> > 1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/drivers/char/tpm/tpm-interface.c
> > b/drivers/char/tpm/tpm-interface.c
> > index 129f640424b7..f69c711bf74a 100644
> > --- a/drivers/char/tpm/tpm-interface.c
> > +++ b/drivers/char/tpm/tpm-interface.c
> > @@ -547,9 +547,7 @@ static ssize_t tpm_try_transmit(struct tpm_chip
> *chip,
> > dev_err(&chip->dev, "tpm2_commit_space: error %d\n", rc);
> >
> > out:
> > - rc = tpm_go_idle(chip, flags);
> > - if (rc)
> > - goto out;
> > + (void)tpm_go_idle(chip, flags);
> >
> > if (need_locality)
> > tpm_relinquish_locality(chip, flags);
> > --
> > 2.14.4
> >
> >
>
> LGTM. Should be probably Cc'd to stable (can add).
>
> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
I've posted another one, there are more issues in the flow.
Powered by blists - more mailing lists