]> git.baikalelectronics.ru Git - kernel.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)
committerDavid S. Miller <davem@davemloft.net>
Fri, 8 Feb 2013 19:54:24 +0000 (14:54 -0500)
commit2471b2d2f342f2989ff4dcfea4a0123577af05cb
treed4afee9ead818955eafb2cd67a8ad0e12f82744f
parent61a89355d3aa7efdf92a9df7256d13a6e23a7f3d
net: sctp: sctp_setsockopt_auth_key: use kzfree instead of kfree

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>
net/sctp/socket.c