Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2215845/?format=api
{ "id": 2215845, "url": "http://patchwork.ozlabs.org/api/patches/2215845/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260325131108.23045-2-fw@strlen.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": "<20260325131108.23045-2-fw@strlen.de>", "list_archive_url": null, "date": "2026-03-25T13:10:55", "name": "[net,01/14] netfilter: nft_set_pipapo_avx2: don't return non-matching entry on expiry", "commit_ref": null, "pull_url": null, "state": "handled-elsewhere", "archived": true, "hash": "1a13e4180a405db3a2bcfcd0f7f52de9e11ec21f", "submitter": { "id": 1025, "url": "http://patchwork.ozlabs.org/api/people/1025/?format=api", "name": "Florian Westphal", "email": "fw@strlen.de" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260325131108.23045-2-fw@strlen.de/mbox/", "series": [ { "id": 497441, "url": "http://patchwork.ozlabs.org/api/series/497441/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=497441", "date": "2026-03-25T13:10:55", "name": "[net,01/14] netfilter: nft_set_pipapo_avx2: don't return non-matching entry on expiry", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/497441/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2215845/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2215845/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <netfilter-devel+bounces-11396-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 spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c09:e001:a7::12fc:5321; helo=sto.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-11396-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=91.216.245.30", "smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=strlen.de", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=Chamillionaire.breakpoint.cc" ], "Received": [ "from sto.lore.kernel.org (sto.lore.kernel.org\n [IPv6:2600:3c09:e001:a7::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fgndJ0P5Sz1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 00:22:28 +1100 (AEDT)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id 581283105EB1\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 13:12:14 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 9F0D63DA5BA;\n\tWed, 25 Mar 2026 13:11:46 +0000 (UTC)", "from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc\n [91.216.245.30])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id F2BD83D9022;\n\tWed, 25 Mar 2026 13:11:44 +0000 (UTC)", "by Chamillionaire.breakpoint.cc (Postfix, from userid 1003)\n\tid A86E3609EF; Wed, 25 Mar 2026 14:11:37 +0100 (CET)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774444306; cv=none;\n b=VHNLrqbMniX94IKKsGsss4ilfaXiRX1oaSd59Lmt/hKtinXQBhut3u7BaCf0KNeF6QZYOzORO1jY7S62/kNtlnYWsWHVTZp7gFekDWZW7vHJO7OgFQUKfNeRRdBEl2EeqwelBjQX2dcjlLdGV80Sd+zHp/oUfohPx4Ft9Q7C6p8=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774444306; c=relaxed/simple;\n\tbh=d04Zfo0BIF6gHy3v4BYuPlJBjVxEQOB7Z3gsWVJVK54=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=d0yiGXySbcfb9k5kCoWGXNy30ZhCJxvg/tuJHsfubUYjg7UwxixQ9IhBg0Bbj7nyUVKKtmdzLUzoAexVOYeMCloX3zibIoArUYKIHUr5nc2nD6Yn42peFOs9VamEyFG3eD90SsPoXPmpL/yfnlrb3bPPEZ5B8dKon62kyMTZnm8=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=strlen.de;\n spf=pass smtp.mailfrom=Chamillionaire.breakpoint.cc;\n arc=none smtp.client-ip=91.216.245.30", "From": "Florian Westphal <fw@strlen.de>", "To": "<netdev@vger.kernel.org>", "Cc": "Paolo Abeni <pabeni@redhat.com>,\n\t\"David S. Miller\" <davem@davemloft.net>,\n\tEric Dumazet <edumazet@google.com>,\n\tJakub Kicinski <kuba@kernel.org>,\n\t<netfilter-devel@vger.kernel.org>,\n\tpablo@netfilter.org", "Subject": "[PATCH net 01/14] netfilter: nft_set_pipapo_avx2: don't return\n non-matching entry on expiry", "Date": "Wed, 25 Mar 2026 14:10:55 +0100", "Message-ID": "<20260325131108.23045-2-fw@strlen.de>", "X-Mailer": "git-send-email 2.52.0", "In-Reply-To": "<20260325131108.23045-1-fw@strlen.de>", "References": "<20260325131108.23045-1-fw@strlen.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" }, "content": "New test case fails unexpectedly when avx2 matching functions are used.\n\nThe test first loads a ranomly generated pipapo set\nwith 'ipv4 . port' key, i.e. nft -f foo.\n\nThis works. Then, it reloads the set after a flush:\n(echo flush set t s; cat foo) | nft -f -\n\nThis is expected to work, because its the same set after all and it was\nalready loaded once.\n\nBut with avx2, this fails: nft reports a clashing element.\n\nThe reported clash is of following form:\n\n We successfully re-inserted\n a . b\n c . d\n\nThen we try to insert a . d\n\navx2 finds the already existing a . d, which (due to 'flush set') is marked\nas invalid in the new generation. It skips the element and moves to next.\n\nDue to incorrect masking, the skip-step finds the next matching\nelement *only considering the first field*,\n\ni.e. we return the already reinserted \"a . b\", even though the\nlast field is different and the entry should not have been matched.\n\nNo such error is reported for the generic c implementation (no avx2) or when\nthe last field has to use the 'nft_pipapo_avx2_lookup_slow' fallback.\n\nBisection points to\n7711f4bb4b36 (\"netfilter: nft_set_pipapo: fix range overlap detection\")\nbut that fix merely uncovers this bug.\n\nBefore this commit, the wrong element is returned, but erronously\nreported as a full, identical duplicate.\n\nThe root-cause is too early return in the avx2 match functions.\nWhen we process the last field, we should continue to process data\nuntil the entire input size has been consumed to make sure no stale\nbits remain in the map.\n\nReviewed-by: Stefano Brivio <sbrivio@redhat.com>\nLink: https://lore.kernel.org/netfilter-devel/20260321152506.037f68c0@elisabeth/\nSigned-off-by: Florian Westphal <fw@strlen.de>\n---\n net/netfilter/nft_set_pipapo_avx2.c | 20 ++++++++++----------\n 1 file changed, 10 insertions(+), 10 deletions(-)", "diff": "diff --git a/net/netfilter/nft_set_pipapo_avx2.c b/net/netfilter/nft_set_pipapo_avx2.c\nindex 7ff90325c97f..6395982e4d95 100644\n--- a/net/netfilter/nft_set_pipapo_avx2.c\n+++ b/net/netfilter/nft_set_pipapo_avx2.c\n@@ -242,7 +242,7 @@ static int nft_pipapo_avx2_lookup_4b_2(unsigned long *map, unsigned long *fill,\n \n \t\tb = nft_pipapo_avx2_refill(i_ul, &map[i_ul], fill, f->mt, last);\n \t\tif (last)\n-\t\t\treturn b;\n+\t\t\tret = b;\n \n \t\tif (unlikely(ret == -1))\n \t\t\tret = b / XSAVE_YMM_SIZE;\n@@ -319,7 +319,7 @@ static int nft_pipapo_avx2_lookup_4b_4(unsigned long *map, unsigned long *fill,\n \n \t\tb = nft_pipapo_avx2_refill(i_ul, &map[i_ul], fill, f->mt, last);\n \t\tif (last)\n-\t\t\treturn b;\n+\t\t\tret = b;\n \n \t\tif (unlikely(ret == -1))\n \t\t\tret = b / XSAVE_YMM_SIZE;\n@@ -414,7 +414,7 @@ static int nft_pipapo_avx2_lookup_4b_8(unsigned long *map, unsigned long *fill,\n \n \t\tb = nft_pipapo_avx2_refill(i_ul, &map[i_ul], fill, f->mt, last);\n \t\tif (last)\n-\t\t\treturn b;\n+\t\t\tret = b;\n \n \t\tif (unlikely(ret == -1))\n \t\t\tret = b / XSAVE_YMM_SIZE;\n@@ -505,7 +505,7 @@ static int nft_pipapo_avx2_lookup_4b_12(unsigned long *map, unsigned long *fill,\n \n \t\tb = nft_pipapo_avx2_refill(i_ul, &map[i_ul], fill, f->mt, last);\n \t\tif (last)\n-\t\t\treturn b;\n+\t\t\tret = b;\n \n \t\tif (unlikely(ret == -1))\n \t\t\tret = b / XSAVE_YMM_SIZE;\n@@ -641,7 +641,7 @@ static int nft_pipapo_avx2_lookup_4b_32(unsigned long *map, unsigned long *fill,\n \n \t\tb = nft_pipapo_avx2_refill(i_ul, &map[i_ul], fill, f->mt, last);\n \t\tif (last)\n-\t\t\treturn b;\n+\t\t\tret = b;\n \n \t\tif (unlikely(ret == -1))\n \t\t\tret = b / XSAVE_YMM_SIZE;\n@@ -699,7 +699,7 @@ static int nft_pipapo_avx2_lookup_8b_1(unsigned long *map, unsigned long *fill,\n \n \t\tb = nft_pipapo_avx2_refill(i_ul, &map[i_ul], fill, f->mt, last);\n \t\tif (last)\n-\t\t\treturn b;\n+\t\t\tret = b;\n \n \t\tif (unlikely(ret == -1))\n \t\t\tret = b / XSAVE_YMM_SIZE;\n@@ -764,7 +764,7 @@ static int nft_pipapo_avx2_lookup_8b_2(unsigned long *map, unsigned long *fill,\n \n \t\tb = nft_pipapo_avx2_refill(i_ul, &map[i_ul], fill, f->mt, last);\n \t\tif (last)\n-\t\t\treturn b;\n+\t\t\tret = b;\n \n \t\tif (unlikely(ret == -1))\n \t\t\tret = b / XSAVE_YMM_SIZE;\n@@ -839,7 +839,7 @@ static int nft_pipapo_avx2_lookup_8b_4(unsigned long *map, unsigned long *fill,\n \n \t\tb = nft_pipapo_avx2_refill(i_ul, &map[i_ul], fill, f->mt, last);\n \t\tif (last)\n-\t\t\treturn b;\n+\t\t\tret = b;\n \n \t\tif (unlikely(ret == -1))\n \t\t\tret = b / XSAVE_YMM_SIZE;\n@@ -925,7 +925,7 @@ static int nft_pipapo_avx2_lookup_8b_6(unsigned long *map, unsigned long *fill,\n \n \t\tb = nft_pipapo_avx2_refill(i_ul, &map[i_ul], fill, f->mt, last);\n \t\tif (last)\n-\t\t\treturn b;\n+\t\t\tret = b;\n \n \t\tif (unlikely(ret == -1))\n \t\t\tret = b / XSAVE_YMM_SIZE;\n@@ -1019,7 +1019,7 @@ static int nft_pipapo_avx2_lookup_8b_16(unsigned long *map, unsigned long *fill,\n \n \t\tb = nft_pipapo_avx2_refill(i_ul, &map[i_ul], fill, f->mt, last);\n \t\tif (last)\n-\t\t\treturn b;\n+\t\t\tret = b;\n \n \t\tif (unlikely(ret == -1))\n \t\t\tret = b / XSAVE_YMM_SIZE;\n", "prefixes": [ "net", "01/14" ] }