Merge tag 'fixes-5.4-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / security / keys / gc.c
index 48c3e12..671dd73 100644 (file)
@@ -151,7 +151,6 @@ static noinline void key_gc_unused_keys(struct list_head *keys)
 
                key_user_put(key->user);
                key_put_tag(key->domain_tag);
-               key_put_acl(rcu_access_pointer(key->acl));
                kfree(key->description);
 
                memzero_explicit(key, sizeof(*key));
@@ -221,6 +220,7 @@ continue_scanning:
                        if (key->type == key_gc_dead_keytype) {
                                gc_state |= KEY_GC_FOUND_DEAD_KEY;
                                set_bit(KEY_FLAG_DEAD, &key->flags);
+                               key->perm = 0;
                                goto skip_dead_key;
                        } else if (key->type == &key_type_keyring &&
                                   key->restrict_link) {