mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
net: sctp: sctp_endpoint_free: zero out secret key data
[ Upstream commit b5c37fe6e2
]
On sctp_endpoint_destroy, previously used sensitive keying material
should be zeroed out before the memory is returned, as we already do
with e.g. auth keys when released.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Vlad Yasevich <vyasevic@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
8a501d87ed
commit
d6f5498856
1 changed files with 5 additions and 0 deletions
|
@ -248,6 +248,8 @@ void sctp_endpoint_free(struct sctp_endpoint *ep)
|
||||||
/* Final destructor for endpoint. */
|
/* Final destructor for endpoint. */
|
||||||
static void sctp_endpoint_destroy(struct sctp_endpoint *ep)
|
static void sctp_endpoint_destroy(struct sctp_endpoint *ep)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
SCTP_ASSERT(ep->base.dead, "Endpoint is not dead", return);
|
SCTP_ASSERT(ep->base.dead, "Endpoint is not dead", return);
|
||||||
|
|
||||||
/* Free up the HMAC transform. */
|
/* Free up the HMAC transform. */
|
||||||
|
@ -270,6 +272,9 @@ static void sctp_endpoint_destroy(struct sctp_endpoint *ep)
|
||||||
sctp_inq_free(&ep->base.inqueue);
|
sctp_inq_free(&ep->base.inqueue);
|
||||||
sctp_bind_addr_free(&ep->base.bind_addr);
|
sctp_bind_addr_free(&ep->base.bind_addr);
|
||||||
|
|
||||||
|
for (i = 0; i < SCTP_HOW_MANY_SECRETS; ++i)
|
||||||
|
memset(&ep->secret_key[i], 0, SCTP_SECRET_SIZE);
|
||||||
|
|
||||||
/* Remove and free the port */
|
/* Remove and free the port */
|
||||||
if (sctp_sk(ep->base.sk)->bind_hash)
|
if (sctp_sk(ep->base.sk)->bind_hash)
|
||||||
sctp_put_port(ep->base.sk);
|
sctp_put_port(ep->base.sk);
|
||||||
|
|
Loading…
Reference in a new issue