From: "Mickaël Salaün" <mic@digikod.net>
To: Mike Snitzer <snitzer@redhat.com>
Cc: "Alasdair Kergon" <agk@redhat.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Deven Bowers" <deven.desai@linux.microsoft.com>,
"Jaskaran Khurana" <jaskarankhurana@linux.microsoft.com>,
"Milan Broz" <gmazyland@gmail.com>,
dm-devel@redhat.com, linux-integrity@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Jarkko Sakkinen" <jarkko.sakkinen@linux.intel.com>,
"Mickaël Salaün" <mic@linux.microsoft.com>
Subject: Re: [PATCH v2] dm verity: Add support for signature verification with 2nd keyring
Date: Fri, 16 Oct 2020 10:49:22 +0200 [thread overview]
Message-ID: <b7ba2ff9-5f5f-8c1e-dfaa-33da56d3d8de@digikod.net> (raw)
In-Reply-To: <022e949e-00c4-d98a-b536-1c5f9e05c09c@digikod.net>
On 16/10/2020 10:29, Mickaël Salaün wrote:
>
> On 15/10/2020 18:52, Mike Snitzer wrote:
>> On Thu, Oct 15 2020 at 11:05am -0400,
>> Mickaël Salaün <mic@digikod.net> wrote:
>>
>>> From: Mickaël Salaün <mic@linux.microsoft.com>
>>>
>>> Add a new configuration DM_VERITY_VERIFY_ROOTHASH_SIG_SECONDARY_KEYRING
>>> to enable dm-verity signatures to be verified against the secondary
>>> trusted keyring. Instead of relying on the builtin trusted keyring
>>> (with hard-coded certificates), the second trusted keyring can include
>>> certificate authorities from the builtin trusted keyring and child
>>> certificates loaded at run time. Using the secondary trusted keyring
>>> enables to use dm-verity disks (e.g. loop devices) signed by keys which
>>> did not exist at kernel build time, leveraging the certificate chain of
>>> trust model. In practice, this makes it possible to update certificates
>>> without kernel update and reboot, aligning with module and kernel
>>> (kexec) signature verification which already use the secondary trusted
>>> keyring.
>>>
>>> Cc: Alasdair Kergon <agk@redhat.com>
>>> Cc: Andrew Morton <akpm@linux-foundation.org>
>>> Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
>>> Cc: Jaskaran Khurana <jaskarankhurana@linux.microsoft.com>
>>> Cc: Mike Snitzer <snitzer@redhat.com>
>>> Cc: Milan Broz <gmazyland@gmail.com>
>>> Signed-off-by: Mickaël Salaün <mic@linux.microsoft.com>
>>> ---
>>>
>>> Previous version:
>>> https://lore.kernel.org/lkml/20201002071802.535023-1-mic@digikod.net/
>>>
>>> Changes since v1:
>>> * Extend the commit message (asked by Jarkko Sakkinen).
>>> * Rename the Kconfig "help" keyword according to commit 84af7a6194e4
>>> ("checkpatch: kconfig: prefer 'help' over '---help---'").
>>
>> Can you please explain why you've decided to make this a Kconfig CONFIG
>> knob? Why not either add: a dm-verity table argument? A dm-verity
>> kernel module parameter? or both (to allow a particular default but then
>> per-device override)?
>
> The purpose of signed dm-verity images is to authenticate files, or said
> in another way, to enable the kernel to trust disk images in a flexible
> way (i.e. thanks to certificate's chain of trust). Being able to update
> such chain at run time requires to use the second trusted keyring. This
> keyring automatically includes the certificate authorities from the
> builtin trusted keyring, which are required to dynamically populate the
> secondary trusted keyring with certificates signed by an already trusted
> authority. The roots of trust must then be included at build time in the
> builtin trusted keyring.
>
> To be meaningful, using dm-verity signatures implies to have a
> restricted user space, i.e. even the root user has limited power over
> the kernel and the rest of the system. Blindly trusting data provided by
> user space (e.g. dm-verity table argument, kernel module parameter)
> defeat the purpose of (mandatory) authenticated images.
>
>>
>> Otherwise, _all_ DM verity devices will be configured to use secondary
>> keyring fallback. Is that really desirable?
>
> That is already the current state (on purpose).
I meant that when DM_VERITY_VERIFY_ROOTHASH_SIG is set, dm-verity
signature becomes mandatory. This new configuration
DM_VERITY_VERIFY_ROOTHASH_SIG_SECONDARY_KEYRING extend this trust to the
secondary trusted keyring, which contains certificates signed (directly
or indirectly) by CA from the builtin trusted keyring.
So yes, this new (optional) configuration *extends* the source of trust
for all dm-verity devices, and yes, it is desirable. I think it should
have been this way from the beginning (as for other authentication
mechanisms) but it wasn't necessary at that time.
>
>>
>> Regardless, I really don't see why a Kconfig knob is appropriate.
>
> Moreover, a Kconfig knob makes sense as much as
> DM_VERITY_VERIFY_ROOTHASH_SIG,
> IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY, MODULE_SIG_FORCE and
> other similar authentication mechanisms. Indeed, when using these
> configurations, we want the kernel to enforce a specific policy.
>
> Obviously, we can't make the DM_VERITY_VERIFY_ROOTHASH_SIG relies on the
> secondary trusted keyring without important security implications for
> systems already using this configuration (and then the builtin trusted
> keyring as the unique source of trust).
>
next prev parent reply other threads:[~2020-10-16 8:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-15 15:05 Mickaël Salaün
2020-10-15 16:52 ` Mike Snitzer
2020-10-16 8:29 ` Mickaël Salaün
2020-10-16 8:49 ` Mickaël Salaün [this message]
2020-10-16 11:08 ` Milan Broz
2020-10-16 12:19 ` Mickaël Salaün
2020-10-23 10:20 ` Mickaël Salaün
2020-10-23 15:11 ` Mike Snitzer
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=b7ba2ff9-5f5f-8c1e-dfaa-33da56d3d8de@digikod.net \
--to=mic@digikod.net \
--cc=agk@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=deven.desai@linux.microsoft.com \
--cc=dm-devel@redhat.com \
--cc=gmazyland@gmail.com \
--cc=jarkko.sakkinen@linux.intel.com \
--cc=jaskarankhurana@linux.microsoft.com \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mic@linux.microsoft.com \
--cc=snitzer@redhat.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®