Received: by 10.223.185.116 with SMTP id b49csp5495353wrg; Wed, 7 Mar 2018 12:47:13 -0800 (PST) X-Google-Smtp-Source: AG47ELsM8Pk/CDCne32nYWh0PpJiBJy1A4W1WSqzSR+ll8LkHhdK7hXZ4MyK0BpHrSRQITF5wJKA X-Received: by 2002:a17:902:7b95:: with SMTP id w21-v6mr13017736pll.260.1520455633787; Wed, 07 Mar 2018 12:47:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520455633; cv=none; d=google.com; s=arc-20160816; b=CTnjHOHF6VsX3je4DM3Vevciuh6BE73VKCyIHjP8SWg4h9q3dQ2Rjbv4X8tbsu33X0 tBAXsz4JuSNtosbZ+EuPuf/RcevxkT1Q0IGDWVnrQqvqhXWJfoPOPTxoZN8j8Yy2Iz+7 uiZ83MwvgAaHIMqNhg4vnPV5wfrqKzKz+5/Kk/xepbADvuShFHjPwtUrIY26tvJ1gI9K cJnMBSYpPW9TX+YR/WptJxn3Drkbp6OrvrhdoKyJFvrrXF81uc9UbEzUZttDFK8e6FL9 WtUxMN+r24tZ7nqS7LgskSqhB1xmjTy7tdOSK1ZnAyvMbWQLoIAM3znxtONic6VuES08 Lo/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature:arc-authentication-results; bh=keBtqPpfO5d8XEMVcTDC0NYFcARD79ZP994U91W70bk=; b=AqOv1aQBSxgKthHpvIePafv+ijOEqo0pTxZr80Ls2Gf/Td2HwWtqHxmytPoFK4UEPl sU2bfnsvyDSTLi6mSQQkG3yx/bILL/lcWZSYukJOQBt/9LskGwkK4f4HEf61NlZGsG+k HcRqQ9GJJYMxzluwsOgjGqKcaT9/hdXPLH2CBF9BWNa9ImG1jhPrpgQ1bnChvu2buTI8 zVeZ4fF4wIXdQO759Mla2hq4Kmi6GAGYBlz1eEOaVwSrlbKo5TpO80Q2h5s/jzbh+cWx 7MEnmzjWU8WJb95p1hY4wfhoFYmij6QTqd6/rUQKEtL4AHo368tLIRzFQorvMdoLZ4Uf Bg6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=Zo1XFMmn; 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=hansenpartnership.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k12si11863358pgs.166.2018.03.07.12.46.59; Wed, 07 Mar 2018 12:47:13 -0800 (PST) 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=fail header.i=@hansenpartnership.com header.s=20151216 header.b=Zo1XFMmn; 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=hansenpartnership.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934617AbeCGTlJ (ORCPT + 99 others); Wed, 7 Mar 2018 14:41:09 -0500 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:51564 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934564AbeCGTlE (ORCPT ); Wed, 7 Mar 2018 14:41:04 -0500 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 7BFCD8EE180; Wed, 7 Mar 2018 11:41:03 -0800 (PST) Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PhIysHiep8Kc; Wed, 7 Mar 2018 11:41:03 -0800 (PST) Received: from [153.66.254.194] (unknown [50.35.65.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id D43A18EE0D3; Wed, 7 Mar 2018 11:41:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1520451663; bh=4XApmc4B0JDo5A0wbnp62kzh9/oRyKEsGWpqhAba1/w=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=Zo1XFMmn8ZIMuJHqUYLqslILmKtfNAzr+6/m3FRiAP7PU/dot3wX9YtGTsr3YNL5A DR/UX1oCH57qmKY498fDGCV11AKRv+kwJhrK7ZQLddhx21Rulqkz+1t/IqMmPUsM58 ZNWe6NmXOgdaQ3WYQ3tIiYNs0J86KgRX5PmhA7zM= Message-ID: <1520451662.24314.5.camel@HansenPartnership.com> Subject: Re: [PATCH] security: Fix IMA Kconfig for dependencies on ARM64 From: James Bottomley To: Mimi Zohar , Jason Gunthorpe , Jiandi An Cc: dmitry.kasatkin@gmail.com, jmorris@namei.org, serge@hallyn.com, linux-integrity@vger.kernel.org, linux-ima-devel@lists.sourceforge.net, linux-ima-user@lists.sourceforge.net, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 07 Mar 2018 11:41:02 -0800 In-Reply-To: <1520450495.10396.587.camel@linux.vnet.ibm.com> References: <1520400386-17674-1-git-send-email-anjiandi@codeaurora.org> <20180307185132.GA30102@ziepe.ca> <1520448953.10396.565.camel@linux.vnet.ibm.com> <1520449719.5558.28.camel@HansenPartnership.com> <1520450495.10396.587.camel@linux.vnet.ibm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-03-07 at 14:21 -0500, Mimi Zohar wrote: > On Wed, 2018-03-07 at 11:08 -0800, James Bottomley wrote: > > > > On Wed, 2018-03-07 at 13:55 -0500, Mimi Zohar wrote: > > > > > > On Wed, 2018-03-07 at 11:51 -0700, Jason Gunthorpe wrote: > > > > > > > > > > > > On Tue, Mar 06, 2018 at 11:26:26PM -0600, Jiandi An wrote: > > > > > > > > > > > > > > > TPM_CRB driver is the TPM support for ARM64.  If it > > > > > is built as module, TPM chip is registered after IMA > > > > > init.  tpm_pcr_read() in IMA driver would fail and > > > > > display the following message even though eventually > > > > > there is TPM chip on the system: > > > > > > > > > > ima: No TPM chip found, activating TPM-bypass! (rc=-19) > > > > > > > > > > Fix IMA Kconfig to select TPM_CRB so TPM_CRB driver is > > > > > built in kernel and initializes before IMA driver. > > > > > > > > > > Signed-off-by: Jiandi An > > > > >  security/integrity/ima/Kconfig | 1 + > > > > >  1 file changed, 1 insertion(+) > > > > > > > > > > diff --git a/security/integrity/ima/Kconfig > > > > > b/security/integrity/ima/Kconfig > > > > > index 35ef693..6a8f677 100644 > > > > > +++ b/security/integrity/ima/Kconfig > > > > > @@ -10,6 +10,7 @@ config IMA > > > > >   select CRYPTO_HASH_INFO > > > > >   select TCG_TPM if HAS_IOMEM && !UML > > > > >   select TCG_TIS if TCG_TPM && X86 > > > > Well, this explains why IMA doesn't work on one of my X86 systems: > > it's got a non i2c infineon TPM. > > > > > > > > > > > > > > > > > > > + select TCG_CRB if TCG_TPM && ACPI > > > > >   select TCG_IBMVTPM if TCG_TPM && PPC_PSERIES > > > > >   help > > > > >     The Trusted Computing Group(TCG) runtime Integrity > > > > > > > > This seems really weird, why are any specific TPM drivers > > > > linked to IMA config, we have lots of drivers.. > > > > > > > > I don't think I've ever seen this pattern in Kconfig before? > > > > > > As you've seen by the current discussions, the TPM driver needs > > > to be initialized prior to IMA.  Otherwise IMA goes into TPM- > > > bypass mode.  That implies that the TPM must be builtin to the > > > kernel, and not as a kernel module. > > > > Actually, that's not necessarily true:  If we don't begin appraisal > > until after the initrd phase, then the initrd can load TPM modules > > before IMA starts. > > > > This would involve a bit of code rejigging to not require a TPM > > until IMA wants to write its first measurement, but it looks doable > > and would get us out of having to second guess TPM selections. > > The question is about measurement, not appraisal.  Although the > initramfs might be measured, the initramfs can access files on the > real root filesystem.  Those files need to be measured, before they > are used/accessed. Isn't it a question of threat model?  Because the initrd is measured, you know it's the one you specified and you should know its security properties, so measurement doesn't really need to begin until the root pivots.  At that point you pick up the boot aggregate so the log now is tied to the initrd measurement.  Conversely, I can't really see a threat model where you could trick a correctly measured initrd into subverting IMA, especially because listening network daemons aren't usually active at this stage. I'm not saying there isn't a use case for wanting your TPM built in, I'm just saying I don't think it needs to be required for everyone who uses IMA. James