summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-12-10 00:14:13 +0100
committerThomas Gleixner <tglx@linutronix.de>2009-12-16 22:20:47 +0100
commit5384ac0cbbc711a46b958a2441a76c882931ef79 (patch)
tree454d99f3e6d051d5f150300567169fa80f4ba67d
parent16dab6454253222b16767cfe7a608df7ef4fa8b9 (diff)
downloadlwn-5384ac0cbbc711a46b958a2441a76c882931ef79.tar.gz
lwn-5384ac0cbbc711a46b958a2441a76c882931ef79.zip
security: Fix invalid rcu assumptions in comments
1) held spinlocks are not equivalent to rcu_read_lock 2) access to current_cred() is safe as only current can modify its own credentials. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: James Morris <jmorris@namei.org> Cc: linux-security-module@vger.kernel.org
-rw-r--r--security/keys/permission.c3
-rw-r--r--security/keys/proc.c2
2 files changed, 1 insertions, 4 deletions
diff --git a/security/keys/permission.c b/security/keys/permission.c
index 0ed802c9e698..5d16a1891031 100644
--- a/security/keys/permission.c
+++ b/security/keys/permission.c
@@ -23,8 +23,7 @@
* 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.
*/
int key_task_permission(const key_ref_t key_ref, const struct cred *cred,
key_perm_t perm)
diff --git a/security/keys/proc.c b/security/keys/proc.c
index 769f9bdfd2b3..5007ca424fde 100644
--- a/security/keys/proc.c
+++ b/security/keys/proc.c
@@ -159,8 +159,6 @@ static int proc_keys_show(struct seq_file *m, void *v)
/* check whether the current task is allowed to view the key (assuming
* non-possession)
- * - the caller holds a spinlock, and thus the RCU read lock, making our
- * access to __current_cred() safe
*/
rc = key_task_permission(make_key_ref(key, 0), current_cred(),
KEY_VIEW);