.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* Key garbage collector |
---|
2 | 3 | * |
---|
3 | 4 | * Copyright (C) 2009-2011 Red Hat, Inc. All Rights Reserved. |
---|
4 | 5 | * Written by David Howells (dhowells@redhat.com) |
---|
5 | | - * |
---|
6 | | - * This program is free software; you can redistribute it and/or |
---|
7 | | - * modify it under the terms of the GNU General Public Licence |
---|
8 | | - * as published by the Free Software Foundation; either version |
---|
9 | | - * 2 of the Licence, or (at your option) any later version. |
---|
10 | 6 | */ |
---|
11 | 7 | |
---|
12 | | -#include <linux/module.h> |
---|
13 | 8 | #include <linux/slab.h> |
---|
14 | 9 | #include <linux/security.h> |
---|
15 | 10 | #include <keys/keyring-type.h> |
---|
.. | .. |
---|
136 | 131 | kdebug("- %u", key->serial); |
---|
137 | 132 | key_check(key); |
---|
138 | 133 | |
---|
| 134 | +#ifdef CONFIG_KEY_NOTIFICATIONS |
---|
| 135 | + remove_watch_list(key->watchers, key->serial); |
---|
| 136 | + key->watchers = NULL; |
---|
| 137 | +#endif |
---|
| 138 | + |
---|
139 | 139 | /* Throw away the key data if the key is instantiated */ |
---|
140 | 140 | if (state == KEY_IS_POSITIVE && key->type->destroy) |
---|
141 | 141 | key->type->destroy(key); |
---|
.. | .. |
---|
155 | 155 | atomic_dec(&key->user->nikeys); |
---|
156 | 156 | |
---|
157 | 157 | key_user_put(key->user); |
---|
158 | | - |
---|
| 158 | + key_put_tag(key->domain_tag); |
---|
159 | 159 | kfree(key->description); |
---|
160 | 160 | |
---|
161 | 161 | memzero_explicit(key, sizeof(*key)); |
---|