History

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.

Daniel Borkmann committed 13 years ago

Commit b5c37fe1 parent 6ba542a1 file · +5 −0Browse files

Unified · Split

net/sctp/endpointola.c+5−0
@@ -249,6 +249,8 @@ void sctp_endpoint_free(struct sctp_endpoint *ep) · 248 unmodified lines
249/* Final destructor for endpoint. */249/* Final destructor for endpoint. */
250static void sctp_endpoint_destroy(struct sctp_endpoint *ep)250static 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) · 16 unmodified lines
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);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t