From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29F4CFA372B for ; Wed, 16 Oct 2019 10:38:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0390F20872 for ; Wed, 16 Oct 2019 10:38:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391999AbfJPKiK (ORCPT ); Wed, 16 Oct 2019 06:38:10 -0400 Received: from mga02.intel.com ([134.134.136.20]:12940 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727291AbfJPKiJ (ORCPT ); Wed, 16 Oct 2019 06:38:09 -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 orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Oct 2019 03:38:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,303,1566889200"; d="scan'208";a="220735156" Received: from jsakkine-mobl1.tm.intel.com (HELO localhost) ([10.237.50.130]) by fmsmga004.fm.intel.com with ESMTP; 16 Oct 2019 03:38:05 -0700 Date: Wed, 16 Oct 2019 13:38:05 +0300 From: Jarkko Sakkinen To: Jason Gunthorpe Cc: linux-integrity@vger.kernel.org, David Safford , Pascal Van Leeuwen , James Bottomley , Peter Huewe , Arnd Bergmann , Greg Kroah-Hartman , open list Subject: Re: [PATCH] tpm: Salt tpm_get_random() result with get_random_bytes() Message-ID: <20191016103805.GA10184@linux.intel.com> References: <20191015124702.633-1-jarkko.sakkinen@linux.intel.com> <20191015170450.GB5444@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191015170450.GB5444@ziepe.ca> 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 Tue, Oct 15, 2019 at 02:04:50PM -0300, Jason Gunthorpe wrote: > On Tue, Oct 15, 2019 at 03:47:02PM +0300, Jarkko Sakkinen wrote: > > Salt the result that comes from the TPM RNG with random bytes from the > > kernel RNG. This will allow to use tpm_get_random() as a substitute for > > 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. > > Seems like a dangerous use case, why would any kernel user that cared > about quality of randomness ever call a tpm_* API to get quality > random data? This is related to this discussion: https://lore.kernel.org/linux-integrity/CAE=NcrY3BTvD-L2XP6bsO=9oAJLtSD0wYpUymVkAGAnYObsPzQ@mail.gmail.com/T/#t I could also move this to the call site. /Jarkko