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] [thread-next>] [day] [month] [year] [list]
Message-ID: <809e827b-fdbe-fbb8-8acf-2878ae9f7777@huawei.com>
Date:   Thu, 21 Mar 2019 15:26:38 +0100
From:   Roberto Sassu <roberto.sassu@...wei.com>
To:     Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>,
        Dan Williams <dan.j.williams@...el.com>
CC:     James Bottomley <jejb@...ux.ibm.com>,
        Mimi Zohar <zohar@...ux.ibm.com>,
        David Howells <dhowells@...hat.com>,
        <keyrings@...r.kernel.org>, <linux-nvdimm@...ts.01.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] security/keys/trusted: Allow operation without hardware
 TPM

On 3/21/2019 2:54 PM, Jarkko Sakkinen wrote:
> On Mon, Mar 18, 2019 at 04:45:13PM -0700, Dan Williams wrote:
>> Rather than fail initialization of the trusted.ko module, arrange for
>> the module to load, but rely on trusted_instantiate() to fail
>> trusted-key operations.
>>
>> Fixes: 240730437deb ("KEYS: trusted: explicitly use tpm_chip structure...")
>> Cc: Roberto Sassu <roberto.sassu@...wei.com>
>> Cc: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
>> Cc: James Bottomley <jejb@...ux.ibm.com>
>> Cc: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
>> Cc: Mimi Zohar <zohar@...ux.ibm.com>
>> Cc: David Howells <dhowells@...hat.com>
>> Signed-off-by: Dan Williams <dan.j.williams@...el.com>
> 
> It should check for chip in each function that uses TPM now that
> the code does not rely on default chip. Otherwise, the semantics
> are kind of inconsistent.

If no other TPM function can be used before a successful key
instantiate, checking for a chip only in trusted_instantiate() seems
sufficient. Then, the same chip will be used by all TPM functions until
module unloading, since we incremented the reference count.

I would suggest to move the tpm_default_chip() and init_digests() calls
to trusted_instantiate() to restore the old behavior of init_trusted().

trusted_instantiate() should look like:
---
if (!chip) {
	chip = tpm_default_chip();
	if (!chip)
		return -ENODEV;
}

if (!digests) {
	ret = init_digests();
	if (ret < 0)
		return ret;
}
---

Roberto


> /Jarkko
> 

-- 
HUAWEI TECHNOLOGIES Duesseldorf GmbH, HRB 56063
Managing Director: Bo PENG, Jian LI, Yanli SHI

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ