From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753212AbbETQza (ORCPT ); Wed, 20 May 2015 12:55:30 -0400 Received: from lan.nucleusys.com ([92.247.61.126]:42942 "EHLO zztop.nucleusys.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751928AbbETQzY (ORCPT ); Wed, 20 May 2015 12:55:24 -0400 Date: Wed, 20 May 2015 19:55:06 +0300 From: Petko Manolov To: Andy Lutomirski Cc: David Howells , Andy Lutomirski , Rusty Russell , Michal Marek , Matthew Garrett , keyrings@linux-nfs.org, Dmitry Kasatkin , Luis Rodriguez , "linux-kernel@vger.kernel.org" , Seth Forshee , LSM List , David Woodhouse Subject: Re: [PATCH 0/8] MODSIGN: Use PKCS#7 for module signatures [ver #4] Message-ID: <20150520165506.GE10473@localhost> Mail-Followup-To: Andy Lutomirski , David Howells , Andy Lutomirski , Rusty Russell , Michal Marek , Matthew Garrett , keyrings@linux-nfs.org, Dmitry Kasatkin , Luis Rodriguez , "linux-kernel@vger.kernel.org" , Seth Forshee , LSM List , David Woodhouse References: <20150515123513.16723.96340.stgit@warthog.procyon.org.uk> <555BD715.40202@kernel.org> <31772.1432128969@warthog.procyon.org.uk> <20150520162059.GC10473@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Score: -1.0 (-) X-Spam-Report: Spam detection software, running on the system "zztop.nucleusys.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On 15-05-20 09:41:21, Andy Lutomirski wrote: > On Wed, May 20, 2015 at 9:21 AM, Petko Manolov wrote: > > On 15-05-20 08:56:21, Andy Lutomirski wrote: > >> > >> Would it make more sense to permit X.509 chains to be loaded into the keyring > >> instead if we actually need that feature? IOW, let userspace (or early > >> initramfs stuff) extend our keyring trust to intermediate certs that validly > >> chain to already-trusted things? I think that a reasonable design goal would > >> be that everything overcomplicated that's involved should be optional, and > >> moving toward embedding PKCS#7 signatures in the modules themselves does the > >> other direction? > > > > This is similar to what i am doing right now - create CA hierarchy so we can > > have something like: > > > > +-> KeyB > > | > > RootCA ---> CertA ---> CertB ---> CertC ---> KeyC > > | > > +-> CertA' ---> KeyA" > > > > The RootCA may be the one whose private key was used to sign the modules and all > > downstream certificates are either directly signed by it or one of the others. > > Not all of the infrastructure is in the mainline kernel, but this can easily be > > rectified. > > Right. I guess that I can imagine some uses for this, but I don't see > why those intermediate certs would be embedded with the signatures > being verified as opposed to being loaded beforehand. [...] Content analysis details: (-1.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15-05-20 09:41:21, Andy Lutomirski wrote: > On Wed, May 20, 2015 at 9:21 AM, Petko Manolov wrote: > > On 15-05-20 08:56:21, Andy Lutomirski wrote: > >> > >> Would it make more sense to permit X.509 chains to be loaded into the keyring > >> instead if we actually need that feature? IOW, let userspace (or early > >> initramfs stuff) extend our keyring trust to intermediate certs that validly > >> chain to already-trusted things? I think that a reasonable design goal would > >> be that everything overcomplicated that's involved should be optional, and > >> moving toward embedding PKCS#7 signatures in the modules themselves does the > >> other direction? > > > > This is similar to what i am doing right now - create CA hierarchy so we can > > have something like: > > > > +-> KeyB > > | > > RootCA ---> CertA ---> CertB ---> CertC ---> KeyC > > | > > +-> CertA' ---> KeyA" > > > > The RootCA may be the one whose private key was used to sign the modules and all > > downstream certificates are either directly signed by it or one of the others. > > Not all of the infrastructure is in the mainline kernel, but this can easily be > > rectified. > > Right. I guess that I can imagine some uses for this, but I don't see > why those intermediate certs would be embedded with the signatures > being verified as opposed to being loaded beforehand. They aren't. They shouldn't. I think module signing/verification should be simple but cryptographically sound process. Over-designing it is dumb, but i find it useful when there is compatibility (at least at key format level) with other systems, namely IMA and EVM. > > Now, as Mimi pointed out this scheme is flawed and should be used with care > > if at all. Revoking certificates is always a PITA. Being valid for one > > year only adds to the fun. > > > > Valid for only one year is worse than that. We might be verifying the > signature on our clock driver :) I think that, at best, we could reject > certificates that expired before the running kernel was built. Nah, nothing as complex as that. It is so easy to play with the system clock. In the general case, and if needed, the user would either use self signed certificate or one signed by whoever the user trusts - Fedora, Debian, LF or even NSA. :) Petko