Re: [RFC PATCH 00/20] KEYS: Restrict additions to 'trusted' keyrings [ver #2]

From: David Howells
Date: Wed Feb 03 2016 - 10:56:30 EST


Mimi Zohar <zohar@xxxxxxxxxxxxxxxxxx> wrote:

> > (*) Keys can be added to the blacklist keyring by root if the keys are
> > signed by a key in the builtin system keyring. These can then be
> > searched for by asymmetric key ID. This allows the functionality
> > of the IMA blacklist keyring to be replicated.
> >
> > It might be worth making an asymmetric key subtype that carries no
> > data to be used here as the cryptographic material is then just
> > dead weight since the IDs are what matter.
>
> I would go one step farther and say that only this new asymmetric key
> subtype, that carries no data, be permitted. Otherwise the same
> certificate, that was used for loading the key in the first place, could
> be inadvertently added to the blacklist.

Sounds reasonable. The question then is how to select the subtype to be
added. The preparse has no concept of where the key is going to end up.

Maybe I need the following system call:

blacklist_key(const char *type, const char *description,
const void *payload, size_t plen,
key_serial_t keyring);

to tell the parser what we intend.

If I can drop the destination keyring argument, I can make it a keyctl()
instead.

David