All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: zohar@linux.vnet.ibm.com
Cc: dhowells@redhat.com, linux-security-module@vger.kernel.org,
	keyrings@vger.kernel.org, petkan@mip-labs.com,
	linux-kernel@vger.kernel.org
Subject: [RFC PATCH 01/15] X.509: Partially revert patch to add validation against IMA MOK keyring
Date: Fri, 08 Jan 2016 18:33:27 +0000	[thread overview]
Message-ID: <20160108183327.25960.95064.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <20160108183319.25960.49807.stgit@warthog.procyon.org.uk>

Partially revert commit 41c89b64d7184a780f12f2cccdabe65cb2408893:

	Author: Petko Manolov <petkan@mip-labs.com>
	Date:   Wed Dec 2 17:47:55 2015 +0200
	IMA: create machine owner and blacklist keyrings

The problem is that prep->trusted is a simple boolean and the additional
x509_validate_trust() call doesn't therefore distinguish levels of
trustedness, but is just OR'd with the result of validation against the
system trusted keyring.

However, setting the trusted flag means that this key may be added to *any*
trusted-only keyring - including the system trusted keyring.

Whilst I appreciate what the patch is trying to do, I don't think this is
quite the right solution.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Petko Manolov <petkan@mip-labs.com>
cc: Mimi Zohar <zohar@linux.vnet.ibm.com>
cc: keyrings@vger.kernel.org
---

 crypto/asymmetric_keys/x509_public_key.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/crypto/asymmetric_keys/x509_public_key.c b/crypto/asymmetric_keys/x509_public_key.c
index 9e9e5a6a9ed6..2a44b3752471 100644
--- a/crypto/asymmetric_keys/x509_public_key.c
+++ b/crypto/asymmetric_keys/x509_public_key.c
@@ -321,8 +321,6 @@ static int x509_key_preparse(struct key_preparsed_payload *prep)
 			goto error_free_cert;
 	} else if (!prep->trusted) {
 		ret = x509_validate_trust(cert, get_system_trusted_keyring());
-		if (ret)
-			ret = x509_validate_trust(cert, get_ima_mok_keyring());
 		if (!ret)
 			prep->trusted = 1;
 	}

  reply	other threads:[~2016-01-08 18:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-08 18:33 [RFC PATCH 00/15] KEYS: Restrict additions to 'trusted' keyrings David Howells
2016-01-08 18:33 ` David Howells [this message]
2016-01-08 18:33 ` [RFC PATCH 02/15] X.509: Don't treat self-signed keys specially David Howells
2016-01-08 18:33 ` [RFC PATCH 03/15] KEYS: Generalise system_verify_data() to provide access to internal content David Howells
2016-01-08 18:33 ` [RFC PATCH 04/15] PKCS#7: Make trust determination dependent on contents of trust keyring David Howells
2016-01-08 18:33 ` [RFC PATCH 05/15] KEYS: Add an alloc flag to convey the builtinness of a key David Howells
2016-01-08 18:34 ` [RFC PATCH 06/15] KEYS: Add a facility to restrict new links into a keyring David Howells
2016-01-08 18:34 ` [RFC PATCH 07/15] KEYS: Allow authentication data to be stored in an asymmetric key David Howells
2016-01-08 18:34 ` [RFC PATCH 08/15] KEYS: Add identifier pointers to public_key_signature struct David Howells
2016-01-08 18:34 ` [RFC PATCH 09/15] X.509: Retain the key verification data David Howells
2016-01-08 18:34 ` [RFC PATCH 10/15] X.509: Extract signature digest and make self-signed cert checks earlier David Howells
2016-01-08 18:34 ` [RFC PATCH 11/15] PKCS#7: Make the signature a pointer rather than embedding it David Howells
2016-01-08 18:34 ` [RFC PATCH 12/15] X.509: Move the trust validation code out to its own file David Howells
2016-01-08 18:34 ` [RFC PATCH 13/15] KEYS: Generalise x509_request_asymmetric_key() David Howells
2016-01-08 18:35 ` [RFC PATCH 14/15] KEYS: Move the point of trust determination to __key_link() David Howells
2016-01-08 18:35 ` [RFC PATCH 15/15] KEYS: Remove KEY_FLAG_TRUSTED David Howells
2016-01-08 18:54 ` [RFC PATCH 00/15] KEYS: Restrict additions to 'trusted' keyrings Mimi Zohar
2016-01-08 19:18   ` Mimi Zohar
2016-01-12  0:38   ` David Howells
2016-01-12  2:43     ` Mimi Zohar
2016-01-12  0:37 ` David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160108183327.25960.95064.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=petkan@mip-labs.com \
    --cc=zohar@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.