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=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 05021CA9EAF for ; Thu, 24 Oct 2019 19:48:53 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A297E2070B for ; Thu, 24 Oct 2019 19:48:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="Aec2M9vn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A297E2070B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46zd8y3T04zDqVQ for ; Fri, 25 Oct 2019 06:48:50 +1100 (AEDT) Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46zWC83VxtzDq6y for ; Fri, 25 Oct 2019 02:20:20 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="Aec2M9vn"; dkim-atps=neutral Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) by bilbo.ozlabs.org (Postfix) with ESMTP id 46zWC806Czz8vKD for ; Fri, 25 Oct 2019 02:20:20 +1100 (AEDT) Received: by ozlabs.org (Postfix) id 46zWC76mjvz9sQv; Fri, 25 Oct 2019 02:20:19 +1100 (AEDT) Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.microsoft.com (client-ip=13.77.154.182; helo=linux.microsoft.com; envelope-from=nramas@linux.microsoft.com; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="Aec2M9vn"; dkim-atps=neutral Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by ozlabs.org (Postfix) with ESMTP id 46zWC71fgdz9sQr; Fri, 25 Oct 2019 02:20:18 +1100 (AEDT) Received: from [10.137.112.108] (unknown [131.107.174.108]) by linux.microsoft.com (Postfix) with ESMTPSA id 650BD20106BE; Thu, 24 Oct 2019 08:20:17 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 650BD20106BE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1571930417; bh=fOMyGZiF2U/ZovXZCK4NxXGRhszfJdpIiYVpPS9my4M=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=Aec2M9vnd4bkFq+YJyfVqt/f6e6cTCfnbLFWz6VXmyIfPtpveq4FRmSkcxURnmukq yc5P586Y1pzliC68WKrbH+wbgqDa7TwK90cxmoKM7Pcp1YO/7hI0hzZNTw+cVejRq1 3bYYgWQLDV+AOyZqQHWlEumXZxWRsb4zKUtge8tM= Subject: Re: [PATCH v9 5/8] ima: make process_buffer_measurement() generic To: Nayna Jain , linuxppc-dev@ozlabs.org, linux-efi@vger.kernel.org, linux-integrity@vger.kernel.org References: <20191024034717.70552-1-nayna@linux.ibm.com> <20191024034717.70552-6-nayna@linux.ibm.com> From: Lakshmi Ramasubramanian Message-ID: <1ae56786-4d5c-ba8e-e30c-ced1e15ccb9c@linux.microsoft.com> Date: Thu, 24 Oct 2019 08:20:17 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191024034717.70552-6-nayna@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Fri, 25 Oct 2019 06:41:16 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel , Eric Ricther , Prakhar Srivastava , linux-kernel@vger.kernel.org, Mimi Zohar , Claudio Carvalho , Matthew Garret , Greg Kroah-Hartman , Paul Mackerras , Jeremy Kerr , Elaine Palmer , Oliver O'Halloran , George Wilson Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 10/23/19 8:47 PM, Nayna Jain wrote: Hi Nayna, > +void process_buffer_measurement(const void *buf, int size, > + const char *eventname, enum ima_hooks func, > + int pcr) > { > int ret = 0; > struct ima_template_entry *entry = NULL; > + if (func) { > + security_task_getsecid(current, &secid); > + action = ima_get_action(NULL, current_cred(), secid, 0, func, > + &pcr, &template); > + if (!(action & IMA_MEASURE)) > + return; > + } In your change set process_buffer_measurement is called with NONE for the parameter func. So ima_get_action (the above if block) will not be executed. Wouldn't it better to update ima_get_action (and related functions) to handle the ima policy (func param)? thanks, -lakshmi