]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: sctp: sctp_auth_key_put: use kzfree instead of kfree
authorDaniel Borkmann <dborkman@redhat.com>
Thu, 7 Feb 2013 00:55:37 +0000 (00:55 +0000)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Mon, 10 Feb 2014 21:10:50 +0000 (16:10 -0500)
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 <dborkman@redhat.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
net/sctp/auth.c

index ddbbf7c81fa1d62adf50600b6c788d6769ff5d32..ce9ef56708ac6c168a552977d1ba1ba3184db42f 100644 (file)
@@ -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);
        }
 }