Received: by 2002:a17:90a:37e8:0:0:0:0 with SMTP id v95csp358633pjb; Fri, 4 Oct 2019 00:22:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzpQTPqFxIQ2tTPYF6TxqyNduo5UDW7wrwcgyzuDMp88xccgIKfI24zV9EYFBzxp3Wa20RZ X-Received: by 2002:aa7:c4d0:: with SMTP id p16mr13777046edr.266.1570173764481; Fri, 04 Oct 2019 00:22:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570173764; cv=none; d=google.com; s=arc-20160816; b=iz+XkSlsV7AH8c0MHH6Wzr7uhR7xH5iha4HdiD4809q+G9nxdIU9VktbC/euYNYVYx IJZFFyb5HE62YvDEXmxak1I0lk/C4IOVX0fWEejgLiDaXMOHls/7zh9zTwhL3YZwozdy xoAJiO6qE7FWc1SsKhykNCyp+93Td5MAS1Q6I3LK+cxCD6p14WlxdmkEkdOH0zuXIzWW wA7wyHmas+XW+vYym29Xv6MXC66VxcmbT5lHTUA4rHWKIG6nouHws4/fzuLpSfuQ07KH vGok1G/lbd2RNQkOJ7G6FAJUau8fO1dZvoaSNmiZxlsge7VLt2nPhcJUu8RNsd3dKrGd AwOA== 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=1s1U6HY8d+4rf9DPt/1i8QAOtbKLUfYJ/20HKGq+7IU=; b=sGn5pBgkNNb2RlCNKrRn58c6/+mBD3iG6U0oe3cJKIapSGHZB3n0XPJXSBRMTGAYnQ UE7C0OE7pTV8jXfwfEIhyiaA40DMQWDKzX9GpJWSz3DpBfEYGco3Rb06nuNL9d1KzXgm f1IzkjLuwHHqh4e8+C6+N1Q3u32d1Dl79am/v/0rvA33NEibCHdjh9PDTyNs19HQzZ4D LTvALxcRRyjoIzoY0YmM1HZyPJ+b50WV0DRnVxKz0uWBTgjgpJHOBJ17NzckBkXgtQmn ghlPyvHGahumed4LiB4l+lvHPX76KUy2pkjJ3+c5jWVBcnRBgcTR1tJFb7ErcT7Mntou 20CA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 g13si2445110ejf.133.2019.10.04.00.22.19; Fri, 04 Oct 2019 00:22:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 S1730501AbfJCWKy (ORCPT + 99 others); Thu, 3 Oct 2019 18:10:54 -0400 Received: from mga04.intel.com ([192.55.52.120]:55666 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730232AbfJCWKy (ORCPT ); Thu, 3 Oct 2019 18:10:54 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Oct 2019 15:10:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,253,1566889200"; d="scan'208";a="191397905" Received: from okiselev-mobl1.ccr.corp.intel.com (HELO localhost) ([10.251.93.117]) by fmsmga008.fm.intel.com with ESMTP; 03 Oct 2019 15:10:48 -0700 Date: Fri, 4 Oct 2019 01:10:42 +0300 From: Jarkko Sakkinen To: Mimi Zohar Cc: David Safford , linux-integrity@vger.kernel.org, stable@vger.kernel.org, David Howells , Herbert Xu , "David S. Miller" , "open list:ASYMMETRIC KEYS" , "open list:CRYPTO API" , open list Subject: Re: [PATCH] KEYS: asym_tpm: Switch to get_random_bytes() Message-ID: <20191003221042.GA3363@linux.intel.com> References: <20190926171601.30404-1-jarkko.sakkinen@linux.intel.com> <1570024819.4999.119.camel@linux.ibm.com> <20191003114119.GF8933@linux.intel.com> <1570107752.4421.183.camel@linux.ibm.com> <20191003175854.GB19679@linux.intel.com> <1570128827.5046.19.camel@linux.ibm.com> <20191003215125.GA30511@linux.intel.com> <20191003215743.GB30511@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191003215743.GB30511@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, Oct 04, 2019 at 12:57:43AM +0300, Jarkko Sakkinen wrote: > On Fri, Oct 04, 2019 at 12:51:25AM +0300, Jarkko Sakkinen wrote: > > On Thu, Oct 03, 2019 at 02:53:47PM -0400, Mimi Zohar wrote: > > > [Cc'ing David Safford] > > > > > > On Thu, 2019-10-03 at 20:58 +0300, Jarkko Sakkinen wrote: > > > > On Thu, Oct 03, 2019 at 09:02:32AM -0400, Mimi Zohar wrote: > > > > > On Thu, 2019-10-03 at 14:41 +0300, Jarkko Sakkinen wrote: > > > > > > On Wed, Oct 02, 2019 at 10:00:19AM -0400, Mimi Zohar wrote: > > > > > > > On Thu, 2019-09-26 at 20:16 +0300, Jarkko Sakkinen wrote: > > > > > > > > Only the kernel random pool should be used for generating random numbers. > > > > > > > > TPM contributes to that pool among the other sources of entropy. In here it > > > > > > > > is not, agreed, absolutely critical because TPM is what is trusted anyway > > > > > > > > but in order to remove tpm_get_random() we need to first remove all the > > > > > > > > call sites. > > > > > > > > > > > > > > At what point during boot is the kernel random pool available? ?Does > > > > > > > this imply that you're planning on changing trusted keys as well? > > > > > > > > > > > > Well trusted keys *must* be changed to use it. It is not a choice > > > > > > because using a proprietary random number generator instead of defacto > > > > > > one in the kernel can be categorized as a *regression*. > > > > > > > > > > I really don't see how using the TPM random number for TPM trusted > > > > > keys would be considered a regression. ?That by definition is a > > > > > trusted key. ?If anything, changing what is currently being done would > > > > > be the regression.? > > > > > > > > It is really not a TPM trusted key. It trusted key that gets sealed with > > > > the TPM. The key itself is used in clear by kernel. The random number > > > > generator exists in the kernel to for a reason. > > > > > > > > It is without doubt a regression. > > > > > > You're misusing the term "regression" here. ?A regression is something > > > that previously worked and has stopped working. ?In this case, trusted > > > keys has always been based on the TPM random number generator. ?Before > > > changing this, there needs to be some guarantees that the kernel > > > random number generator has a pool of random numbers early, on all > > > systems including embedded devices, not just servers. > > > > I'm not using the term regression incorrectly here. Wrong function > > was used to generate random numbers for the payload here. It is an > > obvious bug. > > At the time when trusted keys was introduced I'd say that it was a wrong > design decision and badly implemented code. But you are right in that as > far that code is considered it would unfair to speak of a regression. > > asym-tpm.c on the other hand this is fresh new code. There has been > *countless* of discussions over the years that random numbers should > come from multiple sources of entropy. There is no other categorization > than a bug for the tpm_get_random() there. Saying that regression is something that "stopped working" is very blunt and naive definition of regression, and is not true. Any misbehaviour can be categorized as a regression. /Jarkko