From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 170753EB0F5; Tue, 16 Jun 2026 18:54:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781636072; cv=none; b=DYrvxbjB63yH4QSVpzTMGxQPI9Kt/yFa3rRkeoB00DYo8TlubcAc7LYuqMX1PpmKCp5PM/IWNmGj+DzuhkCHR2bSXI5+yqZOXmkGHmnj5y8SK5sZ2W7fpM+P2Vl7eIybqzAGoh6NIKKa6mQFWUJAeW/LBCKE5MksSF00l2Xt1rY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781636072; c=relaxed/simple; bh=txPwC0x7DiDcpeqVtUxT1L8J55bzZRHpZRwdJYoVNmo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AO3O1DchV70p8VdNRtDLZV+YL28oI0IBujmi+BBSFQowANc/+SGzSfPhJD9+L908fRpUxcT3E2QHUt0m5Tzey7FL8E71u2Tvxf9Xsaf6riH9pPOu42xithd4bG9t8x2hwUGitGmaUmu5UL6LEtWVIcxcQ2KRB1KeqGzzvqZQikA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qLMNA3kz; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="qLMNA3kz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1AC381F000E9; Tue, 16 Jun 2026 18:54:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1781636071; bh=sIbDdl5EwtmS6jlAR65HCEac0cTkMJuOaS4w/UzePP0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=qLMNA3kz/e98i5gSTHg3Kj+L5psjL/pMGiZcg9eCH5H9PFxv5kDjkhDOk+/PPIUQr ye3I40eoWtRF21jp1iz7Ob4Jas/sWoquR1uh6WZQRlxRyBnm0pA0ZUtDPvqgKOeXP7 oQU8SjlAjONxtTz+RbLRd1gQ/wJNQY6O73aVAa7o= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Michael Bommarito , Xin Long , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.10 170/342] sctp: fix uninit-value in __sctp_rcv_asconf_lookup() Date: Tue, 16 Jun 2026 20:27:46 +0530 Message-ID: <20260616145056.123166829@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260616145048.348037099@linuxfoundation.org> References: <20260616145048.348037099@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Bommarito [ Upstream commit f8373d7090b745728de66308deeecc67e8d319ce ] __sctp_rcv_asconf_lookup() in net/sctp/input.c only checks that the ASCONF chunk can hold the ADDIP header and a parameter header, then calls af->from_addr_param(), which reads the full address (16 bytes for IPv6) trusting the parameter's declared length. An unauthenticated peer can send a truncated trailing ASCONF chunk that declares an IPv6 address parameter but stops after the 4-byte parameter header; reached from the no-association lookup path, from_addr_param() then reads uninitialized bytes past the parameter. Impact: an unauthenticated SCTP peer makes the receive path read up to 16 bytes of uninitialized memory past a truncated ASCONF address parameter. The sibling __sctp_rcv_init_lookup() bounds parameters with sctp_walk_params(); this path open-codes the fetch and omits the bound. Verify the whole address parameter lies within the chunk before from_addr_param() reads it, the same class of fix as commit 51e5ad549c43 ("net: sctp: fix KMSAN uninit-value in sctp_inq_pop"). Fixes: df2185771439 ("[SCTP]: Update association lookup to look at ASCONF chunks as well") Signed-off-by: Michael Bommarito Acked-by: Xin Long Link: https://patch.msgid.link/20260608122234.459098-1-michael.bommarito@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/sctp/input.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/net/sctp/input.c b/net/sctp/input.c index 079b1bfc7d3106..3c7761199f200b 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c @@ -1172,6 +1172,14 @@ static struct sctp_association *__sctp_rcv_asconf_lookup( /* Skip over the ADDIP header and find the Address parameter */ param = (union sctp_addr_param *)(asconf + 1); + /* The whole address parameter must lie within the chunk before + * af->from_addr_param() reads the variable-length address; otherwise a + * truncated trailing ASCONF chunk lets it read uninitialized bytes past + * the parameter. + */ + if (sizeof(*asconf) + ntohs(param->p.length) > ntohs(ch->length)) + return NULL; + af = sctp_get_af_specific(param_type2af(param->p.type)); if (unlikely(!af)) return NULL; -- 2.53.0