Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3814056ybt; Tue, 30 Jun 2020 11:45:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyy4Jj7xxOpVAvwhgXimI4Bht2Trtat3pOt4aB14DYDGxb3ib+oXGjje3vnasMss1Ka2+ri X-Received: by 2002:a17:907:7245:: with SMTP id ds5mr19315294ejc.1.1593542359808; Tue, 30 Jun 2020 11:39:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593542359; cv=none; d=google.com; s=arc-20160816; b=Ks1zLqJsOn5kR0nN4M9vN90ukmgbGHraEFv20PaobscazKO67rtx2mBLXxa0wZ6W4O SvVLGQuLzXyPZGP8ARcQwJEahTyQI697RFBDkMVvbrpk9QF3MJpJF+voaCHlyINtIvEW mUn/RR6CbV0gnKuAiccoFEMVMmtX1469K7poVl+/JszWet9Ibs0TLAnDSuib9MPY5gt2 QH/PkGyME4TXHun5bRmvBh74T5OK832Cq1pS7GexgyRVXgzydqykZxOMUEIgKSo1ufQZ To72glB6WDSxidekNCyGzJMagx9cyCIby2bMWAFSGB3S67/Q4eR+qYF12zd+2HCWLkR0 9pPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:in-reply-to :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=azoIcMNsTD1M3uWCtFVYKKqCF4iC+1VT6noiu+rx+98=; b=uSx+GXxqjgBdoe1QfgmYPsFQP78tfgEDP5JxXT9eg0fcrPu41CK6HdedGjmkf58wWH zNkdBDOrg9ZcbZ2q0xzbadZD39m+VVPMYLu7T9MQk5ntqwKfY4pDudYcTy9bNcWpnjBs ipVTp9LQChUPkKU7wsluIiKm8l3T2d9BtDRY2csE4BuGP2mjCLfEZYuVUl3nEwjKCkeB AfgV8TwR4/D92k+JYRPxtWD6SQLT2+xUcUEurSaxJKLyE5Ip+Cy2JgBh0+b8gBqT4dXW iqHAPDjEbZepxj4XLvzCb4I786oiaidpWBd1CVEUo49Or8xLX+MKWcLcqZR8sQYLKFM3 hqQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=H8RbPjwX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ck17si2027963edb.508.2020.06.30.11.38.57; Tue, 30 Jun 2020 11:39:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=H8RbPjwX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389958AbgF3RBB (ORCPT + 99 others); Tue, 30 Jun 2020 13:01:01 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:53587 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727850AbgF3RBA (ORCPT ); Tue, 30 Jun 2020 13:01:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593536459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=azoIcMNsTD1M3uWCtFVYKKqCF4iC+1VT6noiu+rx+98=; b=H8RbPjwXDU0Ot0KdS7NWXyRdmBEZq8qP5q3fefZJ7aMRU9q6/wWsfXjsv6V+/B7VmLV2wI zJ8ko1dG5LBVsLP9fClJCgWWZw8xmIieKwyrwCqMPjvEhAsSsc5+xq+dDz8pYFaiCbBTCV C/4dZ0CbwnAT6Tg9ArqUo6LEFYD0R/k= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-149-v_DFkjQ9PmiHTwVMhNkzIQ-1; Tue, 30 Jun 2020 13:00:49 -0400 X-MC-Unique: v_DFkjQ9PmiHTwVMhNkzIQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D1FD6800C60; Tue, 30 Jun 2020 17:00:47 +0000 (UTC) Received: from localhost (ovpn-116-7.gru2.redhat.com [10.97.116.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id AD44D7419A; Tue, 30 Jun 2020 17:00:44 +0000 (UTC) Date: Tue, 30 Jun 2020 14:00:43 -0300 From: Bruno Meneguele To: Mimi Zohar Cc: linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, erichte@linux.ibm.com, nayna@linux.ibm.com Subject: Re: [PATCH v3 2/2] ima: move APPRAISE_BOOTPARAM dependency on ARCH_POLICY to runtime Message-ID: <20200630170043.GE2944@glitch> References: <20200623202640.4936-1-bmeneg@redhat.com> <20200623202640.4936-3-bmeneg@redhat.com> <1593204023.27152.476.camel@linux.ibm.com> <20200629234744.GA2756@glitch> <1593514848.5085.82.camel@linux.ibm.com> MIME-Version: 1.0 In-Reply-To: <1593514848.5085.82.camel@linux.ibm.com> X-PGP-Key: http://keys.gnupg.net/pks/lookup?op=get&search=0x3823031E4660608D X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=bmeneg@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qFgkTsE6LiHkLPZw" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --qFgkTsE6LiHkLPZw Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 30, 2020 at 07:00:48AM -0400, Mimi Zohar wrote: > On Mon, 2020-06-29 at 20:47 -0300, Bruno Meneguele wrote: >=20 > >=20 > > > I'm not if the "secure_boot" flag is available prior to calling > > > default_appraise_setup(), but if it is, you could modify the test > > > there to also check if the system is booted in secure boot mode (eg. > > > IS_ENABLED(CONFIG_IMA_APPRAISE_BOOTPARAM) && > > > !arch_ima_get_secureboot()) > > >=20 > >=20 > > Well pointed. I built a custom x86 kernel with some workaround to get > > this flag status within default_appraise_setup() and as a result the > > flag is was correctly available.=20 > >=20 > > Considering the nature of this flag (platform's firmware (in all > > arches?)) can we trust that every arch supporting secure/trusted boot > > will have it available in the __setup() call time? >=20 > Calling=A0default_appraise_setup() could be deferred. >=20 Hmmm.. ok, I'm going to investigate it further. Didn't really know that. > >=20 > > > > +=09=09/* In secure and/or trusted boot the appraisal must be > > > > +=09=09 * enforced, regardless kernel parameters, preventing > > > > +=09=09 * runtime changes */ > > >=20 > > > Only "appraise" rules are enforced. > > >=20 > >=20 > > Hmm.. do you mean the comment wording is wrong/"could be better", > > pointing the "appraise" action explicitly? >=20 > No, it's more than just the comment. =A0Like "trusted boot", IMA- > measurement only measures files, never enforces integrity. > =A0"ima_appraise" mode is only applicable to IMA-appraisal. ah! Ok, I see it now and in fact it shouldn't be part of the check alongside secureboot. Well, I'm going to rethink the approach entirely then. As you said, only deferring default_appraise_setup() may be probably enough. Thanks Mimi. --=20 bmeneg=20 PGP Key: http://bmeneg.com/pubkey.txt --qFgkTsE6LiHkLPZw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEdWo6nTbnZdbDmXutYdRkFR+RokMFAl77b7sACgkQYdRkFR+R okNjGwf/UV+yrhufZYUFNEextDOOPfw6c/3n7RAhFG0NrZcLmvEaDGVjrbJ7HflX MFgr2AnUqeKnBUR4LG+zeVacjf3YDTITxX1ng3momgz257i0HbIYGSagCb8+h0p4 N/ITdenByra0lACxP/IK8kXsJpRXIRmTQ1Poz79uTyXqShG6W5P3GPxSzluHsBWn FvJ06zKHysoJnF4hf/Mn4+d7LXgMs+VYOEMmuw+8U94ZNE2Az62/dqUmd3VbatM+ J6Gi+ZymVAsLhEwzIY99pgOWAO/PU2AHfgBOvghVQmQCEc7GnOxbPmgz7REQwM8t +Q/KFfuiYbNtS6MLXgtCWgEVmfqBsw== =j8Da -----END PGP SIGNATURE----- --qFgkTsE6LiHkLPZw--