sctp: validate Adaptation Indication parameter length
authorCharles Vosburgh <trilobyte777@gmail.com>
Mon, 27 Jul 2026 23:17:30 +0000 (19:17 -0400)
committerJakub Kicinski <kuba@kernel.org>
Wed, 29 Jul 2026 23:51:28 +0000 (16:51 -0700)
commit74b21f52c5c5a71a05c0ff70e513f4f04ff28b17
tree5f7239fc464a93657ce26dddf289c8606a518aa9
parent1c15e75dc21fc61f7bb62f2e8c86d86da01608c5
sctp: validate Adaptation Indication parameter length

The Adaptation Layer Indication parameter contains a fixed 32-bit
Adaptation Code Point after its parameter header. However,
sctp_verify_param() accepts a header-only parameter because the generic
parameter walker only requires the header to be present.

sctp_process_param() then reads adaptation_ind beyond the declared
parameter. When the malformed parameter is last in an INIT, the read
starts at the receive skb tail, and the value is copied into the state
cookie returned in the INIT ACK. This may disclose four receive-buffer
tail bytes.

Require the declared parameter length to match the fixed structure size
and abort the association through the existing invalid parameter length
path otherwise.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Charles Vosburgh <trilobyte777@gmail.com>
Acked-by: Xin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/20260727-sctp-adaptation-length-v1-1-0ab58b2810a5@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/sctp/sm_make_chunk.c