Skip to content

Commit

Permalink
KEYS: Flag dead keys to induce EKEYREVOKED [try torvalds#6]
Browse files Browse the repository at this point in the history
Set the KEY_FLAG_DEAD flag on keys for which the type has been removed.  This
causes the key_permission() function to return EKEYREVOKED in response to
various commands.  It does not, however, prevent unlinking or clearing of
keyrings from detaching the key.

Signed-off-by: David Howells <[email protected]>
Acked-by: Serge Hallyn <[email protected]>
Signed-off-by: James Morris <[email protected]>
  • Loading branch information
dhowells authored and James Morris committed Sep 2, 2009
1 parent 0c2c9a3 commit f041ae2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion security/keys/key.c
Original file line number Diff line number Diff line change
Expand Up @@ -956,8 +956,10 @@ void unregister_key_type(struct key_type *ktype)
for (_n = rb_first(&key_serial_tree); _n; _n = rb_next(_n)) {
key = rb_entry(_n, struct key, serial_node);

if (key->type == ktype)
if (key->type == ktype) {
key->type = &key_type_dead;
set_bit(KEY_FLAG_DEAD, &key->flags);
}
}

spin_unlock(&key_serial_lock);
Expand Down

0 comments on commit f041ae2

Please sign in to comment.