Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp256074ybn; Thu, 3 Oct 2019 04:45:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqy4gY+gkqVPf0vnrwjsXD4HUahGpJdfkqnU3ulyGn+MxBlRuwgXZHILn2H/ScCI0vAfsJSZ X-Received: by 2002:a17:906:230c:: with SMTP id l12mr7342554eja.78.1570103107606; Thu, 03 Oct 2019 04:45:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570103107; cv=none; d=google.com; s=arc-20160816; b=Ugo2N8WQEE0vwLxl+7JoP/DOdsLF6t9NNCM1NS+99ySxSyxDVSn9Pb7XbxHOaorQNP LZ2jBq9o+csxZw3EAfVn7uKi8YOIMIgZafMyZiAZ+nc9vlbDCrqEgmaYXQLrkWf9I5v4 Pqd7j2GrrvXpf5c9OBoIx8rFCLA1Hepfzs3kQhy0vROQhD072hVtE21dhzyG6rL6pSCa /D2U4mwEBvduO5YUMMBHojiYgf9bJP+4VIkDdrR4wc07ly1rXfUeEgFlj6CrtjPCa3L1 IH8OE5dmB6Lxnl63b1qvnuD5iJDdV5RgITN7vNB3604qZM8JcdTys4ZBzoFdxnQDYgBb uEgw== 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=yW4RymoT9vAKyPjO4/AutYnCPwFnHBhzNBj+Unla02A=; b=D+bxGCpbPqxzUjg5xOcd4JhIWhuMYlaQUdwS/3T9cx+sqMQ7hSTnodP+lF1d5s1vxS 4nzqrqnRFxEXVoXX3TS6gFsye5WfCdd1hw6azXsHMGPSD7y/BPl3d3+ilmtP9NdrAM/Q P14Kp3Olke2CbqBQqPUkheN1SdCje9A3n+CtMA6H4rynpmIoxEHowrhxTK3/kgC0Mljx bLqFbcYRog9poMPNMmV8J0ZEEmISXhzamsjFx3VvkviT0zMxlBXtQBfBQ5EL90ybPXFo HjTDZMJ11hqIX54xMPgkhFaMAX3f+Tp8TPFz8lmULllAtauY4SL9pjzrep5EwViACMsV HeOg== 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 j18si1076999ejv.201.2019.10.03.04.44.41; Thu, 03 Oct 2019 04:45:07 -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 S1730057AbfJCLnt (ORCPT + 99 others); Thu, 3 Oct 2019 07:43:49 -0400 Received: from mga12.intel.com ([192.55.52.136]:45043 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729823AbfJCLnt (ORCPT ); Thu, 3 Oct 2019 07:43:49 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Oct 2019 04:43:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,252,1566889200"; d="scan'208";a="393178220" Received: from jsakkine-mobl1.tm.intel.com (HELO localhost) ([10.237.50.161]) by fmsmga006.fm.intel.com with ESMTP; 03 Oct 2019 04:43:45 -0700 Date: Thu, 3 Oct 2019 14:43:44 +0300 From: Jarkko Sakkinen To: Mimi Zohar Cc: 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: <20191003114344.GG8933@linux.intel.com> References: <20190926171601.30404-1-jarkko.sakkinen@linux.intel.com> <1570024819.4999.119.camel@linux.ibm.com> <20191003114119.GF8933@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: <20191003114119.GF8933@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 Thu, Oct 03, 2019 at 02:41:19PM +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*. > > Also, TEE trusted keys cannot use the TPM option. > > If it was not initialized early enough we would need fix that too. > > I don't think there should be a problem anyway since encrypted keys is > already using get_random_bytes(). Looking at asym_tpm.c the implementation copies all the anti-patterns from trusted keys, which is really unfortunate. I don't know how that has passed through all the filters. /Jarkko