Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1235871ybp; Fri, 4 Oct 2019 11:29:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqygXDXTMlbDVO2kGzt8OjxxDFPtq2YuXkGXwL7d0kEG0XfWSmMlhhAWECfGk64PacxdimNv X-Received: by 2002:a17:906:4d93:: with SMTP id s19mr13558928eju.281.1570213746860; Fri, 04 Oct 2019 11:29:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570213746; cv=none; d=google.com; s=arc-20160816; b=G1WbRVOL70nZ7CNpfI7mlS2FJGh7YKDRARtRj7FCXWSnu00nXNoJuswZ3QrsP4ccFN v+SSneYpb29vQkHuIUfQkwoBKubz2ZS2c2v1YCI+OsO9LKm2XVgSV4oCJrmQavoArfRS FHzuXpaL6pvLz7C7yVanCYe8ayWOjujx2XCkamm1gt3LPogMZ+ErjP5/FJTuVnoyL+aV YPS8ZZSR3hwayXZmIg513CbEcDbxrBKToaibAwuHc0wAPrpIk+oZW2KWq1U5UCiKoH0B 6O5mZWXeeCOvH1npSWCAsJJSOVpMy5eao6/p1LsEvkMYLZMDPAlXbobvfcjo14zabATh h9JA== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=9WptT5UgK96AXak+/af2cQetT6StX23XLTP/gt8YLnw=; b=DIpwKWFZOnw/d0z4E1Yi5EGPrtsFwwfjz+hhrGP76SEWuWha5qLacnr5wXm3Y2wcPn Ursx7B2S4BhpPQoDl6EwM+tKvrwUl9aSW2DHKVPX/wAqw34bA+dWRVkhRo84BTRDrsSO ZokO550C2D5cysoNWIvtnrY1P0iRL5TWp5Fjgyl5vvauf3NF80mTdrA900rnY8X/cvwv QwwZxyiK/xxkODvnldS3oV2E4WLUf2rzPG2ZPsi0EVEpVYoPhyWRyFKFApCFVyk5Yb1N VC7UoMVlkxQd2I3gQ3Jo3IebiQy9CFbXSHBHPGxNvoNQvoA8g2wbk2dm2IPV749lC6Ha M3pQ== 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 r24si3867432edy.417.2019.10.04.11.28.42; Fri, 04 Oct 2019 11:29:06 -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 S1730248AbfJDS1S (ORCPT + 99 others); Fri, 4 Oct 2019 14:27:18 -0400 Received: from mga17.intel.com ([192.55.52.151]:36520 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbfJDS1S (ORCPT ); Fri, 4 Oct 2019 14:27:18 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Oct 2019 11:27:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,257,1566889200"; d="scan'208";a="217248028" Received: from nzaki1-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.4.57]) by fmsmga004.fm.intel.com with ESMTP; 04 Oct 2019 11:27:13 -0700 Date: Fri, 4 Oct 2019 21:27:11 +0300 From: Jarkko Sakkinen To: "Safford, David (GE Global Research, US)" Cc: Mimi Zohar , "Wiseman, Monty (GE Global Research, US)" , "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: <20191004182711.GC6945@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Fri, Oct 04, 2019 at 01:26:58PM +0000, Safford, David (GE Global Research, US) wrote: > As the original author of trusted keys, let me make a few comments. > First, trusted keys were specifically implemented and *documented* to > use the TPM to both generate and seal keys. Its kernel documentation > specifically states this as a promise to user space. If you want to have > a different key system that uses the random pool to generate the keys, > fine, but don't change trusted keys, as that changes the existing promise > to user space. TPM generating keys (i.e. the random number) would make sense if the key would never leave from TPM (that kind of trusted keys would not be a bad idea at all). > There are many good reasons for wanting the keys to be based on the > TPM generator. As the source for the kernel random number generator > itself says, some systems lack good randomness at startup, and systems > should preserve and reload the pool across shutdown and startup. > There are use cases for trusted keys which need to generate keys > before such scripts have run. Also, in some use cases, we need to show > that trusted keys are FIPS compliant, which is possible with TPM > generated keys. If you are able to call tpm_get_random(), the driver has already registered TPN as hwrng. With this solution you fail to follow the principle of defense in depth. If the TPM random number generator is compromissed (has a bug) using the entropy pool will decrease the collateral damage. > Second, the TPM is hardly a "proprietary random number generator". > It is an open standard with multiple implementations, many of which are > FIPS certified. > > Third, as Mimi states, using a TPM is not a "regression". It would be a > regression to change trusted keys _not_ to use the TPM, because that > is what trusted keys are documented to provide to user space. For asym-tpm.c it is without a question a regression because of the evolution that has happened after trusted keys. For trusted keys using kernel rng would be improvement. /Jarkko