lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <37D6AC4A-372D-497A-AF97-CEA03EFC9BBA@oracle.com>
Date:   Thu, 16 Sep 2021 19:55:00 -0600
From:   Eric Snowberg <eric.snowberg@...cle.com>
To:     Nayna <nayna@...ux.vnet.ibm.com>
Cc:     keyrings@...r.kernel.org,
        linux-integrity <linux-integrity@...r.kernel.org>,
        Mimi Zohar <zohar@...ux.ibm.com>,
        David Howells <dhowells@...hat.com>,
        David Woodhouse <dwmw2@...radead.org>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        "David S . Miller" <davem@...emloft.net>,
        Jarkko Sakkinen <jarkko@...nel.org>,
        James Morris <jmorris@...ei.org>,
        "Serge E . Hallyn" <serge@...lyn.com>, keescook@...omium.org,
        gregkh@...uxfoundation.org, torvalds@...ux-foundation.org,
        scott.branden@...adcom.com, weiyongjun1@...wei.com,
        nayna@...ux.ibm.com, ebiggers@...gle.com, ardb@...nel.org,
        nramas@...ux.microsoft.com, lszubowi@...hat.com,
        linux-kernel@...r.kernel.org, linux-crypto@...r.kernel.org,
        linux-security-module@...r.kernel.org,
        James.Bottomley@...senPartnership.com, pjones@...hat.com,
        "konrad.wilk@...cle.com" <konrad.wilk@...cle.com>
Subject: Re: [PATCH v6 00/13] Enroll kernel keys thru MOK


> On Sep 16, 2021, at 2:03 PM, Nayna <nayna@...ux.vnet.ibm.com> wrote:
> 
> 
> On 9/14/21 5:14 PM, Eric Snowberg wrote:
>> Back in 2013 Linus requested a feature to allow end-users to have the
>> ability "to add their own keys and sign modules they trust". This was
>> his *second* order outlined here [1]. There have been many attempts
>> over the years to solve this problem, all have been rejected.  Many
>> of the failed attempts loaded all preboot firmware keys into the kernel,
>> including the Secure Boot keys. Many distributions carry one of these
>> rejected attempts [2], [3], [4]. This series tries to solve this problem
>> with a solution that takes into account all the problems brought up in
>> the previous attempts.
>> 
>> On UEFI based systems, this series introduces a new Linux kernel keyring
>> containing the Machine Owner Keys (MOK) called machine. It also defines
>> a new MOK variable in shim. This variable allows the end-user to decide
>> if they want to load MOK keys into the machine keyring. Mimi has suggested
>> that only CA keys contained within the MOK be loaded into the machine
>> keyring. All other certs will load into the platform keyring instead.
>> 
>> By default, nothing changes; MOK keys are not loaded into the machine
>> keyring.  They are only loaded after the end-user makes the decision
>> themselves.  The end-user would set this through mokutil using a new
>> --trust-mok option [5]. This would work similar to how the kernel uses
>> MOK variables to enable/disable signature validation as well as use/ignore
>> the db. Any kernel operation that uses either the builtin or secondary
>> trusted keys as a trust source shall also reference the new machine
>> keyring as a trust source.
>> 
>> Secure Boot keys will never be loaded into the machine keyring.  They
>> will always be loaded into the platform keyring.  If an end-user wanted
>> to load one, they would need to enroll it into the MOK.
>> 
>> Steps required by the end user:
>> 
>> Sign kernel module with user created key:
>> $ /usr/src/kernels/$(uname -r)/scripts/sign-file sha512 \
>>    machine_signing_key.priv machine_signing_key.x509 my_module.ko
>> 
>> Import the key into the MOK
>> $ mokutil --import machine_signing_key.x509
>> 
>> Setup the kernel to load MOK keys into the .machine keyring
>> $ mokutil --trust-mok
>> 
>> Then reboot, the MokManager will load and ask if you want to trust the
>> MOK key and enroll the MOK into the MOKList.  Afterwards the signed kernel
>> module will load.
> 
> machine_signing_key.x509 appears to be a code-signing, self-signed key.  It's not a CA key, but the intent of the patchset is to load only CA keys to .machine keyring.
> 
> Shouldn't there be two steps: one to load the CA key into MOK, and a second one to load the code-signing key which is signed by this CA ?

I think that would depend on how the end-user wants to do things. If they 
are just looking to quickly self-sign their own kernel module, I doubt they 
would go through the effort of having two keys.  This is what I tried to 
document in the example above. 

If they do want to use multiple keys, nothing in this approach prevents it.
Their CA will be loaded into the machine keyring.  Now that the machine 
keyring is a new trust source,  they could simply load their intermediate 
or leaf cert signed by their CA into the secondary trusted keyring. Afterwards
their signed kernel module would load.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ