Skip to content

Commit

Permalink
KEYS: Allow keyctl_revoke() on keys that have SETATTR but not WRITE p…
Browse files Browse the repository at this point in the history
…erm [try #6]

Allow keyctl_revoke() to operate on keys that have SETATTR but not WRITE
permission, rather than only on keys that have WRITE permission.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
  • Loading branch information
David Howells authored and James Morris committed Sep 2, 2009
1 parent 5593122 commit 0c2c9a3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion security/keys/keyctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,13 @@ long keyctl_revoke_key(key_serial_t id)
key_ref = lookup_user_key(id, 0, KEY_WRITE);
if (IS_ERR(key_ref)) {
ret = PTR_ERR(key_ref);
goto error;
if (ret != -EACCES)
goto error;
key_ref = lookup_user_key(id, 0, KEY_SETATTR);
if (IS_ERR(key_ref)) {
ret = PTR_ERR(key_ref);
goto error;
}
}

key_revoke(key_ref_to_ptr(key_ref));
Expand Down

0 comments on commit 0c2c9a3

Please sign in to comment.