Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2218780/?format=api
{ "id": 2218780, "url": "http://patchwork.ozlabs.org/api/patches/2218780/?format=api", "web_url": "http://patchwork.ozlabs.org/project/ubuntu-kernel/patch/20260401220005.1178262-1-tim.whisonant@canonical.com/", "project": { "id": 15, "url": "http://patchwork.ozlabs.org/api/projects/15/?format=api", "name": "Ubuntu Kernel", "link_name": "ubuntu-kernel", "list_id": "kernel-team.lists.ubuntu.com", "list_email": "kernel-team@lists.ubuntu.com", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260401220005.1178262-1-tim.whisonant@canonical.com>", "list_archive_url": null, "date": "2026-04-01T22:00:04", "name": "[SRU,Q,1/1] netfilter: nft_set_pipapo: split gc into unlink and reclaim phase", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "69245ca0f8f8b93c850ebb09d8ecb13a4ea49bbf", "submitter": { "id": 89903, "url": "http://patchwork.ozlabs.org/api/people/89903/?format=api", "name": "Tim Whisonant", "email": "tim.whisonant@canonical.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/ubuntu-kernel/patch/20260401220005.1178262-1-tim.whisonant@canonical.com/mbox/", "series": [ { "id": 498400, "url": "http://patchwork.ozlabs.org/api/series/498400/?format=api", "web_url": "http://patchwork.ozlabs.org/project/ubuntu-kernel/list/?series=498400", "date": "2026-04-01T22:00:00", "name": "CVE-2026-23351", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/498400/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2218780/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2218780/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<kernel-team-bounces@lists.ubuntu.com>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (4096-bit key;\n unprotected) header.d=canonical.com header.i=@canonical.com\n header.a=rsa-sha256 header.s=20251003 header.b=h73p95FI;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com\n (client-ip=185.125.189.65; helo=lists.ubuntu.com;\n envelope-from=kernel-team-bounces@lists.ubuntu.com;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fmJnd28Jdz1yCs\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 02 Apr 2026 09:00:21 +1100 (AEDT)", "from localhost ([127.0.0.1] helo=lists.ubuntu.com)\n\tby lists.ubuntu.com with esmtp (Exim 4.86_2)\n\t(envelope-from <kernel-team-bounces@lists.ubuntu.com>)\n\tid 1w83bf-0007ww-DK; Wed, 01 Apr 2026 22:00:11 +0000", "from smtp-relay-internal-1.internal ([10.131.114.114]\n helo=smtp-relay-internal-1.canonical.com)\n by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.86_2) (envelope-from <tim.whisonant@canonical.com>)\n id 1w83be-0007sb-2K\n for kernel-team@lists.ubuntu.com; Wed, 01 Apr 2026 22:00:10 +0000", "from mail-ot1-f70.google.com (mail-ot1-f70.google.com\n [209.85.210.70])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id C8E9D3F13F\n for <kernel-team@lists.ubuntu.com>; Wed, 1 Apr 2026 22:00:09 +0000 (UTC)", "by mail-ot1-f70.google.com with SMTP id\n 46e09a7af769-7d7e0787438so441223a34.2\n for <kernel-team@lists.ubuntu.com>; Wed, 01 Apr 2026 15:00:09 -0700 (PDT)", "from localhost (104-6-108-11.lightspeed.frokca.sbcglobal.net.\n [104.6.108.11]) by smtp.gmail.com with ESMTPSA id\n 46e09a7af769-7dba72fd3fesm743439a34.14.2026.04.01.15.00.06\n for <kernel-team@lists.ubuntu.com>\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 01 Apr 2026 15:00:07 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com;\n s=20251003; t=1775080809;\n bh=sDrHArh6FFnBi3EJl6+eRnTQ1IWCvcXRtr7Q1u/PJBY=;\n h=From:To:Subject:Date:Message-ID:In-Reply-To:References:\n MIME-Version;\n b=h73p95FID7I0R3q1Pbp2rYTx67vpTOeSFOuBXUmbDoh4xBQU/bg54LJp5mX5N/al9\n FK7lkPXDFIcus/wDFybBgAmDQmbcJKZU1ii0b5A8jmRSXu3QOeWoagNRGPTNyE2FVC\n XSPYGMyGPhdI59jIifcMFxPqYn663qBftR7Q6iahf8tLJeY1Zl6S8OM7W7wsCKRqf+\n fSQKrxww6RdYq7KNzwcyy/64WSrufGailwqxqrNiLSL8E67CWjmr4rMTs3zXRJqRjG\n tM4nB8fhcI9sz7XBUSqjSfopwa1hxQlNdfMz8FFj1wdY1QWJiSLtzDGtc2M7VouzcM\n dSChji/JKawwD9PojTB3WVPeHubOg/miX03CFEcpIZlGxsa2+d5iY+ZsnjVZ7YXZuE\n w0ep0rbBSijX7eQuoG1fmBlyOANe3XG49gprrLlgv28prKSG9Rd3z7pDwp+Xnu1Il7\n LzX7dZuyaZ6n0mgFhHjR0xAimDUoEvDwzeuGuvJasV6gd5adxpAzcwqJNm6XN9RGWr\n DZchIxdeDRrGO2BwAkrwKk2xllXIE3lyCt3aok18L6gvelFJoIpd54mgWdIMfUxm2c\n KJjU0fW9l1TCruCLM6WK2BQxn72B/sHoeO8qmlzQjLQjQb6Uk9PrxjRs00X7NNLqkE\n pcLBxpF50LfqgySONKGgEJKQ=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775080808; x=1775685608;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to\n :cc:subject:date:message-id:reply-to;\n bh=sDrHArh6FFnBi3EJl6+eRnTQ1IWCvcXRtr7Q1u/PJBY=;\n b=rakTlTDrRYCgKLJjoKlqgjT1cOrEubvRT542k2BoUY3cxHrQFbTn/CUA4rdjfKjd6E\n 6/gzCJFIcYf+hxEZ/UZ4DtU9BZalLGYuXbcTXMrPCH2fczdrn1+oCCGicWRZ6cnS0jx3\n mNxPZOy9reCBtHGR3UeaW6Kz0sXE4dv5sGSNGO0ijttQb2FmtQGXBrz8T6LiUzi2DoqL\n YbmlNx4QcN+J8nGlGNB+5hloh5vmdUsmSdfMt9rXxf17f8MgOR+UdQigoEUw0ivF/vUr\n Cna1vHz0a+HkwgUQG+5pK7bQD3S7Kg+clwiwY6rstzmKNRZ5gziBQOLwTvRChnjyotXK\n ZRpA==", "X-Gm-Message-State": "AOJu0YzYlPlvgLUyoWysbVXijZPVPk/cs5dHysSnAcJu3iHwdWyQKBeh\n 68fzjg42obzfKO5wztoBbd7CWem2Ywe55G0lMXyc3AXvh1S83KGq3sjzollMblaXEIvNquDmMYB\n YXF0+EbaXd5x4o5WUi0+LAtwFkr/ZlYtoYcFVcq884SCJ38DkE0qARxofRcJQkg+Z294c2t7Li9\n 1dEQXSMRchMH56Xw==", "X-Gm-Gg": "ATEYQzyox5y1pRVzBNzIBQHuhwhXC2EV+M5t3+Zz3damqamBwsCT7GPqEorvn8uKSB/\n vWc5KLY0ilWX6bZoupwB9Fvxtii1U7GtR4ofXz8aJmCbjtN0FsH7c3bwq1XN/7mxX4mQXgGnjUl\n N+H1gyJLbeXjCF7Q9SER3AfTqYjk7GVP/nC9aPjaab88Ns6exxmIBD25UEeu2g/2hZaonqweoRX\n pu9xi/jfjDe3oB79Ik1OHklaSmNukcnL4yo1I4YAhbi1nc9MMbCVTZ5tph6ktQpMQKOkRbpl0Gt\n EutFqQdsQbTeaCdBy5jRlNlmXQqoRY5S9ACk93II1b/rXG04AvmVbfaRdYrA308I+4+ZTxk8pUT\n pEABBOKCTBwBgcvPX+mEgAkWpAHdZU7LNP5IC2a5KRmmu1iaJcjqNPhQxlSj4Wlu24bEC4ozGuh\n EC/Q==", "X-Received": [ "by 2002:a05:6830:67d2:b0:7d7:bf70:c021 with SMTP id\n 46e09a7af769-7db99464cb1mr3213232a34.27.1775080808074;\n Wed, 01 Apr 2026 15:00:08 -0700 (PDT)", "by 2002:a05:6830:67d2:b0:7d7:bf70:c021 with SMTP id\n 46e09a7af769-7db99464cb1mr3213199a34.27.1775080807599;\n Wed, 01 Apr 2026 15:00:07 -0700 (PDT)" ], "From": "Tim Whisonant <tim.whisonant@canonical.com>", "To": "kernel-team@lists.ubuntu.com", "Subject": "[SRU][Q][PATCH 1/1] netfilter: nft_set_pipapo: split gc into unlink\n and reclaim phase", "Date": "Wed, 1 Apr 2026 15:00:04 -0700", "Message-ID": "<20260401220005.1178262-1-tim.whisonant@canonical.com>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20260401220002.1178224-1-tim.whisonant@canonical.com>", "References": "<20260401220002.1178224-1-tim.whisonant@canonical.com>", "MIME-Version": "1.0", "X-BeenThere": "kernel-team@lists.ubuntu.com", "X-Mailman-Version": "2.1.20", "Precedence": "list", "List-Id": "Kernel team discussions <kernel-team.lists.ubuntu.com>", "List-Unsubscribe": "<https://lists.ubuntu.com/mailman/options/kernel-team>,\n <mailto:kernel-team-request@lists.ubuntu.com?subject=unsubscribe>", "List-Archive": "<https://lists.ubuntu.com/archives/kernel-team>", "List-Post": "<mailto:kernel-team@lists.ubuntu.com>", "List-Help": "<mailto:kernel-team-request@lists.ubuntu.com?subject=help>", "List-Subscribe": "<https://lists.ubuntu.com/mailman/listinfo/kernel-team>,\n <mailto:kernel-team-request@lists.ubuntu.com?subject=subscribe>", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "base64", "Errors-To": "kernel-team-bounces@lists.ubuntu.com", "Sender": "\"kernel-team\" <kernel-team-bounces@lists.ubuntu.com>" }, "content": "From: Florian Westphal <fw@strlen.de>\n\nYiming Qian reports Use-after-free in the pipapo set type:\n Under a large number of expired elements, commit-time GC can run for a very\n long time in a non-preemptible context, triggering soft lockup warnings and\n RCU stall reports (local denial of service).\n\nWe must split GC in an unlink and a reclaim phase.\n\nWe cannot queue elements for freeing until pointers have been swapped.\nExpired elements are still exposed to both the packet path and userspace\ndumpers via the live copy of the data structure.\n\ncall_rcu() does not protect us: dump operations or element lookups starting\nafter call_rcu has fired can still observe the free'd element, unless the\ncommit phase has made enough progress to swap the clone and live pointers\nbefore any new reader has picked up the old version.\n\nThis a similar approach as done recently for the rbtree backend in commit\n35f83a75529a (\"netfilter: nft_set_rbtree: don't gc elements on insert\").\n\nFixes: 3c4287f62044 (\"nf_tables: Add set type for arbitrary concatenation of ranges\")\nReported-by: Yiming Qian <yimingqian591@gmail.com>\nSigned-off-by: Florian Westphal <fw@strlen.de>\n(cherry picked from commit 9df95785d3d8302f7c066050117b04cd3c2048c2)\nCVE-2026-23351\nSigned-off-by: Tim Whisonant <tim.whisonant@canonical.com>\n---\n include/net/netfilter/nf_tables.h | 5 +++\n net/netfilter/nf_tables_api.c | 5 ---\n net/netfilter/nft_set_pipapo.c | 51 ++++++++++++++++++++++++++-----\n net/netfilter/nft_set_pipapo.h | 2 ++\n 4 files changed, 50 insertions(+), 13 deletions(-)", "diff": "diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h\nindex 3faa80f5d8019..e40829ee35bd2 100644\n--- a/include/net/netfilter/nf_tables.h\n+++ b/include/net/netfilter/nf_tables.h\n@@ -1836,6 +1836,11 @@ struct nft_trans_gc {\n \tstruct rcu_head\t\trcu;\n };\n \n+static inline int nft_trans_gc_space(const struct nft_trans_gc *trans)\n+{\n+\treturn NFT_TRANS_GC_BATCHCOUNT - trans->count;\n+}\n+\n static inline void nft_ctx_update(struct nft_ctx *ctx,\n \t\t\t\t const struct nft_trans *trans)\n {\ndiff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c\nindex f54c0cb3ad421..ffb1f09299ad4 100644\n--- a/net/netfilter/nf_tables_api.c\n+++ b/net/netfilter/nf_tables_api.c\n@@ -10567,11 +10567,6 @@ static void nft_trans_gc_queue_work(struct nft_trans_gc *trans)\n \tschedule_work(&trans_gc_work);\n }\n \n-static int nft_trans_gc_space(struct nft_trans_gc *trans)\n-{\n-\treturn NFT_TRANS_GC_BATCHCOUNT - trans->count;\n-}\n-\n struct nft_trans_gc *nft_trans_gc_queue_async(struct nft_trans_gc *gc,\n \t\t\t\t\t unsigned int gc_seq, gfp_t gfp)\n {\ndiff --git a/net/netfilter/nft_set_pipapo.c b/net/netfilter/nft_set_pipapo.c\nindex 793790d79d138..4b295b127ed7f 100644\n--- a/net/netfilter/nft_set_pipapo.c\n+++ b/net/netfilter/nft_set_pipapo.c\n@@ -1667,11 +1667,11 @@ static void nft_pipapo_gc_deactivate(struct net *net, struct nft_set *set,\n }\n \n /**\n- * pipapo_gc() - Drop expired entries from set, destroy start and end elements\n+ * pipapo_gc_scan() - Drop expired entries from set and link them to gc list\n * @set:\tnftables API set representation\n * @m:\t\tMatching data\n */\n-static void pipapo_gc(struct nft_set *set, struct nft_pipapo_match *m)\n+static void pipapo_gc_scan(struct nft_set *set, struct nft_pipapo_match *m)\n {\n \tstruct nft_pipapo *priv = nft_set_priv(set);\n \tstruct net *net = read_pnet(&set->net);\n@@ -1684,6 +1684,8 @@ static void pipapo_gc(struct nft_set *set, struct nft_pipapo_match *m)\n \tif (!gc)\n \t\treturn;\n \n+\tlist_add(&gc->list, &priv->gc_head);\n+\n \twhile ((rules_f0 = pipapo_rules_same_key(m->f, first_rule))) {\n \t\tunion nft_pipapo_map_bucket rulemap[NFT_PIPAPO_MAX_FIELDS];\n \t\tconst struct nft_pipapo_field *f;\n@@ -1711,9 +1713,13 @@ static void pipapo_gc(struct nft_set *set, struct nft_pipapo_match *m)\n \t\t * NFT_SET_ELEM_DEAD_BIT.\n \t\t */\n \t\tif (__nft_set_elem_expired(&e->ext, tstamp)) {\n-\t\t\tgc = nft_trans_gc_queue_sync(gc, GFP_KERNEL);\n-\t\t\tif (!gc)\n-\t\t\t\treturn;\n+\t\t\tif (!nft_trans_gc_space(gc)) {\n+\t\t\t\tgc = nft_trans_gc_alloc(set, 0, GFP_KERNEL);\n+\t\t\t\tif (!gc)\n+\t\t\t\t\treturn;\n+\n+\t\t\t\tlist_add(&gc->list, &priv->gc_head);\n+\t\t\t}\n \n \t\t\tnft_pipapo_gc_deactivate(net, set, e);\n \t\t\tpipapo_drop(m, rulemap);\n@@ -1727,10 +1733,30 @@ static void pipapo_gc(struct nft_set *set, struct nft_pipapo_match *m)\n \t\t}\n \t}\n \n-\tgc = nft_trans_gc_catchall_sync(gc);\n+\tpriv->last_gc = jiffies;\n+}\n+\n+/**\n+ * pipapo_gc_queue() - Free expired elements\n+ * @set:\tnftables API set representation\n+ */\n+static void pipapo_gc_queue(struct nft_set *set)\n+{\n+\tstruct nft_pipapo *priv = nft_set_priv(set);\n+\tstruct nft_trans_gc *gc, *next;\n+\n+\t/* always do a catchall cycle: */\n+\tgc = nft_trans_gc_alloc(set, 0, GFP_KERNEL);\n \tif (gc) {\n+\t\tgc = nft_trans_gc_catchall_sync(gc);\n+\t\tif (gc)\n+\t\t\tnft_trans_gc_queue_sync_done(gc);\n+\t}\n+\n+\t/* always purge queued gc elements. */\n+\tlist_for_each_entry_safe(gc, next, &priv->gc_head, list) {\n+\t\tlist_del(&gc->list);\n \t\tnft_trans_gc_queue_sync_done(gc);\n-\t\tpriv->last_gc = jiffies;\n \t}\n }\n \n@@ -1784,6 +1810,10 @@ static void pipapo_reclaim_match(struct rcu_head *rcu)\n *\n * We also need to create a new working copy for subsequent insertions and\n * deletions.\n+ *\n+ * After the live copy has been replaced by the clone, we can safely queue\n+ * expired elements that have been collected by pipapo_gc_scan() for\n+ * memory reclaim.\n */\n static void nft_pipapo_commit(struct nft_set *set)\n {\n@@ -1794,7 +1824,7 @@ static void nft_pipapo_commit(struct nft_set *set)\n \t\treturn;\n \n \tif (time_after_eq(jiffies, priv->last_gc + nft_set_gc_interval(set)))\n-\t\tpipapo_gc(set, priv->clone);\n+\t\tpipapo_gc_scan(set, priv->clone);\n \n \told = rcu_replace_pointer(priv->match, priv->clone,\n \t\t\t\t nft_pipapo_transaction_mutex_held(set));\n@@ -1802,6 +1832,8 @@ static void nft_pipapo_commit(struct nft_set *set)\n \n \tif (old)\n \t\tcall_rcu(&old->rcu, pipapo_reclaim_match);\n+\n+\tpipapo_gc_queue(set);\n }\n \n static void nft_pipapo_abort(const struct nft_set *set)\n@@ -2259,6 +2291,7 @@ static int nft_pipapo_init(const struct nft_set *set,\n \t\tf->mt = NULL;\n \t}\n \n+\tINIT_LIST_HEAD(&priv->gc_head);\n \trcu_assign_pointer(priv->match, m);\n \n \treturn 0;\n@@ -2308,6 +2341,8 @@ static void nft_pipapo_destroy(const struct nft_ctx *ctx,\n \tstruct nft_pipapo *priv = nft_set_priv(set);\n \tstruct nft_pipapo_match *m;\n \n+\tWARN_ON_ONCE(!list_empty(&priv->gc_head));\n+\n \tm = rcu_dereference_protected(priv->match, true);\n \n \tif (priv->clone) {\ndiff --git a/net/netfilter/nft_set_pipapo.h b/net/netfilter/nft_set_pipapo.h\nindex 4a2ff85ce1c43..49000f5510b28 100644\n--- a/net/netfilter/nft_set_pipapo.h\n+++ b/net/netfilter/nft_set_pipapo.h\n@@ -156,12 +156,14 @@ struct nft_pipapo_match {\n * @clone:\tCopy where pending insertions and deletions are kept\n * @width:\tTotal bytes to be matched for one packet, including padding\n * @last_gc:\tTimestamp of last garbage collection run, jiffies\n+ * @gc_head:\tlist of nft_trans_gc to queue up for mem reclaim\n */\n struct nft_pipapo {\n \tstruct nft_pipapo_match __rcu *match;\n \tstruct nft_pipapo_match *clone;\n \tint width;\n \tunsigned long last_gc;\n+\tstruct list_head gc_head;\n };\n \n struct nft_pipapo_elem;\n", "prefixes": [ "SRU", "Q", "1/1" ] }