mirror of
https://github.com/torvalds/linux.git
synced 2026-06-10 07:32:29 +02:00
net: sctp: sctp_setsockopt_auth_key: use kzfree instead of kfree
[ Upstream commit 6ba542a291 ]
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>
This commit is contained in:
parent
4c921d0ed5
commit
8a501d87ed
|
|
@ -3375,7 +3375,7 @@ static int sctp_setsockopt_auth_key(struct sock *sk,
|
|||
|
||||
ret = sctp_auth_set_key(sctp_sk(sk)->ep, asoc, authkey);
|
||||
out:
|
||||
kfree(authkey);
|
||||
kzfree(authkey);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user