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: <20190122121031.GD7514@linux.intel.com>
Date:   Tue, 22 Jan 2019 14:10:31 +0200
From:   Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
To:     Stefan Berger <stefanb@...ux.ibm.com>
Cc:     linux-integrity@...r.kernel.org,
        linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 5/5] tpm: ppi: Enable submission of optional command
 parameter for PPI 1.3

On Tue, Jan 22, 2019 at 02:01:59PM +0200, Jarkko Sakkinen wrote:
> On Thu, Jan 17, 2019 at 12:41:35PM -0500, Stefan Berger wrote:
> > This patch enables a user to specify the additional optional command
> > parameter by writing it into the request file:
> > 
> >    # echo "23 16" > request
> >    # cat request
> >    23 16
> > 
> > For backwards compatibility:
> > 
> > If only 1 parameter is given then we assume this is the operation request
> > number.
> > 
> >    # echo "5" > request
> >    # cat request
> >    5
> > 
> > Signed-off-by: Stefan Berger <stefanb@...ux.ibm.com>
> > Tested-by: David Safford <david.safford@...com>
> 
> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>

Oops, sorry, this was meant for 4/5, so please ignore that.

The goto statement in tpm_store_ppi_request() is a bit messy as you
jump between branches. Definitely works, but very unreadable.

To get around it, you could change the branching as

if (strcmp(chip->ppi_version, "1.3") == 0 &&
    sscanf(buf, "%llu %llu", &tmp[0].integer.value,
	   &tmp[1].integer.value) == 2) {
	/* ... */
} else if (strcmp(chip->ppi_version, "1.2") == 0) {
	/* ... */
} else {
	/* ... */
}

/Jarkko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ