]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sctp: validate cookie AUTH state before use
authorJérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
Tue, 4 Aug 2026 20:00:42 +0000 (20:00 +0000)
committerJakub Kicinski <kuba@kernel.org>
Fri, 7 Aug 2026 22:02:32 +0000 (15:02 -0700)
commit3dbb44d88b1e94dd31fe43588af7437b34b44d56
tree26242fe0a42c2b841529ddd45ec9dbff429a9727
parent594d905195024b228c962627ae5ae7c17bd582a4
sctp: validate cookie AUTH state before use

When cookie authentication is disabled, COOKIE_ECHO restores fixed-size
AUTH fields directly from peer-controlled cookie bytes.  A forged RANDOM
length, HMAC list, or CHUNKS list can then reach association consumers
with lengths or identifiers that were never validated against the local
backing arrays.

A forged RANDOM length can cause out-of-bounds reads during key-vector
construction.  A forged HMAC identifier also caused a 32-byte write past
a zero-length AUTH chunk, providing a primitive for a local privilege
escalation chain.

Validate the cookie's RANDOM, HMACS, and CHUNKS parameters at the cookie
trust boundary before copying them into the association.  Reject invalid
types, malformed lengths, unsupported HMAC identifiers, HMAC lists
without SHA1, and forbidden chunk ids.

Fixes: bbd0d59809f9 ("[SCTP]: Implement the receive and verification of AUTH chunk")
Fixes: 1f485649f529 ("[SCTP]: Implement SCTP-AUTH internals")
Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
Acked-by: Xin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/20260804200042.2412009-1-Jeremy.Jean@oss.cyber.gouv.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/sctp/auth.h
net/sctp/auth.c
net/sctp/sm_make_chunk.c