Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp823827ybp; Thu, 17 Oct 2019 04:11:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqzgWKRlLY2YD97tJJTW0HTq+qNtTQpBDcaX9TKkmoIVbufF5otPFf+i4a4ojmumD1wXVU6O X-Received: by 2002:aa7:d410:: with SMTP id z16mr3160373edq.40.1571310666272; Thu, 17 Oct 2019 04:11:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571310666; cv=none; d=google.com; s=arc-20160816; b=hMY+uwqGA4SAYqcvNPCPZg9nX09ZVABSfZxMvEIkCUu8EV0gIkYWqf3LoYYbZ8rHBK zUnbA/JMAauFbnPryWOg5ZQlm8D2OWRboJGjZhvEA4elZwaclo5ctTyVIV4N8VkurZm6 bVYQr7gWoF62TMWu+Ia/rj/EAToZSX1ebWPJTfe0s49xJxfPf7TTrw4nqM5v84XgXCR1 7gvqK2vSLJSndAmdt+VXOg2Rjh51jz14/I7PmvZBQkWW0GSvACj5jn4Pnk0qBLnLTGI1 NfsJaUPU0ipwfmd0R4CSRKrumJpwHPLz6Y59vN3sffoDegLtPig7iCqj90L6LQL1oyui hrKA== 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=sAYv5V/jbzZ1y48Hr7Ye0Iy61ptOiUvInWcsIHivr5o=; b=aaCxddnGC2Ot4ygmMQqJ8XtpyqdtqT9xcL0ySlHNqOxIKhDP9xcsabUM4B4T+Qw4Yz dFow8HhiAKBAY0Gu1xH0CUc2Mg9uKkQoLsEizhC5ILm58zhTbcfPgvAJIXTtKgb0hXiz sChMzbTGTub33R8UAHg85gR3a8r0VyStUcsq75LY5f/pxssPNGsn440dqY4LwbXoLRgk 2Ozmm6wKoPAS2zP+roHT+Gu5+Nbu1L0QeYA65nqer7OUdx5ZTQed4KbD/rdt86Bfmd0M 27N3up3Af5YhlEipYjVwToNVfNeKOSpyOATG12Y0vRY8cEmQfPpS1WH6Bzaw1Y2kVBNK k0rQ== 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 hk1si1158051ejb.408.2019.10.17.04.10.43; Thu, 17 Oct 2019 04:11: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 S2406159AbfJPQXf (ORCPT + 99 others); Wed, 16 Oct 2019 12:23:35 -0400 Received: from mga09.intel.com ([134.134.136.24]:36442 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727138AbfJPQXf (ORCPT ); Wed, 16 Oct 2019 12:23:35 -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 orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Oct 2019 09:23:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,304,1566889200"; d="scan'208";a="202115587" Received: from hagarwal-mobl1.gar.corp.intel.com (HELO localhost) ([10.252.5.165]) by FMSMGA003.fm.intel.com with ESMTP; 16 Oct 2019 09:23:29 -0700 Date: Wed, 16 Oct 2019 19:23:28 +0300 From: Jarkko Sakkinen To: Janne Karhunen Cc: linux-integrity@vger.kernel.org, David Safford , Pascal Van Leeuwen , James Bottomley , Peter Huewe , Jason Gunthorpe , Arnd Bergmann , Greg Kroah-Hartman , open list , Mimi Zohar Subject: Re: [PATCH] tpm: Salt tpm_get_random() result with get_random_bytes() Message-ID: <20191016162312.GA6279@linux.intel.com> References: <20191015124702.633-1-jarkko.sakkinen@linux.intel.com> <20191016104110.GB10184@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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 16, 2019 at 02:16:20PM +0300, Janne Karhunen wrote: > On Wed, Oct 16, 2019 at 1:41 PM Jarkko Sakkinen > wrote: > > > > > get_random_bytes(). TPM could have a bug (making results predicatable), > > > > backdoor or even an inteposer in the bus. Salting gives protections > > > > against these concerns. > > > > > > The current issue in the randomness from my point of view is that > > > encrypted filesystems, ima etc in common deployments require high > > > quality entropy just few seconds after the system has powered on for > > > the first time. It is likely that people want to keep their keys > > > device specific, so the keys need to be generated on the first boot > > > before any of the filesystems mount. > > > > This patch does not have the described issue. > > My understanding was that you wanted to make the tpm_get_random() an > alternative to get_random_bytes(), and one reason why one might want > to do this is to work around the issues in get_random_bytes() in early > init as it may not be properly seeded. But sure, if you this wasn't > among the problems being solved then forget it. I'm trying to get a framework on how rng's should be used in the kernel. There doesn't seem to be one. /Jarkko