X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=security%2Fkeys%2Fpermission.c;fp=security%2Fkeys%2Fpermission.c;h=c35b5229e3cdca80bcd6b44da70b5123871e1874;hb=973c9f4f49ca96a53bcf6384c4c59ccd26c33906;hp=6284b1496c298be958621ccf0556792176a1cbab;hpb=a8b17ed019bd40d3bfa20439d9c36a99f9be9180;p=mv-sheeva.git diff --git a/security/keys/permission.c b/security/keys/permission.c index 6284b1496c2..c35b5229e3c 100644 --- a/security/keys/permission.c +++ b/security/keys/permission.c @@ -1,4 +1,4 @@ -/* permission.c: key permission determination +/* Key permission checking * * Copyright (C) 2005 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.com) @@ -15,15 +15,17 @@ /** * key_task_permission - Check a key can be used - * @key_ref: The key to check - * @cred: The credentials to use - * @perm: The permissions to check for + * @key_ref: The key to check. + * @cred: The credentials to use. + * @perm: The permissions to check for. * * Check to see whether permission is granted to use a key in the desired way, * but permit the security modules to override. * - * The caller must hold either a ref on cred or must hold the RCU readlock or a - * spinlock. + * The caller must hold either a ref on cred or must hold the RCU readlock. + * + * Returns 0 if successful, -EACCES if access is denied based on the + * permissions bits or the LSM check. */ int key_task_permission(const key_ref_t key_ref, const struct cred *cred, key_perm_t perm) @@ -79,11 +81,15 @@ use_these_perms: /* let LSM be the final arbiter */ return security_key_permission(key_ref, cred, perm); } - EXPORT_SYMBOL(key_task_permission); -/* - * validate a key +/** + * key_validate - Validate a key. + * @key: The key to be validated. + * + * Check that a key is valid, returning 0 if the key is okay, -EKEYREVOKED if + * the key's type has been removed or if the key has been revoked or + * -EKEYEXPIRED if the key has expired. */ int key_validate(struct key *key) { @@ -109,5 +115,4 @@ int key_validate(struct key *key) error: return ret; } - EXPORT_SYMBOL(key_validate);