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=1796228151; b=2F/X/9Z5i6vN57ZSxnUJFKg/B3Ph8FIf/VPhowRCACKWsVxvM9qyAKTDxRdRvivLuQ9C A1KV9RTatJmR9p+kp+O1ud0hh+b9Zu85GJIW4G+kCtVUX3bbq4FBP94uaODCxioCdeJNB sIsLTfLzeh6kqASfTkNqBPk6A0W0q0iCQ6ohl7kBjafIGIz45VpytphIH78zgTCDtERQV 0K0SiFy9W1O2AdQruwIiO7sggGdIPCXLkUr6ALobf8sqy9FKEHznq6NOhFa7g3x7fK3nQ Npror0TiGLNZqdOQVM12+cP98T56kup/X3uHdkCFfMZfP/IagZTFqDkxJ15roEzffmw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796228151; h=Received:DKIM-Signature:Subject:To:Cc:From:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=6MS+jMdJzDzRXiiQPMESDiytiO/Q2h933SYjesRtvjs=; b=U/rjKeGl5K2m5Sgs48QvmrbkVRX5R7ffWsNwOgaLhYVYzWT3+VaLJSQ6WyxEhNcxk91l OjwXPx2F2b/EKoJkcjZmpGU7ePyqBLhS3a1WfSd4bz2pOZyuIzMtokVUbSz3Y/ovKJqti XrNw8w53LCx7QxdtrmHvOhLWPHNefY1HlozSuqzX1ponYNk/xQJTCJ3cq4XjIVYUxyBhP 6tlJW1K0dPwc9l00rHG+4b4B8fKDjIGm9wf6aRom2KUZfgT5U3uSPjn4Ied9AitLw5HvS FG7At0zqNGFWRu6py8WOdw7VXrfo2zPGN5xbGuYP9lJsPtKDeYWRNvqB933LM8mJqvA== 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=m4mjPMB1; 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 D5E71606A31A for ; Wed, 2 Dec 2026 16:15:51 +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=m4mjPMB1 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD91B1F0089B; Wed, 2 Dec 2026 16:15:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796228151; bh=6MS+jMdJzDzRXiiQPMESDiytiO/Q2h933SYjesRtvjs=; h=Subject:To:Cc:From:Date; b=m4mjPMB1QCj3qlFjlQ/BRgU5LaMJ1+UUf95xdXgtYSijYXezq8dO7kXJhfUA493a8 HFDAzQzBHmr1dKoBQDr//ygqbfv1l4z9dryp8FOS5UF0YPMkiKi9kdlsW0+tfvjwwm +9PnJbf+mWLYC31CPI+Vq3iOL3MLgRveasqvYKzM= Subject: FAILED: patch "[PATCH] net: openvswitch: use skb_set_transport_header_careful() in" failed to apply to 6.1-stable tree To: edumazet@kernel.org,aconole@redhat.com,i.maximets@ovn.org,justin.iurman@gmail.com,pabeni@redhat.com Cc: From: Date: Wed, 02 Dec 2026 16:11:29 +0100 Message-ID: <2026120228-collide-retract-1328@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.1-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.1.y git checkout FETCH_HEAD git cherry-pick -x b9b77e2430032c21cc82b7da3a0bc0d8e74e6c26 # git commit -s git send-email --to '' --in-reply-to '2026120228-collide-retract-1328@gregkh' --subject-prefix 'PATCH 6.1.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From b9b77e2430032c21cc82b7da3a0bc0d8e74e6c26 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Fri, 13 Nov 2026 13:46:23 +0100 Subject: [PATCH] net: openvswitch: use skb_set_transport_header_careful() in parse_ipv6hdr() 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. parse_ipv6hdr() stores the payload offset found by ipv6_find_hdr(), which depends on the extension headers found in the packet. Should the value be truncated, key_extract_l3l4() would parse the L4 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. No reproducer was written, this is hardening. Use skb_set_transport_header_careful() and return -EPROTO if the offset can not be stored. As for other ipv6_find_hdr() failures, the caller then sets the transport header to the network header and does not parse L4. While at it, use payload_ofs directly, since nh_ofs + nh_len == payload_ofs. Fixes: 1a37e412a022 ("net: Use 16bits for *_headers fields of struct skbuff") Cc: stable@vger.kernel.org Signed-off-by: Eric Dumazet Reviewed-by: Ilya Maximets Reviewed-by: Aaron Conole Link: https://patch.msgid.link/20261113124625.4010206-4-edumazet@kernel.org Reviewed-by: Justin Iurman Signed-off-by: Paolo Abeni diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c index 3734416b518d..5fbeb0cca9dc 100644 --- a/net/openvswitch/flow.c +++ b/net/openvswitch/flow.c @@ -438,7 +438,8 @@ static int parse_ipv6hdr(struct sk_buff *skb, struct sw_flow_key *key) return -EPROTO; nh_len = payload_ofs - nh_ofs; - skb_set_transport_header(skb, nh_ofs + nh_len); + if (unlikely(!skb_set_transport_header_careful(skb, payload_ofs))) + return -EPROTO; key->ip.proto = nexthdr; return nh_len; }