summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-03-06 17:32:16 +0400
committerJames Morris <james.l.morris@oracle.com>2012-03-07 04:12:06 +0400
commitf67dabbdde1fe112dfff05d02890f1e0d54117a8 (patch)
tree5cf73d686d39df4e9986194ff64e98fdcdd4e444 /security
parentdf91e49477a9be15921cb2854e1d12a3bdb5e425 (diff)
downloadlinux-f67dabbdde1fe112dfff05d02890f1e0d54117a8.tar.xz
KEYS: testing wrong bit for KEY_FLAG_REVOKED
The test for "if (cred->request_key_auth->flags & KEY_FLAG_REVOKED) {" should actually testing that the (1 << KEY_FLAG_REVOKED) bit is set. The current code actually checks for KEY_FLAG_DEAD. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: James Morris <james.l.morris@oracle.com>
Diffstat (limited to 'security')
-rw-r--r--security/keys/process_keys.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/security/keys/process_keys.c b/security/keys/process_keys.c
index 1068cb1939b3..be7ecb2018dd 100644
--- a/security/keys/process_keys.c
+++ b/security/keys/process_keys.c
@@ -657,7 +657,8 @@ try_again:
goto error;
down_read(&cred->request_key_auth->sem);
- if (cred->request_key_auth->flags & KEY_FLAG_REVOKED) {
+ if (test_bit(KEY_FLAG_REVOKED,
+ &cred->request_key_auth->flags)) {
key_ref = ERR_PTR(-EKEYREVOKED);
key = NULL;
} else {