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: <5B8DA87D05A7694D9FA63FD143655C1B94229743@hasmsx108.ger.corp.intel.com>
Date:   Mon, 26 Feb 2018 13:59:42 +0000
From:   "Winkler, Tomas" <tomas.winkler@...el.com>
To:     Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>,
        Jason Gunthorpe <jgg@...pe.ca>
CC:     "Usyskin, Alexander" <alexander.usyskin@...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 1/2 v5] tpm: cmd_ready command can be issued only after
 granting locality


> 
> On Sun, 2018-02-25 at 14:00 +0200, Tomas Winkler wrote:
> >  	if (need_locality && chip->ops->relinquish_locality) {
> > -		chip->ops->relinquish_locality(chip, chip->locality);
> > +		/* this coud be on error path, don't override error code */
> > +		int l_rc = chip->ops->relinquish_locality(chip, chip-
> > >locality);
> > +
> > +		if (l_rc)
> > +			dev_err(&chip->dev, "%s: relinquish_locality: error
> > %d\n",
> > +				__func__, l_rc);
> > +
> >  		chip->locality = -1;
> >  	}
> 
> The 'l_rc' declaration causes NAK as I've stated before.

I will provide a sixth version that let us both down the tree

> 
> Why don't you just make a helper function:
> 
> static void tpm_relinquish_locality(struct tpm_chip *chip) {
> 	int rc;
> 
> 	if (!chip->ops->relinquish_locality)
> 		return 0;
> 
> 	rc = chip->ops->relinquish_locality(chip);
> 	if (rc)
> 		dev_err(&chip->dev, "%s: error %d\n", __func__, rc);
> 
> 	chip->locality = -1;
> }
> 
> Then the original code would be simply:
> 
> if (need_locality)
> 	tpm_relinquish_locality(chip);
> 
> /Jarkko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ