aboutsummaryrefslogtreecommitdiffstats
path: root/security/keys/key.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2009-09-02 04:13:55 -0400
committerJames Morris <jmorris@namei.org>2009-09-02 07:29:09 -0400
commitf041ae2f99d49adc914153a34a2d0e14e4389d90 (patch)
tree02cf0a1e85920122e1059496942b979e5832ff1b /security/keys/key.c
parent0c2c9a3fc77e8b60d43d9bd2ca46eb4dddb0ff76 (diff)
KEYS: Flag dead keys to induce EKEYREVOKED [try #6]
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 <dhowells@redhat.com> Acked-by: Serge Hallyn <serue@us.ibm.com> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/keys/key.c')
-rw-r--r--security/keys/key.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/security/keys/key.c b/security/keys/key.c
index 3762d5b1ce64..bd9d2670e9c4 100644
--- a/security/keys/key.c
+++ b/security/keys/key.c
@@ -956,8 +956,10 @@ void unregister_key_type(struct key_type *ktype)
956 for (_n = rb_first(&key_serial_tree); _n; _n = rb_next(_n)) { 956 for (_n = rb_first(&key_serial_tree); _n; _n = rb_next(_n)) {
957 key = rb_entry(_n, struct key, serial_node); 957 key = rb_entry(_n, struct key, serial_node);
958 958
959 if (key->type == ktype) 959 if (key->type == ktype) {
960 key->type = &key_type_dead; 960 key->type = &key_type_dead;
961 set_bit(KEY_FLAG_DEAD, &key->flags);
962 }
961 } 963 }
962 964
963 spin_unlock(&key_serial_lock); 965 spin_unlock(&key_serial_lock);