[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180128201559.GG23869@ziepe.ca>
Date: Sun, 28 Jan 2018 13:15:59 -0700
From: Jason Gunthorpe <jgg@...pe.ca>
To: Tomas Winkler <tomas.winkler@...el.com>
Cc: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>,
Alexander Usyskin <alexander.usyskin@...el.com>,
linux-integrity@...r.kernel.org,
linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2 v2] tpm: cmd_ready command can be issued only after
granting locality
On Sun, Jan 28, 2018 at 09:51:00AM +0200, Tomas Winkler wrote:
> diff --git a/include/linux/tpm.h b/include/linux/tpm.h
> index bcdd3790e94d..06639fb6ab85 100644
> +++ b/include/linux/tpm.h
> @@ -44,7 +44,7 @@ struct tpm_class_ops {
> bool (*update_timeouts)(struct tpm_chip *chip,
> unsigned long *timeout_cap);
> int (*request_locality)(struct tpm_chip *chip, int loc);
> - void (*relinquish_locality)(struct tpm_chip *chip, int loc);
> + int (*relinquish_locality)(struct tpm_chip *chip, int loc);
This seems wrong.. What is the core code supposed to do if relinquish
fails?
Just returning an error code from transmit doesn't really do anything
helpful from a broad subsytem perspective.
I think if a driver can fail reliquish then it needs some kind of
strategy to recover.
Suggest trying the reliquish again on every next request until
success, otherwise fail request locality, potentially permanently.
Jason
Powered by blists - more mailing lists