Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7384620ybp; Wed, 16 Oct 2019 07:55:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0WAP1ZxrfZbJIt16X7SvZF9eObDepxNRO6IRhFPh1U2wPAFGBtnz83Nh59/IKwehT/+6S X-Received: by 2002:a50:e445:: with SMTP id e5mr39177942edm.257.1571237752222; Wed, 16 Oct 2019 07:55:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571237752; cv=none; d=google.com; s=arc-20160816; b=u0yfF3DtniyBpn4I41klGo+GKMYTYfP4lfJRKy5GsIUzGFvH9Ku2olCd7RVc5+5jkN bXTblZRX3ezcnWwMtIJSW9TnVWgKc8ZAnb5c9qsbvpUfumWNnALg0yLi21gNYtykwR0e 6hKGPyWj6uz9M6LKRhnyYaK2vXqU0TrROte0lcFFRQSSi8HMP/emPsRXRh/Y3WJEHwnf CRTAU3LuSCe04rcXaCE+Fv/4dFUsBhvuZOwNjCfMueJ4xsfOPRX3mSQtlRnddeJjzqXm QAbI3csPMeYcqXsLnt7o9LfmnV0NVtQEox9v211NGaQEydFWbAa6AR7dgrkZOTlPCLzR wy4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=yxVNF9emcO9vOzZ5Qy5dhVZsoYfmUatJ5whvaHZ26tU=; b=ieYqRn19ejpwO57mb0Ryrh+FPEYCjeM3B5zb0sa8+AnBZy6bv08ECQASZKZcz2fz3U 2/5W2BownSmffm3xgGtXLOj5eMHxl3/QPbImOJgbATskBuoCg85T55fJavnsZ/BLoE5S YwfbqZFY/KBmbtv9P1It1nbf4mtivu+R4EC4MtiWruBB8QorxPdDoleVRCgoh7qCObIE f0YU5Gz/03biBiEQEk9MC/rtNZfd6WhqP66GU8Eq8eC8DTORYSRfbjnuWRgaQVoWFYsf WHc+he8TekKOS9uuTulVdU2VRGwm8OcD8o19nImxnGBtcHr3cR14Zk+xbChNzsgV+nFL pjFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=c7TFCwPE; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u12si16298977ejt.21.2019.10.16.07.55.28; Wed, 16 Oct 2019 07:55:52 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=c7TFCwPE; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392670AbfJPLQe (ORCPT + 99 others); Wed, 16 Oct 2019 07:16:34 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:41867 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390947AbfJPLQd (ORCPT ); Wed, 16 Oct 2019 07:16:33 -0400 Received: by mail-lf1-f65.google.com with SMTP id r2so17100041lfn.8; Wed, 16 Oct 2019 04:16:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yxVNF9emcO9vOzZ5Qy5dhVZsoYfmUatJ5whvaHZ26tU=; b=c7TFCwPEtNzGt1V0t4kWXCiAXCN1SJiuzGxoyRVZuHYGJ9bA5iimWG2Rv/WOHzx9tQ 0c5fuV90QpWy0gWsi97R3hhepPTY3KPW6mkkl8PrOTW/TOMRKad5bCnkWgJDDsu3bFRq nknIEmWqKKp9i48gTwBzl6URFhks1NDyJM84oMpcA7CPid2RMjgOEA7fDap5nVusZzUA 8VP5We8KOnFuV7XptNybusmv9XJmZ+fKYORmkbTAIwjF+d0ehj16N2RGdmGwzjABMX8w 7YLEc+uLjG1sddE2SGXMcejGPXgvsqiMNlWl/zCzPnbhoi9vOJZnkhDlSIVkMkl44aG5 iuGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yxVNF9emcO9vOzZ5Qy5dhVZsoYfmUatJ5whvaHZ26tU=; b=oszuGkJEPcCn4wwLdXk4TltBCmLSxJsjVCEnALTD3VQ7J5uaU7n4zsIjzBLVhbo7eo ihzfv9Chg3fcgJwnSfrQF++PNwbXDnxosSxbJqUNPFAHqEiOWAbLoQvLGE2bkeMf+Mrz 6/2tBNf6S7qSlzf3pjSHldUxy8g3rxrNKZsV6KDGKg18GXWI81oBcEc8lOlUWZV3YZJS qAenKAyk9xt5MkK+9D979jMyt9fLNnwzyZ1Z/zHOv4sY5SQQ+u6Kh6XCfMWQ9O25kyF7 8sihlzbHnbQPYIp6wmKveUrymkVZkgt3HR9nhAea1gwkXm1pDGk6Y9NnfrZDz9pDGja5 hjpQ== X-Gm-Message-State: APjAAAVnwbgJTzIvZxEq15e2rB/4TL/AHvFhL64muOrFVYJgtI8ndldz XLeOYhBHG9YbJZn6B0luD4o2E6WHKaMm07CJN9s= X-Received: by 2002:a05:6512:30d:: with SMTP id t13mr17409610lfp.150.1571224591326; Wed, 16 Oct 2019 04:16:31 -0700 (PDT) MIME-Version: 1.0 References: <20191015124702.633-1-jarkko.sakkinen@linux.intel.com> <20191016104110.GB10184@linux.intel.com> In-Reply-To: <20191016104110.GB10184@linux.intel.com> From: Janne Karhunen Date: Wed, 16 Oct 2019 14:16:20 +0300 Message-ID: Subject: Re: [PATCH] tpm: Salt tpm_get_random() result with get_random_bytes() To: Jarkko Sakkinen 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 Content-Type: text/plain; charset="UTF-8" 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 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. -- Janne