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 C383C43D4E9; Tue, 16 Jun 2026 17:02:51 +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=1781629372; cv=none; b=Y9ib9uPRu5CO8kt49f0Rgt1dhb+OUvcsQBBcnv7mzJoddfZ6JWZkZ52Ijjw/eVnmuB9sZYYooHvgtTpPaMFwoULbVEtWzdP6zNpR36dODmrgeGRi8hI5xyh3kLxPgZjL9oNTzhKpR1LUH01eEI4ur9CRZDHBM8jfILM/H3+iK9I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781629372; c=relaxed/simple; bh=c/qTHzEyW4+kum/XQcD2RdsVON/WGWag5tGga5f+8J4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oPXolLPC3i3XkYpThT2LMZ+hytrx/2Lm/gPvAN03ddZdSSahgTfMt5adOc+qurDyBjrCHBhXwqKtjK7nR83R5/DUi/bJPlnZOTeHky7Ip3GF1lIelhza/8rVUJvGcJcMuh68+L8zqr9Dcecf2REPTS9zmIomtTRMsSHw3o4RC18= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=eEJaO6ft; 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="eEJaO6ft" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D49A71F000E9; Tue, 16 Jun 2026 17:02:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1781629371; bh=CLNl7e77/Pdqkqq5yfE/agSiJ5BiQ8r89I0t4gRQXhY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=eEJaO6ftFwBJvKOPdt2LJ+wStqk6HqrSbmu/K3f+Oihdi1026JHX63n+dSE8v8j1V 7thKc5tKoglXEDlHlibKNrGsXSWSv9byIAc7SMmWCKSBM/OLJkwXPiL0nvE8OOIdud GO1o49s9n951PssV69rsCpSLWwWFDT/rOSRpwpYM= 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 6.6 272/452] sctp: fix uninit-value in __sctp_rcv_asconf_lookup() Date: Tue, 16 Jun 2026 20:28:19 +0530 Message-ID: <20260616145131.868126379@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260616145117.796205997@linuxfoundation.org> References: <20260616145117.796205997@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 6.6-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 032a10d82302c3..df5b2187b8fada 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c @@ -1204,6 +1204,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