summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-10-28 23:21:00 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-10-28 23:21:00 -0700
commit4d42378e456e33655f0fad1ab6d49c49d6ccebb3 (patch)
treefdaec7b43fa4d9e34d37e9cde4e6f4242498e50d /security
parentc1ec9cae63d7c8553172fddb199fbf61b7293c07 (diff)
[PATCH] key_init ordering fix
The data structures which are set up by key_init() are used by exec(). And we're using exec() super-early via the hotplug events from do_basic_setup():driver_init(). So call key_init() directly, prior to driver_init(). Cc: David S. Miller <davem@davemloft.net> Cc: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'security')
-rw-r--r--security/keys/key.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/security/keys/key.c b/security/keys/key.c
index e527e8f72c26..69010801966b 100644
--- a/security/keys/key.c
+++ b/security/keys/key.c
@@ -998,13 +998,11 @@ EXPORT_SYMBOL(unregister_key_type);
/*
* initialise the key management stuff
*/
-static int __init key_init(void)
+void __init key_init(void)
{
/* allocate a slab in which we can store keys */
key_jar = kmem_cache_create("key_jar", sizeof(struct key),
- 0, SLAB_HWCACHE_ALIGN, NULL, NULL);
- if (!key_jar)
- panic("Cannot create key jar\n");
+ 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
/* add the special key types */
list_add_tail(&key_type_keyring.link, &key_types_list);
@@ -1031,9 +1029,4 @@ static int __init key_init(void)
/* link the two root keyrings together */
key_link(&root_session_keyring, &root_user_keyring);
-
- return 0;
-
} /* end key_init() */
-
-security_initcall(key_init);