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=1796228148; b=DU+42BkZIag+ROV/s7TUiWB50WESPw4RpaZvNGXt1WOdcbV0couVPqbZ8wFhYOtILRuB +sD6SLv7g0bFEbGzQxr4tu53c60IBsFkwiT74cVtWxF7gA5wW/Hu/MSmEm7GmpcLqpWQU 2pA2IqxTNR7SbHCD0m1mmpvAEDAR7ljqwxp0bnNpJvu531PqGrAsZl4KTbY/H9XEO+2rZ J3D6Pz8APJWN1XNqIhEISt7teNo9LKyOtVLBoYmsbn44YabdPlW74fOQ4Rzz6N1MH8mp4 VhC5a9oH5CXOM3KIHVklpdkpSadsHQjhJXBqrqMFJNPlVR1Wkqk71MZ2oRIsySZ9KCQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796228148; h=Received:DKIM-Signature:Subject:To:Cc:From:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=Zj5qA+TPdxYJ+9WgeD8R1GtV1qbWsc9PsLhWLPPKrgg=; b=HcHfQfYDgBi3sJeq+yHRYZBvxR+Jb/EGfdVEJzS/L7kQ/wiZK/XhPCZmwZIoq+0FnA5o adHK3yO4/4pD80LSQH10AqHv14JtxgbX6fSSa8W+G+cL3c6k2n78gTZ+Uld0/ryO3muJn eZxOzr2lJ75ormV70hD0+22ZzkY8IAyqWPXw057lPSZ5n6QOTZiwEbk8hDqpcqRb1pav1 ap0QKp+IlCAH0Dn61uZK6+DFsEU5jfykjfa5OjNoNVw0C51es2Sq5UAKkZoZMnPhyxqu4 pkLjV2T9oOEd8Z2BkRyWDajMVhBGaVZVLHQ1AgtEHVijBvg1negdW8fFVzrhiGg0jgg== 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=ZMFXGu73; 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 80EA3606A32A for ; Wed, 2 Dec 2026 16:15:48 +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=ZMFXGu73 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 897071F000C1; Wed, 2 Dec 2026 16:15:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796228148; bh=Zj5qA+TPdxYJ+9WgeD8R1GtV1qbWsc9PsLhWLPPKrgg=; h=Subject:To:Cc:From:Date; b=ZMFXGu73TynQUj8TQMkAaGocgbiYMkLXjpP5pylwK4NkRgcS0Vor1ydpMv2Eb0BXo /noKta5Bz0L9OvgHSUzdB4YiQamAoc1G2RHwDpHoNZwX8smnEiuwBPVahtPO5+IrXL +R6YGhRQ/yqX/eyEeIBGKr2/0XRWVJz0z1gUMkcU= Subject: FAILED: patch "[PATCH] net: openvswitch: use skb_set_transport_header_careful() in" failed to apply to 6.6-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:28 +0100 Message-ID: <2026120228-curdle-uncounted-b8cc@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 b9b77e2430032c21cc82b7da3a0bc0d8e74e6c26 # git commit -s git send-email --to '' --in-reply-to '2026120228-curdle-uncounted-b8cc@gregkh' --subject-prefix 'PATCH 6.6.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; }