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=-12.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 51F10C33CAC for ; Thu, 6 Feb 2020 17:07:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2785421927 for ; Thu, 6 Feb 2020 17:07:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="hsGIOcRz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727060AbgBFRHF (ORCPT ); Thu, 6 Feb 2020 12:07:05 -0500 Received: from linux.microsoft.com ([13.77.154.182]:48792 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727872AbgBFRHF (ORCPT ); Thu, 6 Feb 2020 12:07:05 -0500 Received: from [10.137.112.111] (unknown [131.107.147.111]) by linux.microsoft.com (Postfix) with ESMTPSA id 5D69420B7130; Thu, 6 Feb 2020 09:07:04 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5D69420B7130 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1581008824; bh=hlwVzxb4UU8cnAPgCWYXMIzujw/M5LqObBrLV/WPdAQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=hsGIOcRzVlgnAFz2oSVbcMwignzylsslDSCi4BNXDUebD6t0cGiFTCrRp6DTjvpo/ f97gPayBkib+gu1X0xoGC2sCDAhchXiGDPjLfDDh2zZAWMH/WUMsmeyiH2Zdlvl1Em wSdzg/ItePKTkBY+mZ1kaAJIMftKIjNMFg74AZL4= Subject: Re: [RFC PATCH 1/2] ima: Implement support for uncompressed module appended signatures To: Eric Snowberg , zohar@linux.ibm.com, dmitry.kasatkin@gmail.com, jmorris@namei.org, serge@hallyn.com Cc: dhowells@redhat.com, geert@linux-m68k.org, gregkh@linuxfoundation.org, nayna@linux.ibm.com, tglx@linutronix.de, bauerman@linux.ibm.com, mpe@ellerman.id.au, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200206164226.24875-1-eric.snowberg@oracle.com> <20200206164226.24875-2-eric.snowberg@oracle.com> From: Lakshmi Ramasubramanian Message-ID: Date: Thu, 6 Feb 2020 09:07:28 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <20200206164226.24875-2-eric.snowberg@oracle.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org On 2/6/2020 8:42 AM, Eric Snowberg wrote: > > @@ -31,6 +32,7 @@ static const char * const keyring_name[INTEGRITY_KEYRING_MAX] = { > ".ima", > #endif > ".platform", > + ".builtin_trusted_keys", > }; > > #ifdef CONFIG_IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY > @@ -45,8 +47,11 @@ static struct key *integrity_keyring_from_id(const unsigned int id) > return ERR_PTR(-EINVAL); > > if (!keyring[id]) { > - keyring[id] = > - request_key(&key_type_keyring, keyring_name[id], NULL); > + if (id == INTEGRITY_KEYRING_KERNEL) > + keyring[id] = VERIFY_USE_SECONDARY_KEYRING; Since "Built-In Trusted Keyring" or "Secondary Trusted Keyring" is used, would it be more appropriate to name this identifier INTEGRITY_KEYRING_BUILTIN_OR_SECONDARY? > diff --git a/security/integrity/integrity.h b/security/integrity/integrity.h > index 73fc286834d7..63f0e6bff0e0 100644 > --- a/security/integrity/integrity.h > +++ b/security/integrity/integrity.h > @@ -145,7 +145,8 @@ int integrity_kernel_read(struct file *file, loff_t offset, > #define INTEGRITY_KEYRING_EVM 0 > #define INTEGRITY_KEYRING_IMA 1 > #define INTEGRITY_KEYRING_PLATFORM 2 > -#define INTEGRITY_KEYRING_MAX 3 > +#define INTEGRITY_KEYRING_KERNEL 3 > +#define INTEGRITY_KEYRING_MAX 4 -lakshmi