Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3653937ybp; Sun, 6 Oct 2019 17:06:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxcUM6Ilg0pYCwx5cqtrm+m6/nwXTsEnEtDxadH+zwHHw2BnxYveLpNzgbZ5uYxeIRKwxos X-Received: by 2002:a17:906:c47:: with SMTP id t7mr21331811ejf.133.1570406772662; Sun, 06 Oct 2019 17:06:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570406772; cv=none; d=google.com; s=arc-20160816; b=qSUNN6WPH7xCGt27y5b1ImCG2UQ+TglXk4yEMUyC4HB+djcMTOQuImdBQ8Xklz4Ztz 7Y1mXAlomUqRW9Uh9tepsKLXhKUMxXaIBxz8oyMcSvRc/fBUVdxStovllsAzG+rn7NaI arupKagzsr95UgxXqDig1jM1Lj1agaWCJitI7pz0ounau5D5XX5+9kJ03lWCGJcekQlx I23F+fiY8/Wj3/VIzw7q0QplbkUZD8dm8b3ca0os4EE8wLFC+ciw9KFgJMLk8muhtFJ+ tRCO05WcNPevafp+tWOid19NIx+z3oiWyPtr8CYkcO73wGlMvoWl1iPjV6QjlUkLX4re LGUg== 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=kUsoBS5M7yfrLVQBnwsKmajjfnSy7VLphcxt4pWBnoA=; b=lWqPzjv7/nE+kDexMQ/DH4Dau7ZARMeLzyEifpGyL58kzxShaKOwPBmX0uEGPBmmHj cUSk2p+cR1Bh+1iHZ5fEFZi2229uzKE/v1X1oFEQVHUsPLTGhZO94eKurr2uShyXJIms F7ovjixtqc2vEOfpTKOPIJfZ3ZNxpKfOWES2UwOI9efl2V65hpObzQxjnr9gWqUzb2AH RexLEhnZc+K+fOV8xqC0YSRiz1s2MEMatyjPlGk1uk0k5dfQJhezNZKTeCvh+0VojLpf xmWnGh8ElUd+cI7TRHrGOHQ+vo5zcH1tJFMllO4kwgksCu28DIO+w/6tRkgtyImbewys TuvQ== 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 g21si6259859ejk.23.2019.10.06.17.05.42; Sun, 06 Oct 2019 17:06:12 -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 S1726489AbfJGAF3 (ORCPT + 99 others); Sun, 6 Oct 2019 20:05:29 -0400 Received: from mga12.intel.com ([192.55.52.136]:28126 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726269AbfJGAF3 (ORCPT ); Sun, 6 Oct 2019 20:05:29 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Oct 2019 17:05:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,265,1566889200"; d="scan'208";a="204904213" Received: from mwebb1-mobl.ger.corp.intel.com (HELO localhost) ([10.251.93.103]) by orsmga002.jf.intel.com with ESMTP; 06 Oct 2019 17:05:22 -0700 Date: Mon, 7 Oct 2019 03:05:20 +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: <20191007000520.GA17116@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> <20191004182711.GC6945@linux.intel.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-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, Oct 04, 2019 at 07:56:01PM +0000, Safford, David (GE Global Research, US) wrote: > > > From: linux-integrity-owner@vger.kernel.org > owner@vger.kernel.org> On Behalf Of Jarkko Sakkinen > > Sent: Friday, October 4, 2019 2:27 PM > > Subject: EXT: Re: [PATCH] KEYS: asym_tpm: Switch to get_random_bytes() > > > > 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. > > And if the entropy pool has a bug or is misconfigured, you lose everything. > That does not sound like defense in depth to me. In the real world > I am not aware of a single instance of RNG vulnerability on a TPM. > I am directly aware of several published vulnerabilities in embedded systems > due to a badly ported version of the kernel random pool. In addition, > the random generator in a TPM is hardware isolated, and less likely to be > vulnerable to side channel or memory manipulation errors. The TPM > RNG is typically FIPS certified. The use of the TPM RNG was a deliberate > design choice in trusted keys. Hmm... so is RDRAND opcode FIPS certified. Kernel has the random number generator for two reasons: 1. To protect against bugs in hwrng's. 2. To protect against deliberate backdoors in hwrng's. How TPM RNG is guaranteed to protect against both 1 and 2? If I would agree what you say, that'd be argument against using kernel random number generator *anywhere* in the kernel. Even with the entropy issues it is least worst thing to use for key generations for better or worse. /Jarkko