From: Daniel Borkmann Date: Thu, 7 Feb 2013 00:55:37 +0000 (+0000) Subject: net: sctp: sctp_auth_key_put: use kzfree instead of kfree X-Git-Tag: v2.6.34.15~180 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c9ea1069d2243c74c812dc91a3f87903823dcc65;p=thirdparty%2Fkernel%2Fstable.git net: sctp: sctp_auth_key_put: use kzfree instead of kfree commit 586c31f3bf04c290dc0a0de7fc91d20aa9a5ee53 upstream. 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: Daniel Borkmann Acked-by: Neil Horman Acked-by: Vlad Yasevich Signed-off-by: David S. Miller Signed-off-by: Paul Gortmaker --- diff --git a/net/sctp/auth.c b/net/sctp/auth.c index ddbbf7c81fa1d..ce9ef56708ac6 100644 --- a/net/sctp/auth.c +++ b/net/sctp/auth.c @@ -71,7 +71,7 @@ void sctp_auth_key_put(struct sctp_auth_bytes *key) return; if (atomic_dec_and_test(&key->refcnt)) { - kfree(key); + kzfree(key); SCTP_DBG_OBJCNT_DEC(keys); } }