diff options
author | David Howells <dhowells@redhat.com> | 2011-01-20 11:38:33 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-21 17:59:30 -0500 |
commit | 973c9f4f49ca96a53bcf6384c4c59ccd26c33906 (patch) | |
tree | e3535a43c1e5cb5f0c06c040f58bc25c9b869fd1 /security/keys/permission.c | |
parent | a8b17ed019bd40d3bfa20439d9c36a99f9be9180 (diff) |
KEYS: Fix up comments in key management code
Fix up comments in the key management code. No functional changes.
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'security/keys/permission.c')
-rw-r--r-- | security/keys/permission.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/security/keys/permission.c b/security/keys/permission.c index 6284b1496c29..c35b5229e3cd 100644 --- a/security/keys/permission.c +++ b/security/keys/permission.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* permission.c: key permission determination | 1 | /* Key permission checking |
2 | * | 2 | * |
3 | * Copyright (C) 2005 Red Hat, Inc. All Rights Reserved. | 3 | * Copyright (C) 2005 Red Hat, Inc. All Rights Reserved. |
4 | * Written by David Howells (dhowells@redhat.com) | 4 | * Written by David Howells (dhowells@redhat.com) |
@@ -15,15 +15,17 @@ | |||
15 | 15 | ||
16 | /** | 16 | /** |
17 | * key_task_permission - Check a key can be used | 17 | * key_task_permission - Check a key can be used |
18 | * @key_ref: The key to check | 18 | * @key_ref: The key to check. |
19 | * @cred: The credentials to use | 19 | * @cred: The credentials to use. |
20 | * @perm: The permissions to check for | 20 | * @perm: The permissions to check for. |
21 | * | 21 | * |
22 | * Check to see whether permission is granted to use a key in the desired way, | 22 | * Check to see whether permission is granted to use a key in the desired way, |
23 | * but permit the security modules to override. | 23 | * but permit the security modules to override. |
24 | * | 24 | * |
25 | * The caller must hold either a ref on cred or must hold the RCU readlock or a | 25 | * The caller must hold either a ref on cred or must hold the RCU readlock. |
26 | * spinlock. | 26 | * |
27 | * Returns 0 if successful, -EACCES if access is denied based on the | ||
28 | * permissions bits or the LSM check. | ||
27 | */ | 29 | */ |
28 | int key_task_permission(const key_ref_t key_ref, const struct cred *cred, | 30 | int key_task_permission(const key_ref_t key_ref, const struct cred *cred, |
29 | key_perm_t perm) | 31 | key_perm_t perm) |
@@ -79,11 +81,15 @@ use_these_perms: | |||
79 | /* let LSM be the final arbiter */ | 81 | /* let LSM be the final arbiter */ |
80 | return security_key_permission(key_ref, cred, perm); | 82 | return security_key_permission(key_ref, cred, perm); |
81 | } | 83 | } |
82 | |||
83 | EXPORT_SYMBOL(key_task_permission); | 84 | EXPORT_SYMBOL(key_task_permission); |
84 | 85 | ||
85 | /* | 86 | /** |
86 | * validate a key | 87 | * key_validate - Validate a key. |
88 | * @key: The key to be validated. | ||
89 | * | ||
90 | * Check that a key is valid, returning 0 if the key is okay, -EKEYREVOKED if | ||
91 | * the key's type has been removed or if the key has been revoked or | ||
92 | * -EKEYEXPIRED if the key has expired. | ||
87 | */ | 93 | */ |
88 | int key_validate(struct key *key) | 94 | int key_validate(struct key *key) |
89 | { | 95 | { |
@@ -109,5 +115,4 @@ int key_validate(struct key *key) | |||
109 | error: | 115 | error: |
110 | return ret; | 116 | return ret; |
111 | } | 117 | } |
112 | |||
113 | EXPORT_SYMBOL(key_validate); | 118 | EXPORT_SYMBOL(key_validate); |