From: Mehmet Kayaalp <mkayaalp@linux.vnet.ibm.com>
To: James Morris <jmorris@namei.org>
Cc: Mimi Zohar <zohar@linux.vnet.ibm.com>,
David Howells <dhowells@redhat.com>,
David Woodhouse <dwmw2@infradead.org>,
Keyrings <keyrings@vger.kernel.org>,
Linux Integrity <linux-integrity@vger.kernel.org>,
Linux Security <linux-security-module@vger.kernel.org>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Stefan Berger <stefanb@linux.vnet.ibm.com>,
George Wilson <gcwilson@us.ibm.com>,
Mike Rapoport <rppt@linux.vnet.ibm.com>,
Patrick Callaghan <patrickc@us.ibm.com>
Subject: Re: [PATCH v6 0/4] Certificate insertion support for x86 bzImages
Date: Thu, 3 May 2018 21:20:16 -0400 [thread overview]
Message-ID: <04EE0041-8DF1-4FF3-9C59-64ECF0182CC5@linux.vnet.ibm.com> (raw)
In-Reply-To: <1525383720.3539.76.camel@linux.vnet.ibm.com>
> On May 3, 2018, at 5:42 PM, Mimi Zohar <zohar@linux.vnet.ibm.com> wrote:
>
> On Fri, 2018-05-04 at 03:11 +1000, James Morris wrote:
>> On Wed, 2 May 2018, Mehmet Kayaalp wrote:
>>
>>> These patches add support for modifying the reserved space for extra
>>> certificates in a compressed bzImage in x86. This allows separating the
>>> system keyring certificate from the kernel build process. After the kernel
>>> image is distributed, the insert-sys-cert script can be used to insert the
>>> certificate for x86.
>>
>> Can you provide more explanation of how this is useful and who would use
>> it?
>
> I'm involved in a number projects that rely on a kernel build group to
> actually build kernels for their systems. Reserving memory for
> additional public keys, allows product groups to insert public keys
> post build. Initially the product groups might insert development
> keys, but eventually they would insert the product's public key.
>
> Mimi
With CONFIG_SYSTEM_TRUSTED_KEYRING, we have a system keyring populated
with keys that we trust. Initial keys are compiled-in:
-The module signing key, as specified by CONFIG_MODULE_SIG_KEY,
-Additional keys, as specified by CONFIG_SYSTEM_TRUSTED_KEYS.
In userspace, we can add more keys to the system keyring, only if they can be
verified by keys already in the keyring.
In kernel or modules, we can bypass this restriction by using the
KEY_ALLOC_BYPASS_RESTRICTION flag. As far as I can tell, only the compiled-in
keys are loaded this way in the upstream kernel.
Other asymmetric keyrings can specify the same restriction using the
"builtin_trusted" option. Currently, CONFIG_INTEGRITY_TRUSTED_KEYRING creates
".ima" and ".evm" keyrings with this restriction. As a result, in order to
add a key to an integrity keyring, either that key needs to be compiled-in,
or it must be signed with a key that is in the system keyring, which again
needs to be compiled-in.
If a user is not compiling their own kernel, and has no access to the module
signing key (or any other compiled-in key), then how can they add their own
keys to the integrity keyrings?
This patchset allows the user to take the kernel from a distro, insert their
own key, sign the resulting image as required for their secure boot method,
and when booted, the system keyring will include their key, which can be used
to control the integrity keys.
An alternative way is to allow the "secondary" trusted keyring to verify the
IMA keys with CONFIG_IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY, but
it is the same problem. Some distros carry patches that populate the
secondary keyring with UEFI keys during kernel initialization, which would
mean having access to a UEFI key (which is also needed with this patchset,
for signing the resulting image), would be enough to add integrity keys. But
that is much more permissive, since ANY key that goes into the secondary
keyring, coming from UEFI, could then be used to control the integrity keys.
Mehmet
prev parent reply other threads:[~2018-05-04 1:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-02 23:08 Mehmet Kayaalp
2018-05-02 23:08 ` [PATCH v6 1/4] KEYS: Insert incompressible bytes to reserve space in bzImage Mehmet Kayaalp
2018-05-02 23:08 ` [PATCH v6 2/4] KEYS: Add ELF class-independent certificate insertion support Mehmet Kayaalp
2018-05-02 23:08 ` [PATCH v6 3/4] KEYS: Support for inserting a certificate into x86 bzImage Mehmet Kayaalp
2018-05-02 23:08 ` [PATCH v6 4/4] KEYS: Print insert-sys-cert information to stdout instead of stderr Mehmet Kayaalp
2018-05-03 17:11 ` [PATCH v6 0/4] Certificate insertion support for x86 bzImages James Morris
2018-05-03 21:42 ` Mimi Zohar
2018-05-04 1:20 ` Mehmet Kayaalp [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=04EE0041-8DF1-4FF3-9C59-64ECF0182CC5@linux.vnet.ibm.com \
--to=mkayaalp@linux.vnet.ibm.com \
--cc=dhowells@redhat.com \
--cc=dwmw2@infradead.org \
--cc=gcwilson@us.ibm.com \
--cc=jmorris@namei.org \
--cc=keyrings@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=patrickc@us.ibm.com \
--cc=rppt@linux.vnet.ibm.com \
--cc=stefanb@linux.vnet.ibm.com \
--cc=zohar@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®