Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1750668ybv; Thu, 6 Feb 2020 09:09:43 -0800 (PST) X-Google-Smtp-Source: APXvYqwul65VDDAqbSQ9UWYhfKh8XrKlzDWpeqIWGyy9K7RBC/Dj15LEEy8ti/9M0mH56UiL9J3d X-Received: by 2002:a05:6808:7dd:: with SMTP id f29mr7848083oij.67.1581008983817; Thu, 06 Feb 2020 09:09:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581008983; cv=none; d=google.com; s=arc-20160816; b=hPboz4cAV2I9xW9D/dOLyQhcHQUCg/Ltp/wG5viZ/2U58ez01N8wa5NtyPIDVZjeDB kHrgkIdsghCvbkpnNhrNH7UXsdDm3AJZfq2+BOOOjOyMuQ1OSvT/TIlfWz0ZO9RTLBAS PgKejvwGcmL3lzgzRGkDre8lmbaF47WCuJAoerRkczS6JUjDiE+q99NUMvlFth0nc9lr IqcOYDxLdC6xFuEF2aEkP0qF/1I4XTyn4F8OHTAG/uAJB8Dj3sBCq3A6X3CSViIcspH8 62vwleQTUemn1/hR7uYfpHu7PqjtYGgh2XJTeTMZeOGtaB+egoC6MUNoVExnwf4hM3Ul 6ymQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature:dkim-filter; bh=hlwVzxb4UU8cnAPgCWYXMIzujw/M5LqObBrLV/WPdAQ=; b=XK7T2xJQR5aL7YxZMn1NSS2H76sVxi9Wr9FLyztbWq55KmKXQlKnFUn1wUNdwDMZu7 tqhGMKHLST+ZwQihJ9/obOwdY5t7PlQM6JMo0HdE6G15r5LChY3J7BfJzYNbIOYf7OxB 397dJJNfp3BzxFH8P9Ej22J55X/v4TO0dekz1rBOibb86EfwIlNl+WyVwYv34RfuNTCR +XG/2NnifsVjw1UMtOSG0CFqiJv7Boe9YfkdJr7Ax0B09YvlFv69joaaDx4LuJrtTkQJ DvCyN/GhHJfii3caPN4rg3q4jn7fFVQsbhg2y3IqtpAEgw8WiCTIVdbF1xWLJFpe8dfi Xesg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=hsGIOcRz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g25si93913otj.198.2020.02.06.09.09.25; Thu, 06 Feb 2020 09:09:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=hsGIOcRz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727896AbgBFRHG (ORCPT + 99 others); Thu, 6 Feb 2020 12:07:06 -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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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