sctp: fix auth_hmacs array size in struct sctp_cookie
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 1f485649f52929d9937b346a920a522a7363e202 · < a8d20ba0ab518c9ccbcde258f25fc1ee6e51d5db| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
sctp: fix auth_hmacs array size in struct sctp_cookie
The auth_hmacs array in struct sctp_cookie is supposed to store a complete SCTP_AUTH_HMAC_ALGO parameter, which consists of a struct sctp_paramhdr followed by N HMAC identifiers.
However, the array size was calculated using an extra 2 bytes instead of sizeof(struct sctp_paramhdr), which is 4 bytes. When four HMAC identifiers are configured, the HMAC-ALGO parameter stored in the endpoint is larger than the auth_hmacs buffer in the cookie.
As a result, sctp_association_init() copies beyond the end of auth_hmacs when initializing the association, corrupting the adjacent auth_chunks field. This can lead to an invalid HMAC identifier being accepted and later cause an out-of-bounds read in sctp_auth_get_hmac().
Fix the array size calculation by including the full SCTP parameter header size.
From the CVE record · Linux
The Linux kernel's SCTP cookie has an undersized HMAC array when four HMAC identifiers are configured. Association initialization can corrupt an adjacent field, allowing an invalid HMAC identifier to be accepted and later causing an out-of-bounds read. The input does not specify attacker access or interaction requirements.
Engineers running Linux kernels with SCTP support should check their installations; affected versions are not specified.