hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/security/keys/user_defined.c
....@@ -1,15 +1,11 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /* user_defined.c: user defined key type
23 *
34 * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
45 * 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 License
8
- * as published by the Free Software Foundation; either version
9
- * 2 of the License, or (at your option) any later version.
106 */
117
12
-#include <linux/module.h>
8
+#include <linux/export.h>
139 #include <linux/init.h>
1410 #include <linux/slab.h>
1511 #include <linux/seq_file.h>
....@@ -86,7 +82,7 @@
8682 */
8783 void user_free_preparse(struct key_preparsed_payload *prep)
8884 {
89
- kzfree(prep->payload.data[0]);
85
+ kfree_sensitive(prep->payload.data[0]);
9086 }
9187 EXPORT_SYMBOL_GPL(user_free_preparse);
9288
....@@ -95,7 +91,7 @@
9591 struct user_key_payload *payload;
9692
9793 payload = container_of(head, struct user_key_payload, rcu);
98
- kzfree(payload);
94
+ kfree_sensitive(payload);
9995 }
10096
10197 /*
....@@ -151,7 +147,7 @@
151147 {
152148 struct user_key_payload *upayload = key->payload.data[0];
153149
154
- kzfree(upayload);
150
+ kfree_sensitive(upayload);
155151 }
156152
157153 EXPORT_SYMBOL_GPL(user_destroy);