From f67dabbdde1fe112dfff05d02890f1e0d54117a8 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 6 Mar 2012 13:32:16 +0000 Subject: [PATCH] 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 Signed-off-by: David Howells Signed-off-by: James Morris --- security/keys/process_keys.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/security/keys/process_keys.c b/security/keys/process_keys.c index 1068cb1..be7ecb2 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 { -- 2.7.4