diff options
| author | Xin Long <lucien.xin@gmail.com> | 2026-07-10 14:12:35 -0400 |
|---|---|---|
| committer | Paolo Abeni <pabeni@redhat.com> | 2026-07-17 12:27:53 +0200 |
| commit | e0b5252a59383b77d1b8dbeda00b7184dd95f4d3 (patch) | |
| tree | a7021b05401222c576497e2c80f0c76906c5d60c /scripts/trace/git@git.tavy.me:linux-stable.git | |
| parent | f1f5c8a3955f8fda3f84ed883ac8daa1847e724c (diff) | |
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.
Fixes: 1f485649f529 ("[SCTP]: Implement SCTP-AUTH internals")
Reported-by: Yuan Tan <yuantan098@gmail.com>
Reported-by: Xin Liu <dstsmallbird@foxmail.com>
Reported-by: Zihan Xi <xizh2024@lzu.edu.cn>
Reported-by: Ren Wei <enjou1224z@gmail.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/634a0de0d5de29532915e6d47c92a0cbc206e03f.1783707155.git.lucien.xin@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'scripts/trace/git@git.tavy.me:linux-stable.git')
0 files changed, 0 insertions, 0 deletions
