Article View: linux.kernel.netdev
Article #3585[PATCH 1/2 net-next] net: openvswitch: skip IPv4 later fragments on TCP/UDP set actions
From: Fernando Fernandez Mancera
Date: Thu, 15 Oct 2026 12:47
Date: Thu, 15 Oct 2026 12:47
44 lines
10593 bytes
10593 bytes
An IPv4 later fragment carries no L4 header, but key extraction leaves
ip.proto set to the real protocol and the flow may wildcard the frag
field, so validate_set() accepts such packets. set_tcp() and set_udp()
then treat the first bytes of the fragment payload as an L4 header,
rewrite them as ports and patch the bytes at the checksum offset,
corrupting the packet.
Skip these actions for OVS_FRAG_TYPE_LATER. IPv6 later fragments are not
affected, since their ip.proto is NEXTHDR_FRAGMENT and validate_set()
rejects L4 set actions for them.
Fixes: ccb1352e76cf ("net: Add Open vSwitch kernel components.")
Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
---
net/openvswitch/actions.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index 27152bca8a8c..4aade471afc4 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
@@ -595,6 +595,9 @@ static int set_udp(struct sk_buff *skb, struct sw_flow_key *flow_key,
__be16 src, dst;
int err;
+ if (flow_key->ip.frag == OVS_FRAG_TYPE_LATER)
+ return 0;
+
err = skb_ensure_writable(skb, skb_transport_offset(skb) +
sizeof(struct udphdr));
if (unlikely(err))
@@ -638,6 +641,9 @@ static int set_tcp(struct sk_buff *skb, struct sw_flow_key *flow_key,
__be16 src, dst;
int err;
+ if (flow_key->ip.frag == OVS_FRAG_TYPE_LATER)
+ return 0;
+
err = skb_ensure_writable(skb, skb_transport_offset(skb) +
sizeof(struct tcphdr));
if (unlikely(err))
--
2.55.0
Technical Details
Message-ID:
<20261015124749.4694-1-fmancera@suse.de>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-346740-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-346740-linux-kernel-netdev=dewy.ru From: fmancera@suse.de (Fernando Fernandez Mancera) Newsgroups: linux.kernel.netdev Subject: [PATCH 1/2 net-next] net: openvswitch: skip IPv4 later fragments on TCP/UDP set actions Date: Thu, 15 Oct 2026 14:47:48 +0200 Organization: Usenet Network Message-ID: <20261015124749.4694-1-fmancera@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2536127"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:91PfV99DwlzaGufox0C5psMzXK4= sha256:xff6ScY8yd0ZY7GZ40+RaSMu3qBf4SIzYS/nT4EJIsk= sha1:XwRu7t6qAPK7YBLzIiMRpA4fbCM= sha256:hODCAwt+Go5A49Z+HdJtKjppzt/ouugGFwWkXWbUmm4= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id D3436110308; Thu, 15 Oct 2026 16:14:42 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=suse.de header.b=VafmoCbN; dkim=neutral reason="invalid (unsupported algorithm ed25519-sha256)" header.d=suse.de header.b=Afbi+h3U; dkim=pass (1024-bit key) header.d=suse.de header.b=VafmoCbN; dkim=neutral reason="invalid (unsupported algorithm ed25519-sha256)" header.d=suse.de header.b=Afbi+h3U X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5kNOBG57FBzo; Thu, 15 Oct 2026 16:14:39 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-346740-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=suse.de X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id EA896110305; Thu, 15 Oct 2026 16:14:20 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id DA4D22D110; Thu, 15 Oct 2026 12:48:29 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A7A64DB56E; Thu, 15 Oct 2026 12:48:29 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="VafmoCbN"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="Afbi+h3U"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="VafmoCbN"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="Afbi+h3U" X-Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2DE985038E8 for <netdev@vger.kernel.org>; Thu, 15 Oct 2026 12:48:27 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792068509; cv=none; b=E+oESGbAGKEFiV4FrgRDe/YjJTGUz6Lq3Ze7BBa/bAbIc21bZG9/9VzcbxafCe0VuE/X349OJsWuCH+eqlB+V9+iY+JINtRcJBZ4Wkax5Sa+zt5D4XnUAH+Fo/eFmJpjahXL9jL0iSqMzZ/Thrs8QnjCL4FZCm8txcxy8esmkM4= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792068509; c=relaxed/simple; bh=CBxgp8hd5VqFuHEiXGD6BxJwJP6dlRrq66zEDcFm0AQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=rh9NOnyYUYfTXI6oznVt2z7FNgSraTP9/744U+e0ep0XqOJqtWuxa2ON1G5OjB0L9DrT2soblTVe/FkOzEZpDaNpCtiKtZrSWkNv5NbbwpnwhJXoPsSimFpOmvkRENEPWsFnRUfpPK3RxrFxOV3JxrPm/mG52cJ2GYC8T7NqXds= X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=VafmoCbN; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=Afbi+h3U; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=VafmoCbN; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=Afbi+h3U; arc=none smtp.client-ip=195.135.223.131 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de X-Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 08B651FDD9; Thu, 15 Oct 2026 12:48:26 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1792068506; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=l53wZ1T6OIcdWRKp/q9mEA/mABVpHS45YXdDwTw5Gfs=; b=VafmoCbNwvAxCVho4a5W4HY9/a+iGu4tnQOoDU8L1uXeWVKwWjISflHZu1lKzhJNu06Pqj beQWMaEeXTghZ1k2qDd7YilvG/8kEPpHFDNX6V3jtQasq2vDC8NAd5PZeJ/0Bs+kDOFYh3 5QNK6l4sGlxq/IoM7g7d/VVWcfxPSkw= X-DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1792068506; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=l53wZ1T6OIcdWRKp/q9mEA/mABVpHS45YXdDwTw5Gfs=; b=Afbi+h3UNLkKS+o6csG7XNY0xSke74lI3l4iiHkBofZOeglDIvedMd9TWkGHj5LriKyHfc Gukxet0sEr5ajXDQ== X-Authentication-Results: smtp-out2.suse.de; none X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1792068506; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=l53wZ1T6OIcdWRKp/q9mEA/mABVpHS45YXdDwTw5Gfs=; b=VafmoCbNwvAxCVho4a5W4HY9/a+iGu4tnQOoDU8L1uXeWVKwWjISflHZu1lKzhJNu06Pqj beQWMaEeXTghZ1k2qDd7YilvG/8kEPpHFDNX6V3jtQasq2vDC8NAd5PZeJ/0Bs+kDOFYh3 5QNK6l4sGlxq/IoM7g7d/VVWcfxPSkw= X-DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1792068506; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=l53wZ1T6OIcdWRKp/q9mEA/mABVpHS45YXdDwTw5Gfs=; b=Afbi+h3UNLkKS+o6csG7XNY0xSke74lI3l4iiHkBofZOeglDIvedMd9TWkGHj5LriKyHfc Gukxet0sEr5ajXDQ== X-Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 6ADE41373D; Thu, 15 Oct 2026 12:48:15 +0000 (UTC) X-Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 7MJWDY7L0GoCLQAAD6G6ig (envelope-from <fmancera@suse.de>); Thu, 15 Oct 2026 12:48:15 +0000 X-Cc: dev@openvswitch.org, jesse@nicira.com, aatteka@nicira.com, horms@kernel.org, pabeni@redhat.com, kuba@kernel.org, edumazet@kernel.org, davem@davemloft.net, i.maximets@ovn.org, echaudro@redhat.com, aconole@redhat.com, Fernando Fernandez Mancera <fmancera@suse.de> X-Mailer: git-send-email 2.51.0 X-Precedence: bulk X-Mailing-List: netdev@vger.kernel.org X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.995]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_TWELVE(0.00)[13]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,imap1.dmz-prg2.suse.org:helo]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]