certs: Only allow certs signed by keys on the builtin keyring
authorMimi Zohar <zohar@linux.ibm.com>
Mon, 16 Oct 2023 00:18:03 +0000 (20:18 -0400)
committerMimi Zohar <zohar@linux.ibm.com>
Tue, 31 Oct 2023 12:22:36 +0000 (08:22 -0400)
commitb46503068cb9ed63ff1d8250f143354ead0b16eb
tree491f8c3159c1aadd509183ef37c572704ecbdd5c
parent7b5c3086d1f85448a2a81947b685119c6c9894c8
certs: Only allow certs signed by keys on the builtin keyring

Originally the secondary trusted keyring provided a keyring to which extra
keys may be added, provided those keys were not blacklisted and were
vouched for by a key built into the kernel or already in the secondary
trusted keyring.

On systems with the machine keyring configured, additional keys may also
be vouched for by a key on the machine keyring.

Prevent loading additional certificates directly onto the secondary
keyring, vouched for by keys on the machine keyring, yet allow these
certificates to be loaded onto other trusted keyrings.

Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
certs/Kconfig
crypto/asymmetric_keys/restrict.c