summaryrefslogtreecommitdiffhomepage
path: root/src/noise.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-08-27 09:36:16 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2020-08-27 09:36:16 +0200
commit1a41e327bef444861324c2df86bd21f15aaf95c4 (patch)
tree51e722eebcd505c2bfd407d7d17a4090a8386456 /src/noise.c
parent90a9e82ba613d39951c8b6fb66d149a06b5b2298 (diff)
compat: backport kfree_sensitive and switch to it
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/noise.c')
-rw-r--r--src/noise.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/noise.c b/src/noise.c
index 5fbe063..5cc0806 100644
--- a/src/noise.c
+++ b/src/noise.c
@@ -114,7 +114,7 @@ static struct noise_keypair *keypair_create(struct wg_peer *peer)
static void keypair_free_rcu(struct rcu_head *rcu)
{
- kzfree(container_of(rcu, struct noise_keypair, rcu));
+ kfree_sensitive(container_of(rcu, struct noise_keypair, rcu));
}
static void keypair_free_kref(struct kref *kref)
@@ -823,7 +823,7 @@ bool wg_noise_handshake_begin_session(struct noise_handshake *handshake,
handshake->entry.peer->device->index_hashtable,
&handshake->entry, &new_keypair->entry);
} else {
- kzfree(new_keypair);
+ kfree_sensitive(new_keypair);
}
rcu_read_unlock_bh();