Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1371929

Re: [RFC PATCH 12/12] IMA: Use the the system trusted keyrings instead of .ima_mok [ver #3]

From Mimi Zohar <zohar@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [RFC PATCH 12/12] IMA: Use the the system trusted keyrings instead of .ima_mok [ver #3]
Date 2016-04-05 22:50 +0200
Message-ID <rkG5c-1el-13@gated-at.bofh.it> (permalink)
References <raKjM-77j-5@gated-at.bofh.it> <raKtu-7bN-47@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 2016-03-09 at 11:19 +0000, David Howells wrote:

> -#ifdef CONFIG_SYSTEM_TRUSTED_KEYRING
> -/*
> - * Restrict the addition of keys into the IMA keyring.
> - *
> - * Any key that needs to go in .ima keyring must be signed by CA in
> - * either .system or .ima_mok keyrings.
> - */
> -static int restrict_link_by_ima_mok(struct key *keyring,
> -				    const struct key_type *type,
> -				    const union key_payload *payload)
> -{
> -	int ret;
> -
> -	ret = restrict_link_by_builtin_trusted(keyring, type, payload);
> -	if (ret != -ENOKEY)
> -		return ret;
> -
> -	return restrict_link_by_signature(get_ima_mok_keyring(),
> -					  type, payload);
> -}
> +#if defined(CONFIG_IMA_KEYRINGS_ADD_IF_SIGNED_BY_BUILTIN)
> +#define restrict_link_to_ima restrict_link_by_builtin_trusted
> +#elif defined(CONFIG_IMA_KEYRINGS_ADD_IF_SIGNED_BY_BUILTIN_OR_SECONDARY)
> +#define restrict_link_to_ima restrict_link_by_builtin_and_secondary_trusted

FYI, restrict_link_by_ima_mok() allows keys to be added to the IMA
keyring signed by a key on the .ima_mok keyring, but
restrict_link_by_builtin_and_secondary_trusted() results in "errno:
Required key not available (126)".

Mimi

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [RFC PATCH 12/12] IMA: Use the the system trusted keyrings  instead of .ima_mok [ver #3] Mimi Zohar <zohar@linux.vnet.ibm.com> - 2016-04-05 22:50 +0200
  Re: [RFC PATCH 12/12] IMA: Use the the system trusted keyrings instead of .ima_mok [ver #3] David Howells <dhowells@redhat.com> - 2016-04-06 18:20 +0200
    Re: [RFC PATCH 12/12] IMA: Use the the system trusted keyrings  instead of .ima_mok [ver #3] Mimi Zohar <zohar@linux.vnet.ibm.com> - 2016-04-06 18:50 +0200

csiph-web