In the Linux kernel, the following vulnerability has been resolved:
sctp: fix err_chunk memory leaks in INIT handling
When sctp_verify_init() encounters unrecognized parameters, it allocates an err_chunk to report them. However, this chunk is leaked in several code paths:
- In sctp_sf_do_5_1B_init(), if security_sctp_assoc_request() fails after
- In sctp_sf_do_unexpected_init(), the same leak occurs on the
- In sctp_sf_do_unexpected_init(), on the success path after copying
Fix all three leaks by adding sctp_chunk_free(err_chunk) calls before returning in the error paths and on the success path in sctp_sf_do_unexpected_init().