Re: [PATCH RFC v2 00/12] Enroll kernel keys thru MOK

From: Mimi Zohar
Date: Thu Aug 05 2021 - 09:59:13 EST

On Wed, 2021-08-04 at 02:56 +0000, Eric Snowberg wrote:

> Ok, I’ll update the current code to just load CA keys into the mok in v3. This would
> simplify the new restrict_link_by_ca function.

Thank you!
> With that change, do you see any issues with how I’m doing the linking? With the
> mok keyring linked to the secondary keyring, the platform keyring may only contain
> a subset of the keys it originally contained. But, as I described above, I don’t believe
> it will lead to a regression since all keys get referenced. Thanks.

I think there is a problem. Only the builtin keys should ever be on
the builtin keyring. The builtin keyring would need to be linked to
the mok keyring. But in the secondary keyring case, the linking
should be the reverse, where the mok keyring would be linked to the
secondary keyring, similar to how the builtin keyring is linked to the
secondary keyring.

if (key_link(secondary_trusted_keys, builtin_trusted_keys) < 0)
panic("Can't link trusted keyrings\n");