diff options
author | David Howells <dhowells@redhat.com> | 2012-12-20 18:05:56 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-20 20:40:21 -0500 |
commit | cfde819088422503b5c69e03ab7bb90f87121d4d (patch) | |
tree | 338100ef53d4736c73be67e2ea3bd29428ecf866 /kernel/modsign_pubkey.c | |
parent | e67eab39bee26f509d38d00ca1a8f24b63f46a31 (diff) |
keys: use keyring_alloc() to create module signing keyring
Use keyring_alloc() to create special keyrings now that it has
a permissions parameter rather than using key_alloc() +
key_instantiate_and_link().
Signed-off-by: David Howells <dhowells@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/modsign_pubkey.c')
-rw-r--r-- | kernel/modsign_pubkey.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/kernel/modsign_pubkey.c b/kernel/modsign_pubkey.c index 045504fffbb2..2b6e69909c39 100644 --- a/kernel/modsign_pubkey.c +++ b/kernel/modsign_pubkey.c | |||
@@ -34,18 +34,15 @@ static __init int module_verify_init(void) | |||
34 | { | 34 | { |
35 | pr_notice("Initialise module verification\n"); | 35 | pr_notice("Initialise module verification\n"); |
36 | 36 | ||
37 | modsign_keyring = key_alloc(&key_type_keyring, ".module_sign", | 37 | modsign_keyring = keyring_alloc(".module_sign", |
38 | KUIDT_INIT(0), KGIDT_INIT(0), | 38 | KUIDT_INIT(0), KGIDT_INIT(0), |
39 | current_cred(), | 39 | current_cred(), |
40 | (KEY_POS_ALL & ~KEY_POS_SETATTR) | | 40 | ((KEY_POS_ALL & ~KEY_POS_SETATTR) | |
41 | KEY_USR_VIEW | KEY_USR_READ, | 41 | KEY_USR_VIEW | KEY_USR_READ), |
42 | KEY_ALLOC_NOT_IN_QUOTA); | 42 | KEY_ALLOC_NOT_IN_QUOTA, NULL); |
43 | if (IS_ERR(modsign_keyring)) | 43 | if (IS_ERR(modsign_keyring)) |
44 | panic("Can't allocate module signing keyring\n"); | 44 | panic("Can't allocate module signing keyring\n"); |
45 | 45 | ||
46 | if (key_instantiate_and_link(modsign_keyring, NULL, 0, NULL, NULL) < 0) | ||
47 | panic("Can't instantiate module signing keyring\n"); | ||
48 | |||
49 | return 0; | 46 | return 0; |
50 | } | 47 | } |
51 | 48 | ||