Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1024048pxb; Tue, 1 Feb 2022 16:06:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJzaopz9c8/Z2w+izzezWmnZjyIlUkgyJvU22gzGow22/qYDp8B6N8g300uX76rePhgCAvuc X-Received: by 2002:a17:907:3e04:: with SMTP id hp4mr23764197ejc.364.1643760360851; Tue, 01 Feb 2022 16:06:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643760360; cv=none; d=google.com; s=arc-20160816; b=fmtrRJidqb0pcwZhNVqWWzOCJjRNRqEy2fFjMzHBUgcki6fO4dRKoLDM5euxjonKoI yWKgO/vRcRc2wjbx0whkgTdrIoA+8EejQuRQX0fsiBhVBBLBGPvvcGL88EjA2JM1fdhm Q26TUCogExwxWmyTh5x3F5xvKyr4xTMhLSfpz9uwr81daYWpGEnKYKgFoklwqP8DVBsq BIRNU8OSL3zwu3NQUJJrxpdzHxCCkHe92Lh4w8BMaLW8r2SrSXD5LY1htqBQHerbrN6C LRkzmmdqJKm2rC6qvWfuJtTckrqEPtQlla1xDXDJt4g33fkrvNc8DqEIgDBH/noXuDPd 5Wag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hdf818n0JS9gFDPavPumK3Pu1O/dy4do4F2AGJFkDuw=; b=WhpmCiPS0IxEkhTedoVjqSuWfUHeN3vO1fKhORk5EN8erp/PoQNHzmn8e/OcSPa9Xr 0O1VsEwZ/KhQGRYZTK0LtRqBWa+qJL7qDbrMEbK9na7eUAFZFyKNNo5b0wVEluqAlyN0 UICAxbBKMEFDKAK3mSMd7us0JdW/Y+qlq+yqwaJ7PCBsnqsVrILQLjtwGuKBOzMOVQNh +z/WxuPAdhS/c5jIf+1PzkjJfr21SJ9PfyWglZknf2f+OX3gKI+8yuxRSEWSnMReW+bO GTg6X9rthbEUKR6n3uKWmen93Jsx8+Ha0SxJA+dbkw3TVfrDXxXF9HYxMyI+wtIXeXSI LV5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rP3RtIMm; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr6si10104262ejc.540.2022.02.01.16.05.34; Tue, 01 Feb 2022 16:06:00 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=rP3RtIMm; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231368AbiBAA4h (ORCPT + 99 others); Mon, 31 Jan 2022 19:56:37 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:39330 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229739AbiBAA4g (ORCPT ); Mon, 31 Jan 2022 19:56:36 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5524361180; Tue, 1 Feb 2022 00:56:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99279C340E8; Tue, 1 Feb 2022 00:56:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643676995; bh=rYNlss3eka1Q3HQyjKmRt1eCt6GjTaULeioT0xHXIYw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rP3RtIMmYgtn++eIvZpCElRLfCBoY0T9cWCWnM+4mHNxpkAhNWDJty3eMWe3RcUQo rwt7DHuJQFWrM0eLjhs1arr+C7JpUueh+/S0md3boUr5hTxD5QapCMnxNz15Ir3imK ne5Ze3xb2UL/XjtfCSfCqaH1sbqUpDOqA1M11ALBCAGASzfUbkg1CK0PN/ijXokvk5 Gr5iiw8e3RYyQF3ItAS1E9wqgEultnmj7Z6yCAf+PO38xZuBalP03BI2DVT7fsR4ld wyR2SgM5Ti6YqWMjnkg7I9q10xAS5YLin1/hFXyCVVXDhVDieCfPjofNpu/Wb3Ex5t dLFJpercGIFqQ== Date: Mon, 31 Jan 2022 16:56:34 -0800 From: Eric Biggers To: Mimi Zohar Cc: linux-integrity@vger.kernel.org, Stefan Berger , linux-fscrypt@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 5/8] ima: include fsverity's file digests in the IMA measurement list Message-ID: References: <20220126000658.138345-1-zohar@linux.ibm.com> <20220126000658.138345-6-zohar@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220126000658.138345-6-zohar@linux.ibm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 25, 2022 at 07:06:55PM -0500, Mimi Zohar wrote: > Allow fsverity's file digests to be included in the IMA measurement list > based on policy. > > Define a new measurement policy rule option named 'digest_type=' to > allow fsverity file digests to be included in the measurement list > in the d-ng field. > > Including the 'd-type' template field is recommended for unsigned > fs-verity digests to distinguish between d-ng digest types. The > following policy rule, for example, specifies the new 'ima-ngv2' > template. > > measure func=FILE_CHECK digest_type=hash|verity template=ima-ngv2 > > Signed-off-by: Mimi Zohar > --- > Documentation/ABI/testing/ima_policy | 7 +++++ > Documentation/security/IMA-templates.rst | 6 ++++ > security/integrity/ima/ima_api.c | 29 +++++++++++++++-- > security/integrity/ima/ima_policy.c | 38 ++++++++++++++++++++++- > security/integrity/ima/ima_template_lib.c | 9 +++++- > security/integrity/integrity.h | 4 ++- > 6 files changed, 88 insertions(+), 5 deletions(-) > > diff --git a/Documentation/ABI/testing/ima_policy b/Documentation/ABI/testing/ima_policy > index 839fab811b18..444bb7ccbe03 100644 > --- a/Documentation/ABI/testing/ima_policy > +++ b/Documentation/ABI/testing/ima_policy > @@ -51,6 +51,7 @@ Description: > appraise_flag:= [check_blacklist] > Currently, blacklist check is only for files signed with appended > signature. > + digest_type:= [hash|verity] This doesn't explain what this option actually does. > diff --git a/Documentation/security/IMA-templates.rst b/Documentation/security/IMA-templates.rst > index 1a91d92950a7..5e31513e8ec4 100644 > --- a/Documentation/security/IMA-templates.rst > +++ b/Documentation/security/IMA-templates.rst > @@ -69,6 +69,7 @@ descriptors by adding their identifier to the format string > algorithm (field format: [:]digest, where the digest > prefix is shown only if the hash algorithm is not SHA1 or MD5); > - 'd-modsig': the digest of the event without the appended modsig; > + - 'd-type': the type of file digest (e.g. hash, verity[1]); This should explain how this is different from the hash algorithm. - Eric