From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757733AbcBCP42 (ORCPT ); Wed, 3 Feb 2016 10:56:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54760 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756750AbcBCP40 convert rfc822-to-8bit (ORCPT ); Wed, 3 Feb 2016 10:56:26 -0500 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <1453316248.2858.10.camel@linux.vnet.ibm.com> References: <1453316248.2858.10.camel@linux.vnet.ibm.com> <20160119113026.23238.4498.stgit@warthog.procyon.org.uk> To: Mimi Zohar Cc: dhowells@redhat.com, linux-security-module@vger.kernel.org, keyrings@vger.kernel.org, petkan@mip-labs.com, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 00/20] KEYS: Restrict additions to 'trusted' keyrings [ver #2] MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <26531.1454514984.1@warthog.procyon.org.uk> Content-Transfer-Encoding: 8BIT Date: Wed, 03 Feb 2016 15:56:24 +0000 Message-ID: <26532.1454514984@warthog.procyon.org.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mimi Zohar 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