]> git.ipfire.org Git - people/ms/linux.git/commit
net: sctp: sctp_setsockopt_auth_key: use kzfree instead of kfree
authorDaniel Borkmann <dborkman@redhat.com>
Fri, 8 Feb 2013 03:04:34 +0000 (03:04 +0000)
committerWilly Tarreau <w@1wt.eu>
Mon, 10 Jun 2013 09:43:35 +0000 (11:43 +0200)
commitbae3ff4ab33d03d11233c9967cfbdc76c6ad7685
tree0089940a86db3a82cb5c04cbc57736351e50b294
parent5e4b9c85cc21931ed6543cd8b527fd34ceb40717
net: sctp: sctp_setsockopt_auth_key: use kzfree instead of kfree

[ Upstream commit 6ba542a291a5e558603ac51cda9bded347ce7627 ]

In sctp_setsockopt_auth_key, we create a temporary copy of the user
passed shared auth key for the endpoint or association and after
internal setup, we free it right away. Since it's sensitive data, we
should zero out the key before returning the memory back to the
allocator. Thus, use kzfree instead of kfree, just as we do in
sctp_auth_key_put().

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
net/sctp/socket.c