From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796228139; b=UxFM/7AcUmGQJrr9OeoiJPi7dXHhq447ofeJkwgSXD6vVWrUUz3aAb/sZSPtbc77facJ WXtxf5fuJSLSijWjIVuJ6FmJ3b2zwPhfcBvrctfIYDpM1sM6fO1M3Qi1ZHP4dpYTQD4He PnxyCX7DOcjekT9uknVIYqUQ+zJ2/S1mZuDwLc0D1HeBiSdJM5gDW4qg9nVyYuJnduxjf 5b1LqiAOwonw6JVxUAipN9ulV41H4kHOc6BSREhUj+LA49VJjJFqPgwOwVfU6tPTP2far vTioSDUaOvK/qoeDA0nE1Hlih0YWM+ZP3fUExWYfOM8Cc7hPaP6qnZ2Rgt6KeYzsH+g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796228139; h=Received:DKIM-Signature:Subject:To:Cc:From:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=X059buuEHEinrIoFEk13JXwNvhJDiQj/9bqrflTHuHk=; b=zD81RkZ6AqAxp91SoSpyDbQ2lx9dDkxCrX9Cb1Gl3NIbuiejvi4z+DCXBENgmg7hSRT3 y9skCy7PjDsaSxB6TYV8+wDqGWZ54wbplXfquPMDu/egLZe79gDYIYokFHDp6K5K+sNMe dSkvhixLgdfIxGGO/9gRtUH1L9nW19cAfSKw4pqHxSGg9mRmIxKiGza96HcMr/AKcYINb oLIvRLw4A4EYxfOwv+usC9aTiMnyfGbQsWjK12YZxyHerVzdHR0GdYZosargziaTskdea tkxzDHQrwzaCA8/BUQc9lmGoZFroe84mbphWDLL9Cqbz3Gn8V/Nb4FkPtPiwrt0IArw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b="1SGC/WU5"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D9FB606A322 for ; Wed, 2 Dec 2026 16:15:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=1SGC/WU5 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5DB21F00896; Wed, 2 Dec 2026 16:15:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796228139; bh=X059buuEHEinrIoFEk13JXwNvhJDiQj/9bqrflTHuHk=; h=Subject:To:Cc:From:Date; b=1SGC/WU5xmUt4mtUBCSEGRWnPFI5weL0FKqtbzoyBEoa+NQfFnLRLxCGJ/xBD/Bzd PaG0U9e5B8PN5qxtWCGcHmxC3iuyVNrpj1Y1z+ZqmqLxid8fv91kgeGq7iDRcfTv/O gYcoxgTim1lXO8fv04pDnrZIK5kU1ZoPbptaAWL4= Subject: FAILED: patch "[PATCH] sctp: use skb_set_transport_header_careful() in sctp_v6_err()" failed to apply to 6.6-stable tree To: edumazet@kernel.org,justin.iurman@gmail.com,pabeni@redhat.com Cc: From: Date: Wed, 02 Dec 2026 16:08:56 +0100 Message-ID: <2026120255-scrawny-canola-7dcb@gregkh> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.6-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y git checkout FETCH_HEAD git cherry-pick -x 13391f1a8c584e7c1addaea3fd47105d92cc724c # git commit -s git send-email --to '' --in-reply-to '2026120255-scrawny-canola-7dcb@gregkh' --subject-prefix 'PATCH 6.6.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 13391f1a8c584e7c1addaea3fd47105d92cc724c Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Fri, 13 Nov 2026 13:46:24 +0100 Subject: [PATCH] sctp: use skb_set_transport_header_careful() in sctp_v6_err() skb->transport_header is a 16-bit offset from skb->head, and U16_MAX is reserved as the "not set" value. skb_set_transport_header() silently truncates an offset that does not fit. sctp_v6_err() stores @offset, computed by icmpv6_notify() from the extension headers of the packet embedded in an ICMPv6 error. Should the value be truncated, sctp_err_lookup() would read the SCTP header at the wrong place. Since commit 3744b0964d52 ("ipv6: Implement limits on extension header parsing") a single chain is bounded to IP6_MAX_EXT_HDRS_CNT headers (24576 bytes), so this needs a large skb->data - skb->head on top of it, for instance after several nested decapsulations, each of them possibly pulling its own extension header chain, since @offset is relative to the IPv6 header embedded in the ICMPv6 error. No reproducer was written, this is hardening. Use skb_set_transport_header_careful() and ignore the ICMPv6 error if the offset can not be stored. Do this before changing the network header, so that nothing has to be restored on failure. Fixes: 1a37e412a022 ("net: Use 16bits for *_headers fields of struct skbuff") Cc: stable@vger.kernel.org Signed-off-by: Eric Dumazet Link: https://patch.msgid.link/20261113124625.4010206-5-edumazet@kernel.org Reviewed-by: Justin Iurman Signed-off-by: Paolo Abeni diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index 97390569c4bd..ad5c951efdf0 100644 --- a/net/sctp/ipv6.c +++ b/net/sctp/ipv6.c @@ -170,8 +170,11 @@ static int sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, /* Fix up skb to look at the embedded net header. */ saveip = skb->network_header; savesctp = skb->transport_header; + if (unlikely(!skb_set_transport_header_careful(skb, offset))) { + __ICMP6_INC_STATS(net, __in6_dev_get(skb->dev), ICMP6_MIB_INERRORS); + return -EINVAL; + } skb_reset_network_header(skb); - skb_set_transport_header(skb, offset); sk = sctp_err_lookup(net, AF_INET6, skb, sctp_hdr(skb), &asoc, &transport); /* Put back, the original pointers. */ skb->network_header = saveip;