В ядре Linux устранена следующая уязвимость:
sctp: исправлены утечки памяти err_chunk при обработке INIT. Когда sctp_verify_init() обнаруживает нераспознанные параметры, он выделяет
err_chunk, чтобы сообщить о них. Однако этот фрагмент просочился в несколько кодов.
пути:
1.
Если в sctp_sf_do_5_1B_init() происходит сбой после
sctp_verify_init() заполнил err_chunk, функция возвращает значение
сразу, не освобождая его.
2. В sctp_sf_do_unexpected_init() та же утечка происходит на
Путь ошибки security_sctp_assoc_request().
3. В sctp_sf_do_unexpected_init() в пути успеха после копирования
нераспознанные параметры в INIT-ACK, функция возвращается без
освобождение err_chunk, в отличие от sctp_sf_do_5_1B_init(), который правильно освобождает
это.
Исправьте все три утечки, добавив перед этим вызовы sctp_chunk_free(err_chunk).
возвращаясь по путям ошибок и по пути успеха в
sctp_sf_do_unexpected_init().
Показать оригинальное описание (EN)
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: 1. In sctp_sf_do_5_1B_init(), if security_sctp_assoc_request() fails after sctp_verify_init() has populated err_chunk, the function returns immediately without freeing it. 2. In sctp_sf_do_unexpected_init(), the same leak occurs on the security_sctp_assoc_request() failure path. 3. In sctp_sf_do_unexpected_init(), on the success path after copying unrecognized parameters to the INIT-ACK, the function returns without freeing err_chunk, unlike sctp_sf_do_5_1B_init() which properly frees it. 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().