Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp244102ybn; Thu, 3 Oct 2019 04:33:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWnTAwH0Xda9O/CcOhpyF2F/jdELIp1wk0jsRNW/kQ2AVmCup0Kl6JAUyM+eptvkXJIl1P X-Received: by 2002:a17:906:18a1:: with SMTP id c1mr7214046ejf.4.1570102419447; Thu, 03 Oct 2019 04:33:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570102419; cv=none; d=google.com; s=arc-20160816; b=yyH+9mfCCzoe7t5BKuZaS8R/EoEmC094G87BwzoqyxH8dibS6dwV6qvle42Rl/lyXA DnrIY0NqymZ+QId1LNCC3/5WpmYi49n8XnTsSBYxZ17gAs09Uqij0a3U8wN0K8+ujw7f keg3BVwx5qfKpAlKFTeYJ7TmzGCB0/OTy3oAfxK/8SCv19adkHOet4VKyKE6xPY0aqQS u4dJ4bIpEGHbCMNCG8ShC8CDl5fpFXFJwtAwy2Ne1mG2QEHXj48QmzZjdXm67Ux/Kk3c rovLl/UbKVsRwH5EYqw9izOy/N/GelbbvJGNVZuyUg+h3AJpl+WyBrKO5oT4K86pzvLA Bu+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=AquPrqS/8EmWSpUXLbPMsy92jpEaGAw2Qed+aOGrfeA=; b=mmkIu+zUfr5n88/W5HbazQLKK0SMyk5ZOlAJbalAZUQ6QdDWTJyx5DkMrgluKbr3Au IedhDefYPEEHpRbwQvE4xEqJ07Yx6QnYZrWNYsFHNThpISiDb1R9WCc02y9Zo3GjGqZ4 I9exllxSXE8s1h4Tq8wiBE67kX18c3e2aQDGbfKC5QnmWatH7N2zUKdscKaBGNfOybc0 5YB+HUw6/j97RCzEK//TcCKy9Lhix+X07zFQK3gvYilD+PlnRSequFy1vX15CsuNHruG F07TEDZsYnpkwmqEiRrD33Z+ANDM9yAb/9znf+qBtULbtM52H7P+yDFEJXTn4amdiVfZ GGrg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p20si981238eju.109.2019.10.03.04.33.14; Thu, 03 Oct 2019 04:33:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730104AbfJCLcP (ORCPT + 99 others); Thu, 3 Oct 2019 07:32:15 -0400 Received: from mga11.intel.com ([192.55.52.93]:49045 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729961AbfJCLcO (ORCPT ); Thu, 3 Oct 2019 07:32:14 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Oct 2019 04:32:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,251,1566889200"; d="scan'208";a="198504653" Received: from jsakkine-mobl1.tm.intel.com (HELO localhost) ([10.237.50.161]) by FMSMGA003.fm.intel.com with ESMTP; 03 Oct 2019 04:32:11 -0700 Date: Thu, 3 Oct 2019 14:32:11 +0300 From: Jarkko Sakkinen To: Mimi Zohar Cc: linux-integrity@vger.kernel.org, Jerry Snitselaar , James Bottomley , Sumit Garg , Stefan Berger , Peter Huewe , Jason Gunthorpe , Arnd Bergmann , Greg Kroah-Hartman , open list Subject: Re: [PATCH] tpm: Detach page allocation from tpm_buf Message-ID: <20191003113211.GC8933@linux.intel.com> References: <20190925134842.19305-1-jarkko.sakkinen@linux.intel.com> <20190926124635.GA6040@linux.intel.com> <20190926131227.GA6582@linux.intel.com> <1570020024.4999.104.camel@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1570020024.4999.104.camel@linux.ibm.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 02, 2019 at 08:40:24AM -0400, Mimi Zohar wrote: > On Thu, 2019-09-26 at 16:12 +0300, Jarkko Sakkinen wrote: > > On Thu, Sep 26, 2019 at 03:46:35PM +0300, Jarkko Sakkinen wrote: > > > On Wed, Sep 25, 2019 at 04:48:41PM +0300, Jarkko Sakkinen wrote: > > > > - tpm_buf_reset(&buf, TPM2_ST_NO_SESSIONS, TPM2_CC_GET_RANDOM); > > > > + tpm_buf_reset(&buf, data_ptr, PAGE_SIZE, > > > > + TPM2_ST_NO_SESSIONS, TPM2_CC_PCR_EXTEND); > > > > > > Oops. > > > > Maybe we could use random as the probe for TPM version since we anyway > > send a TPM command as a probe for TPM version: > > > > 1. Try TPM2 get random. > > 2. If fail, try TPM1 get random. > > 3. Output random number to klog. > > > > Something like 8 bytes would be sufficient. This would make sure that > > no new change breaks tpm_get_random() and also this would give some > > feedback that TPM is at least somewhat working. > > That involves sending 2 TPM commands. ?At what point does this occur? > ?On registration? ?Whenever getting a random number? ?Is the result > cached in chip->flags? On registeration. It is just printed to klog. > Will this delay the TPM initialization, causing IMA to go into "TPM > bypass mode"? Of course it will delay the init. As I've stated before the real fix for the bypass issue would be to make TPM as part of the core but this has not received much appeal. I think I've sent patch for this once. /Jarkko