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=-19.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1,USER_IN_DEF_DKIM_WL autolearn=ham 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 DCCFCC433E0 for ; Tue, 16 Mar 2021 16:24:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AD8996510A for ; Tue, 16 Mar 2021 16:24:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238662AbhCPQYF (ORCPT ); Tue, 16 Mar 2021 12:24:05 -0400 Received: from linux.microsoft.com ([13.77.154.182]:38518 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236527AbhCPQYD (ORCPT ); Tue, 16 Mar 2021 12:24:03 -0400 Received: from [192.168.0.104] (c-73-42-176-67.hsd1.wa.comcast.net [73.42.176.67]) by linux.microsoft.com (Postfix) with ESMTPSA id 1561F20B26E1; Tue, 16 Mar 2021 09:24:02 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 1561F20B26E1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1615911842; bh=y4Z7ovh3h5VbNC+wfzD4pyuYxRSzFDGiST75RbHzIT0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=DoQ0y8Cs5W8kpKV0mV4+wDWxncdLEk+RHTrrnfrLh6pJkBtJHqsJdm2k08GDsQ6Zn IrjvWmfn16DSGrUb0H5IHP0ENmRa/ejNKXgbdGd4nDfjJnCJOux8mkDs4BTAy5Fk4y O9BD84yQu960er7bqEc0xOp8qYtsh+NmVf4wTLW0= Subject: Re: [PATCH v2] IMA: Allow only ima-buf template for key measurement To: Petr Vorel , Mimi Zohar Cc: tusharsu@linux.microsoft.com, ltp@lists.linux.it, linux-integrity@vger.kernel.org References: <20210314233646.2925-1-nramas@linux.microsoft.com> From: Lakshmi Ramasubramanian Message-ID: Date: Tue, 16 Mar 2021 09:23:57 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org On 3/16/21 7:07 AM, Petr Vorel wrote: > Hi Lakshmi, Mimi, > >> ima-buf is the default IMA template used for all buffer measurements. >> Therefore, IMA policy rule for measuring keys need not specify >> an IMA template. But if a template is specified for key measurement >> rule then it must be only ima-buf. > >> Update keys tests to not require a template to be specified for >> key measurement rule, but if a template is specified verify it is >> only ima-buf. > > Reviewed-by: Petr Vorel Thanks Petr. > > Just a double check does it always work without template=ima-buf for all kernel versions? > Or only for kernels with dea87d0889dd ("ima: select ima-buf template for buffer measurement") > i.e. v5.11-rc1 or backport? The above change is required. Prior to this change, template has to be specified in the policy, otherwise the default template would be used. > > Also, don't we want to change also keycheck.policy? > Currently it contains: > measure func=KEY_CHECK keyrings=.ima|.evm|.builtin_trusted_keys|.blacklist|key_import_test template=ima-buf > Do we want to drop template=ima-buf to test the default value? Or have two rules > (one with template=ima-buf, other w/a?) Good point. I will send you the v3 patch - with two rules: one with template=buf and other without a template, like the following example: measure func=KEY_CHECK keyrings=.builtin_trusted_keys|.blacklist|key_import_test template=ima-buf measure func=KEY_CHECK keyrings=.ima|.evm -lakshmi > > Mimi, any comment on this? > > Kind regards, > Petr >