Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756781Ab2HPS0k (ORCPT ); Thu, 16 Aug 2012 14:26:40 -0400 Received: from mail-qa0-f46.google.com ([209.85.216.46]:50195 "EHLO mail-qa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751298Ab2HPS0i (ORCPT ); Thu, 16 Aug 2012 14:26:38 -0400 MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 16 Aug 2012 14:26:37 -0400 Message-ID: Subject: Re: [RFC v2 2/7] keys: initialize root uid and session keyrings early From: Josh Boyer To: Dmitry Kasatkin Cc: zohar@linux.vnet.ibm.com, jmorris@namei.org, rusty@rustcorp.com.au, dhowells@redhat.com, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Mimi Zohar Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1920 Lines: 61 On Wed, Aug 15, 2012 at 2:43 PM, Dmitry Kasatkin wrote: > From: Mimi Zohar > > In order to create the integrity keyrings (eg. _evm, _ima, _modules), > root's uid and session keyrings need to be initialized early. > > Signed-off-by: Mimi Zohar > --- > security/keys/Makefile | 1 + > security/keys/root_keyring.c | 18 ++++++++++++++++++ > 2 files changed, 19 insertions(+) > create mode 100644 security/keys/root_keyring.c > > diff --git a/security/keys/Makefile b/security/keys/Makefile > index 504aaa0..c93ce8d 100644 > --- a/security/keys/Makefile > +++ b/security/keys/Makefile > @@ -18,6 +18,7 @@ obj-y := \ > obj-$(CONFIG_KEYS_COMPAT) += compat.o > obj-$(CONFIG_PROC_FS) += proc.o > obj-$(CONFIG_SYSCTL) += sysctl.o > +obj-$(CONFIG_INTEGRITY_SIGNATURE) += root_keyring.o > > # > # Key types > diff --git a/security/keys/root_keyring.c b/security/keys/root_keyring.c > new file mode 100644 > index 0000000..f6662eb > --- /dev/null > +++ b/security/keys/root_keyring.c > @@ -0,0 +1,18 @@ > +/* > + * Copyright (C) 2012 IBM Corporation > + * > + * Author: > + * Mimi Zohar > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation, version 2 of the License. > + */ > + > +#include "internal.h" > +static int __init init_root_keyring(void) > +{ > + return install_user_keyrings(); > +} > + > +late_initcall(init_root_keyring); > -- Why is this in an entirely new file instead of just being added to process_keys.c ? josh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/