Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2225649/?format=api
{ "id": 2225649, "url": "http://patchwork.ozlabs.org/api/patches/2225649/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260421104409.5452-3-fmancera@suse.de/", "project": { "id": 26, "url": "http://patchwork.ozlabs.org/api/projects/26/?format=api", "name": "Netfilter Development", "link_name": "netfilter-devel", "list_id": "netfilter-devel.vger.kernel.org", "list_email": "netfilter-devel@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260421104409.5452-3-fmancera@suse.de>", "list_archive_url": null, "date": "2026-04-21T10:44:09", "name": "[3/3,nf,v3] netfilter: xtables: fix L4 header parsing for non-first fragments", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "3cf24fc24e79f8ce999ff4997943dd0848c5ac68", "submitter": { "id": 90904, "url": "http://patchwork.ozlabs.org/api/people/90904/?format=api", "name": "Fernando Fernandez Mancera", "email": "fmancera@suse.de" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260421104409.5452-3-fmancera@suse.de/mbox/", "series": [ { "id": 500779, "url": "http://patchwork.ozlabs.org/api/series/500779/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=500779", "date": "2026-04-21T10:44:08", "name": "[1/3,nf,v3] netfilter: nf_socket: skip socket lookup for non-first fragments", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/500779/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2225649/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2225649/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <netfilter-devel+bounces-12105-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "netfilter-devel@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256\n header.s=susede2_rsa header.b=jI6nNV4q;\n\tdkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=shBrUxKg;\n\tdkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.a=rsa-sha256 header.s=susede2_rsa header.b=jI6nNV4q;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=shBrUxKg;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-12105-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.b=\"jI6nNV4q\";\n\tdkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de\n header.b=\"shBrUxKg\";\n\tdkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.b=\"jI6nNV4q\";\n\tdkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de\n header.b=\"shBrUxKg\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=195.135.223.130", "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=suse.de", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=suse.de", "smtp-out1.suse.de;\n\tnone" ], "Received": [ "from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0Jwc69sHz1yGt\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 20:48:00 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 8304F3062A08\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 10:44:32 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id DE6133BD629;\n\tTue, 21 Apr 2026 10:44:29 +0000 (UTC)", "from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 567922C11D5\n\tfor <netfilter-devel@vger.kernel.org>; Tue, 21 Apr 2026 10:44:27 +0000 (UTC)", "from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby smtp-out1.suse.de (Postfix) with ESMTPS id AA6E36A8EA;\n\tTue, 21 Apr 2026 10:44:25 +0000 (UTC)", "from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 32BEC593AF;\n\tTue, 21 Apr 2026 10:44:25 +0000 (UTC)", "from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])\n\tby imap1.dmz-prg2.suse.org with ESMTPSA\n\tid UHtTCQlV52ljagAAD6G6ig\n\t(envelope-from <fmancera@suse.de>); Tue, 21 Apr 2026 10:44:25 +0000" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776768269; cv=none;\n b=nrdNfcS8oYm672zcWek+S8dS2Ic33XaaHFBR4Nx4aOTIO1b8NbrgaF6MrcFma9HbzRbqNekHGTsG1UIsG2taWYyhw4JHGaOMpoNrkVZr8oeaIAoDHM4vvioVTMg9t8QJ0wXDkB8aPE6HLMsyz98CUxDxZU2Vne1RfkCYw8OFTME=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776768269; c=relaxed/simple;\n\tbh=mZxQvTFnBDxExGM6h13mh5BONBNuxGdsvq7Vqcu4Dw4=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=bEQQqQPymhGbTbeK/bNBxKaM3OmRl/13F6QTl5XT/ylOBdYc1BzSk7CBFQbEwkf8Izd85PMP4gSP35NzbX+K9+0THGK0HHyO6b7dzUNgz741UkzjUUXH9FikG17qWgnOZqp17Gm/eYQFiOKGUU42XI/i9RbN40VpRxxQqykwpqk=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=suse.de;\n spf=pass smtp.mailfrom=suse.de;\n dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.b=jI6nNV4q;\n dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de\n header.b=shBrUxKg;\n dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.b=jI6nNV4q;\n dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de\n header.b=shBrUxKg; arc=none smtp.client-ip=195.135.223.130", "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n\tt=1776768265;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n\t mime-version:mime-version:\n\t content-transfer-encoding:content-transfer-encoding:\n\t in-reply-to:in-reply-to:references:references;\n\tbh=aLYV60dJOhfP7PM3eyxs3RaF3jDLINC5IPyVm0xw7r0=;\n\tb=jI6nNV4qHkIHg1ZQnEMGlieCSdTjQAx6h1G7MkiI8JveQHHac+mBqutFCcYE3WJAZEfZoB\n\tnFu1fO+g+1BcXLBTXwxTr7+8vCXrYq0QezDgWANpXwNalwGyB2bJSs850fzuk8CDEqPq1y\n\t7YEeoCLolCMxZxpha5gyFE7xluf4+f8=", "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n\ts=susede2_ed25519; t=1776768265;\n\th=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n\t mime-version:mime-version:\n\t content-transfer-encoding:content-transfer-encoding:\n\t in-reply-to:in-reply-to:references:references;\n\tbh=aLYV60dJOhfP7PM3eyxs3RaF3jDLINC5IPyVm0xw7r0=;\n\tb=shBrUxKgbcPLdQ7+kQWvko/ED1ekntGtOiChA6a3cvnyT1kGhs2Tp0zYnurs9+UwFRAJKN\n\tzYM1Tj4JLJykM/AQ==", "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n\tt=1776768265;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n\t mime-version:mime-version:\n\t content-transfer-encoding:content-transfer-encoding:\n\t in-reply-to:in-reply-to:references:references;\n\tbh=aLYV60dJOhfP7PM3eyxs3RaF3jDLINC5IPyVm0xw7r0=;\n\tb=jI6nNV4qHkIHg1ZQnEMGlieCSdTjQAx6h1G7MkiI8JveQHHac+mBqutFCcYE3WJAZEfZoB\n\tnFu1fO+g+1BcXLBTXwxTr7+8vCXrYq0QezDgWANpXwNalwGyB2bJSs850fzuk8CDEqPq1y\n\t7YEeoCLolCMxZxpha5gyFE7xluf4+f8=", "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n\ts=susede2_ed25519; t=1776768265;\n\th=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n\t mime-version:mime-version:\n\t content-transfer-encoding:content-transfer-encoding:\n\t in-reply-to:in-reply-to:references:references;\n\tbh=aLYV60dJOhfP7PM3eyxs3RaF3jDLINC5IPyVm0xw7r0=;\n\tb=shBrUxKgbcPLdQ7+kQWvko/ED1ekntGtOiChA6a3cvnyT1kGhs2Tp0zYnurs9+UwFRAJKN\n\tzYM1Tj4JLJykM/AQ==" ], "From": "Fernando Fernandez Mancera <fmancera@suse.de>", "To": "netfilter-devel@vger.kernel.org", "Cc": "coreteam@netfilter.org,\n\tecklm94@gmail.com,\n\tphil@nwl.cc,\n\tfw@strlen.de,\n\tpablo@netfilter.org,\n\tFernando Fernandez Mancera <fmancera@suse.de>", "Subject": "[PATCH 3/3 nf v3] netfilter: xtables: fix L4 header parsing for\n non-first fragments", "Date": "Tue, 21 Apr 2026 12:44:09 +0200", "Message-ID": "<20260421104409.5452-3-fmancera@suse.de>", "X-Mailer": "git-send-email 2.51.0", "In-Reply-To": "<20260421104409.5452-1-fmancera@suse.de>", "References": "<20260421104409.5452-1-fmancera@suse.de>", "Precedence": "bulk", "X-Mailing-List": "netfilter-devel@vger.kernel.org", "List-Id": "<netfilter-devel.vger.kernel.org>", "List-Subscribe": "<mailto:netfilter-devel+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:netfilter-devel+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Spamd-Result": "default: False [-6.80 / 50.00];\n\tREPLY(-4.00)[];\n\tBAYES_HAM(-3.00)[100.00%];\n\tMID_CONTAINS_FROM(1.00)[];\n\tNEURAL_HAM_LONG(-1.00)[-1.000];\n\tR_MISSING_CHARSET(0.50)[];\n\tNEURAL_HAM_SHORT(-0.20)[-1.000];\n\tMIME_GOOD(-0.10)[text/plain];\n\tARC_NA(0.00)[];\n\tFUZZY_RATELIMITED(0.00)[rspamd.com];\n\tMIME_TRACE(0.00)[0:+];\n\tTO_MATCH_ENVRCPT_ALL(0.00)[];\n\tDKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];\n\tRCVD_TLS_ALL(0.00)[];\n\tTO_DN_SOME(0.00)[];\n\tFROM_EQ_ENVFROM(0.00)[];\n\tFROM_HAS_DN(0.00)[];\n\tFREEMAIL_CC(0.00)[netfilter.org,gmail.com,nwl.cc,strlen.de,suse.de];\n\tRCVD_COUNT_TWO(0.00)[2];\n\tRCPT_COUNT_SEVEN(0.00)[7];\n\tDBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo];\n\tRCVD_VIA_SMTP_AUTH(0.00)[];\n\tFREEMAIL_ENVRCPT(0.00)[gmail.com]", "X-Spam-Flag": "NO", "X-Spam-Score": "-6.80", "X-Spam-Level": "" }, "content": "Multiple targets and matches relies on L4 header to operate. For\nfragmented packets, every fragment carries the transport protocol\nidentifier, but only the first fragment contains the L4 header.\n\nAs the 'raw' table can be configured to run at priority -450 (before\ndefragmentation at -400), the target/match can be reached before\nreassembly. In this case, non-first fragments have their payload\nincorrectly parsed as a TCP/UDP header. This would be of course a\nmisconfiguration scenario. In most of the cases this just lead to a\nunreliable behavior for fragmented traffic.\n\nAdd a fragment check to ensure target/match only evaluates unfragmented\npackets or the first fragment in the stream.\n\nFixes: 902d6a4c2a4f (\"netfilter: nf_defrag: Skip defrag if NOTRACK is set\")\nSigned-off-by: Fernando Fernandez Mancera <fmancera@suse.de>\n---\nv2: handled ecn, socket and tcpmss matches\nv3: extracted socket to its own patch with a generic solution for\nnft/xt, added a comment specifying that par->fragoff is fine for\necn/tcpmss ipv6 as they enforce -p tcp. Keep on mind that osf only\nsupports ipv4.\n---\n net/netfilter/xt_TPROXY.c | 11 +++++++++--\n net/netfilter/xt_ecn.c | 4 ++++\n net/netfilter/xt_osf.c | 3 +++\n net/netfilter/xt_tcpmss.c | 4 ++++\n 4 files changed, 20 insertions(+), 2 deletions(-)", "diff": "diff --git a/net/netfilter/xt_TPROXY.c b/net/netfilter/xt_TPROXY.c\nindex e4bea1d346cf..5f60e7298a1e 100644\n--- a/net/netfilter/xt_TPROXY.c\n+++ b/net/netfilter/xt_TPROXY.c\n@@ -86,6 +86,9 @@ tproxy_tg4_v0(struct sk_buff *skb, const struct xt_action_param *par)\n {\n \tconst struct xt_tproxy_target_info *tgi = par->targinfo;\n \n+\tif (par->fragoff)\n+\t\treturn NF_DROP;\n+\n \treturn tproxy_tg4(xt_net(par), skb, tgi->laddr, tgi->lport,\n \t\t\t tgi->mark_mask, tgi->mark_value);\n }\n@@ -95,6 +98,9 @@ tproxy_tg4_v1(struct sk_buff *skb, const struct xt_action_param *par)\n {\n \tconst struct xt_tproxy_target_info_v1 *tgi = par->targinfo;\n \n+\tif (par->fragoff)\n+\t\treturn NF_DROP;\n+\n \treturn tproxy_tg4(xt_net(par), skb, tgi->laddr.ip, tgi->lport,\n \t\t\t tgi->mark_mask, tgi->mark_value);\n }\n@@ -106,6 +112,7 @@ tproxy_tg6_v1(struct sk_buff *skb, const struct xt_action_param *par)\n {\n \tconst struct ipv6hdr *iph = ipv6_hdr(skb);\n \tconst struct xt_tproxy_target_info_v1 *tgi = par->targinfo;\n+\tunsigned short fragoff = 0;\n \tstruct udphdr _hdr, *hp;\n \tstruct sock *sk;\n \tconst struct in6_addr *laddr;\n@@ -113,8 +120,8 @@ tproxy_tg6_v1(struct sk_buff *skb, const struct xt_action_param *par)\n \tint thoff = 0;\n \tint tproto;\n \n-\ttproto = ipv6_find_hdr(skb, &thoff, -1, NULL, NULL);\n-\tif (tproto < 0)\n+\ttproto = ipv6_find_hdr(skb, &thoff, -1, &fragoff, NULL);\n+\tif (tproto < 0 || fragoff)\n \t\treturn NF_DROP;\n \n \thp = skb_header_pointer(skb, thoff, sizeof(_hdr), &_hdr);\ndiff --git a/net/netfilter/xt_ecn.c b/net/netfilter/xt_ecn.c\nindex b96e8203ac54..a8503f5d26bf 100644\n--- a/net/netfilter/xt_ecn.c\n+++ b/net/netfilter/xt_ecn.c\n@@ -30,6 +30,10 @@ static bool match_tcp(const struct sk_buff *skb, struct xt_action_param *par)\n \tstruct tcphdr _tcph;\n \tconst struct tcphdr *th;\n \n+\t/* this is fine for IPv6 as ecn_mt_check6() enforces -p tcp */\n+\tif (par->fragoff)\n+\t\treturn false;\n+\n \t/* In practice, TCP match does this, so can't fail. But let's\n \t * be good citizens.\n \t */\ndiff --git a/net/netfilter/xt_osf.c b/net/netfilter/xt_osf.c\nindex dc9485854002..e8807caede68 100644\n--- a/net/netfilter/xt_osf.c\n+++ b/net/netfilter/xt_osf.c\n@@ -27,6 +27,9 @@\n static bool\n xt_osf_match_packet(const struct sk_buff *skb, struct xt_action_param *p)\n {\n+\tif (p->fragoff)\n+\t\treturn false;\n+\n \treturn nf_osf_match(skb, xt_family(p), xt_hooknum(p), xt_in(p),\n \t\t\t xt_out(p), p->matchinfo, xt_net(p), nf_osf_fingers);\n }\ndiff --git a/net/netfilter/xt_tcpmss.c b/net/netfilter/xt_tcpmss.c\nindex 0d32d4841cb3..b9da8269161d 100644\n--- a/net/netfilter/xt_tcpmss.c\n+++ b/net/netfilter/xt_tcpmss.c\n@@ -32,6 +32,10 @@ tcpmss_mt(const struct sk_buff *skb, struct xt_action_param *par)\n \tu8 _opt[15 * 4 - sizeof(_tcph)];\n \tunsigned int i, optlen;\n \n+\t/* this is fine for IPv6 as xt_tcpmss enforces -p tcp */\n+\tif (par->fragoff)\n+\t\treturn false;\n+\n \t/* If we don't have the whole header, drop packet. */\n \tth = skb_header_pointer(skb, par->thoff, sizeof(_tcph), &_tcph);\n \tif (th == NULL)\n", "prefixes": [ "3/3", "nf", "v3" ] }