diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-02-07 22:04:35 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-08 14:54:24 -0500 |
commit | b5c37fe6e24eec194bb29d22fdd55d73bcc709bf (patch) | |
tree | 1a4ba4d878e6d2ff60b874a8f465ada2ac54bff7 /net/sctp/endpointola.c | |
parent | 6ba542a291a5e558603ac51cda9bded347ce7627 (diff) |
net: sctp: sctp_endpoint_free: zero out secret key data
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>
Diffstat (limited to 'net/sctp/endpointola.c')
-rw-r--r-- | net/sctp/endpointola.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c index 17a001bac2cc..1a9c5fb77310 100644 --- a/net/sctp/endpointola.c +++ b/net/sctp/endpointola.c | |||
@@ -249,6 +249,8 @@ void sctp_endpoint_free(struct sctp_endpoint *ep) | |||
249 | /* Final destructor for endpoint. */ | 249 | /* Final destructor for endpoint. */ |
250 | static void sctp_endpoint_destroy(struct sctp_endpoint *ep) | 250 | static void sctp_endpoint_destroy(struct sctp_endpoint *ep) |
251 | { | 251 | { |
252 | int i; | ||
253 | |||
252 | SCTP_ASSERT(ep->base.dead, "Endpoint is not dead", return); | 254 | SCTP_ASSERT(ep->base.dead, "Endpoint is not dead", return); |
253 | 255 | ||
254 | /* Free up the HMAC transform. */ | 256 | /* Free up the HMAC transform. */ |
@@ -271,6 +273,9 @@ static void sctp_endpoint_destroy(struct sctp_endpoint *ep) | |||
271 | sctp_inq_free(&ep->base.inqueue); | 273 | sctp_inq_free(&ep->base.inqueue); |
272 | sctp_bind_addr_free(&ep->base.bind_addr); | 274 | sctp_bind_addr_free(&ep->base.bind_addr); |
273 | 275 | ||
276 | for (i = 0; i < SCTP_HOW_MANY_SECRETS; ++i) | ||
277 | memset(&ep->secret_key[i], 0, SCTP_SECRET_SIZE); | ||
278 | |||
274 | /* Remove and free the port */ | 279 | /* Remove and free the port */ |
275 | if (sctp_sk(ep->base.sk)->bind_hash) | 280 | if (sctp_sk(ep->base.sk)->bind_hash) |
276 | sctp_put_port(ep->base.sk); | 281 | sctp_put_port(ep->base.sk); |