Commit 586c31f3 authored by Daniel Borkmann's avatar Daniel Borkmann Committed by David S. Miller

net: sctp: sctp_auth_key_put: use kzfree instead of kfree

For sensitive data like keying material, it is common practice to zero
out keys before returning the memory back to the allocator. Thus, use
kzfree instead of kfree.
Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
Acked-by: default avatarVlad Yasevich <vyasevich@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6cddded4
...@@ -71,7 +71,7 @@ void sctp_auth_key_put(struct sctp_auth_bytes *key) ...@@ -71,7 +71,7 @@ void sctp_auth_key_put(struct sctp_auth_bytes *key)
return; return;
if (atomic_dec_and_test(&key->refcnt)) { if (atomic_dec_and_test(&key->refcnt)) {
kfree(key); kzfree(key);
SCTP_DBG_OBJCNT_DEC(keys); SCTP_DBG_OBJCNT_DEC(keys);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment