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=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 4F430C28CC3 for ; Fri, 7 Jun 2019 06:46:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1DB742089E for ; Fri, 7 Jun 2019 06:46:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727003AbfFGGqj (ORCPT ); Fri, 7 Jun 2019 02:46:39 -0400 Received: from lhrrgout.huawei.com ([185.176.76.210]:32992 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726761AbfFGGqj (ORCPT ); Fri, 7 Jun 2019 02:46:39 -0400 Received: from LHREML712-CAH.china.huawei.com (unknown [172.18.7.106]) by Forcepoint Email with ESMTP id 1DF59CE7DD70E902315D; Fri, 7 Jun 2019 07:46:38 +0100 (IST) Received: from [10.220.96.108] (10.220.96.108) by smtpsuk.huawei.com (10.201.108.35) with Microsoft SMTP Server (TLS) id 14.3.408.0; Fri, 7 Jun 2019 07:46:37 +0100 Subject: Re: [PATCH V4] IMA: Allow profiles to define the desired IMA template To: Mimi Zohar , Matthew Garrett CC: linux-integrity , Mimi Zohar , prakhar srivastava , "Thiago Jung Bauermann" References: <20190604203859.181156-1-matthewgarrett@google.com> <1559691534.4278.14.camel@linux.ibm.com> <1559761830.4278.30.camel@linux.ibm.com> <40275b34-c86e-7550-9eec-78a2b1d316f7@huawei.com> <1559861118.4278.182.camel@linux.ibm.com> From: Roberto Sassu Message-ID: Date: Fri, 7 Jun 2019 08:46:41 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <1559861118.4278.182.camel@linux.ibm.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.220.96.108] X-CFilter-Loop: Reflected Sender: linux-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org On 6/7/2019 12:45 AM, Mimi Zohar wrote: > On Thu, 2019-06-06 at 10:09 +0200, Roberto Sassu wrote: >> On 6/5/2019 9:10 PM, Mimi Zohar wrote: >>> On Wed, 2019-06-05 at 11:12 -0700, Matthew Garrett wrote: >>>> On Tue, Jun 4, 2019 at 4:39 PM Mimi Zohar wrote: >>>>> Matthew, what is a "profile"? Could we rename this patch to something >>>>> clearer? Maybe something like "support for per policy rule template >>>>> formats"? >>>> >>>> Sounds good to me. Could you also add an Inspired-By: Roberto Sassu >>>> ? >>> >>> Thanks, done. >> >> Thanks Matthew. >> >> If the patch it is not merged yet, please define and initialize the >> template_name variable in ima_policy_show() as the same as in >> ima_measurement_show(). > > The policy rule processing should prevent loading a custom policy with > a template rule, without specifying a valid template name.  Why does > ima_policy_show() need to initialize entry->template->name? The last element of builtin_templates is reserved for a custom format that can be specified with the ima_template_fmt= kernel option. This last element has name length equal to zero. It can be found by lookup_template_desc() if specified in a policy rule. Roberto -- HUAWEI TECHNOLOGIES Duesseldorf GmbH, HRB 56063 Managing Director: Bo PENG, Jian LI, Yanli SHI