lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20191115224025.GA29389@linux.intel.com>
Date:   Sat, 16 Nov 2019 00:40:25 +0200
From:   Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
To:     Jason Gunthorpe <jgg@...pe.ca>
Cc:     Jerry Snitselaar <jsnitsel@...hat.com>,
        linux-integrity <linux-integrity@...r.kernel.org>,
        Peter Huewe <peterhuewe@....de>,
        Linux List Kernel Mailing <linux-kernel@...r.kernel.org>,
        linux-stable@...r.kernel.org,
        Christian Bundy <christianbundy@...ction.io>
Subject: Re: [PATCH] tpm_tis: turn on TPM before calling tpm_get_timeouts

On Fri, Nov 15, 2019 at 02:36:21PM -0400, Jason Gunthorpe wrote:
> On Fri, Nov 15, 2019 at 07:43:29PM +0200, Jarkko Sakkinen wrote:
> > On Thu, Nov 14, 2019 at 12:56:29PM -0400, Jason Gunthorpe wrote:
> > > On Thu, Nov 14, 2019 at 06:55:06PM +0200, Jarkko Sakkinen wrote:
> > > > > Would it function with the timeout values set at the beginning of
> > > > > tpm_tis_core_init (max values)?
> > > > 
> > > > tpm_get_timeouts() should be replaced with:
> > > > 
> > > > if (tpm_chip_start()) {
> > > > 	dev_err(dev, "Could not get TPM timeouts and durations\n");
> > > > 	rc = -ENODEV;
> > > > 	goto out_err;
> > > > }
> > > > 
> > > > tpm_stop_chip(chip);
> > > > 
> > > > tpm_get_timeouts() is called by tpm_auto_startup(). Also the function
> > > > should be moved to tpm_chip.c and converted to a static function so
> > > > that it won't be called from random cal sites like above.
> > > 
> > > Careful, the design here was to allow a driver to do only
> > > get_timeouts, then additional setup work, then do auto_startup()
> > > 
> > > Forcing a driver to do auto_startup too early may not be good.
> > 
> > All drivers always do it anyway because all drivers always call
> > tpm_chip_register().
> 
> But chip_register is after the driver has done it's setup and after it
> may have called get_timeouts
> 
> auto_setup should not be moved to before chip_register()

I do not see any sense calling from get_timeouts() from call sites
in the same initialization flow.

/Jarkko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ