Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2235199/?format=api
{ "id": 2235199, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2235199/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260508205903.10238-8-kadlec@netfilter.org/", "project": { "id": 26, "url": "http://patchwork.ozlabs.org/api/1.2/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": "<20260508205903.10238-8-kadlec@netfilter.org>", "list_archive_url": null, "date": "2026-05-08T20:59:02", "name": "[v6,7/8] netfilter: ipset: skip gc when resize is in progress", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "ec363041334ffbf7acd1da542ccf92629678fc4a", "submitter": { "id": 77226, "url": "http://patchwork.ozlabs.org/api/1.2/people/77226/?format=api", "name": "Jozsef Kadlecsik", "email": "kadlec@netfilter.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260508205903.10238-8-kadlec@netfilter.org/mbox/", "series": [ { "id": 503447, "url": "http://patchwork.ozlabs.org/api/1.2/series/503447/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=503447", "date": "2026-05-08T20:58:57", "name": "netfilter: ipset fixes", "version": 6, "mbox": "http://patchwork.ozlabs.org/series/503447/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2235199/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2235199/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <netfilter-devel+bounces-12509-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=blackhole.kfki.hu header.i=@blackhole.kfki.hu\n header.a=rsa-sha256 header.s=20151130 header.b=VBrPWrIY;\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-12509-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=blackhole.kfki.hu\n header.i=@blackhole.kfki.hu header.b=\"VBrPWrIY\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=148.6.0.51", "smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=netfilter.org", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=blackhole.kfki.hu" ], "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 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4gC1pM2RzSz1yK7\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 09 May 2026 07:04:43 +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 3212C303F28B\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 8 May 2026 21:04:22 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 5D2C042314C;\n\tFri, 8 May 2026 21:04:21 +0000 (UTC)", "from smtp-out.kfki.hu (smtp-out.kfki.hu [148.6.0.51])\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 3A4F2372ED6\n\tfor <netfilter-devel@vger.kernel.org>; Fri, 8 May 2026 21:04:19 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby smtp2.kfki.hu (Postfix) with ESMTP id 4gC1gw31NLz7s863;\n\tFri, 8 May 2026 22:59:08 +0200 (CEST)", "from smtp2.kfki.hu ([127.0.0.1])\n by localhost (smtp2.kfki.hu [127.0.0.1]) (amavis, port 10026) with ESMTP\n id cwW-czt_Qx9I; Fri, 8 May 2026 22:59:06 +0200 (CEST)", "from mentat.rmki.kfki.hu (254C131D.nat.pool.telekom.hu\n [37.76.19.29])\n\t(Authenticated sender: kadlecsik.jozsef@wigner.hu)\n\tby smtp2.kfki.hu (Postfix) with ESMTPSA id 4gC1gs1l4Yz7s864;\n\tFri, 8 May 2026 22:59:05 +0200 (CEST)", "by mentat.rmki.kfki.hu (Postfix, from userid 1000)\n\tid 05BCC141ED1; Fri, 8 May 2026 22:59:04 +0200 (CEST)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1778274260; cv=none;\n b=TsH2HQXJMXrS4sqiWiGD54AWavhYZqEezTGm2SXhqRa6orXmYcL7qdY+893hwMdNVSQ3n9KtEn4RKnpTOHdNZ/uTVAp1NdptENvs7feAfuHQjJ1P4+x8hm82NXoZkKQVFBq2wAkjjD8NFyvDk9MpybSP74LgtakpT1JIIVF9Tkk=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1778274260; c=relaxed/simple;\n\tbh=91z/RSxDy3sYGkJq5ng7B3vpyUG2K0GJSt3zBKRfBkg=;\n\th=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:\n\t MIME-Version;\n b=Ul5MXG4/zwTdU+JKcQydUDI3w1B2ftzleDpHPBRgASuydYDvPks+KWTPGYWK6Da8Ajk1ip3TqvxVbpVzYgofATAwn0aACCnYJ0WnMgT4F2obcoMNBZwNXexMryP3MO6ahkj8IjuJpxfSxwXKvK2GML/vyncjVtIhqzGgKUSYkUU=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=netfilter.org;\n spf=pass smtp.mailfrom=blackhole.kfki.hu;\n dkim=pass (1024-bit key) header.d=blackhole.kfki.hu\n header.i=@blackhole.kfki.hu header.b=VBrPWrIY;\n arc=none smtp.client-ip=148.6.0.51", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n\tblackhole.kfki.hu; h=mime-version:references:in-reply-to\n\t:x-mailer:message-id:date:date:from:from:received:received\n\t:received; s=20151130; t=1778273946; x=1780088347; bh=RRrMIYqUbp\n\teFzzD4DBUfXMMBFzNX+/w2F9sE/pdnVF4=; b=VBrPWrIYB7JRen93gWAF6Bj7P+\n\tfgEQZidC31yz0fyXByO/acyaAoM81hAWJm1Dfdn5bleYiVYSe8hvujNu+FkQj1++\n\tymYCBr+HcvccLkl7ObTsCTg1waXXe1yDA8T8JvLPKsSMQPHdHJCEYtD7eJOeFqWD\n\tWeslUsq+kvQDkOaIw=", "X-Virus-Scanned": "Debian amavis at smtp2.kfki.hu", "From": "Jozsef Kadlecsik <kadlec@netfilter.org>", "To": "netfilter-devel@vger.kernel.org", "Cc": "Pablo Neira Ayuso <pablo@netfilter.org>", "Subject": "[PATCH v6 7/8] netfilter: ipset: skip gc when resize is in progress", "Date": "Fri, 8 May 2026 22:59:02 +0200", "Message-Id": "<20260508205903.10238-8-kadlec@netfilter.org>", "X-Mailer": "git-send-email 2.39.5", "In-Reply-To": "<20260508205903.10238-1-kadlec@netfilter.org>", "References": "<20260508205903.10238-1-kadlec@netfilter.org>", "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", "X-deepspam": "maybeham 3%", "Content-Transfer-Encoding": "quoted-printable" }, "content": "Zhengchuan Liang reported that because resize does not copy\nthe comment extension into the resized set but uses it's pointer,\nongoing gc can free the extension in the original set which then\nresults stale pointer in the resized one. The proposed patch was\nto recreate the extensions for every element in the resized set.\nIt is both expensive and wastes memory, so better skip gc\nwhen resizing in progress detected: resizing will destroy\nthe original set anyway, so doing gc on it unnecessary.\n\nReported by: Zhengchuan Liang <zcliangcn@gmail.com>\nSigned-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>\n---\n net/netfilter/ipset/ip_set_hash_gen.h | 8 +++++++-\n 1 file changed, 7 insertions(+), 1 deletion(-)", "diff": "diff --git a/net/netfilter/ipset/ip_set_hash_gen.h b/net/netfilter/ipset/ip_set_hash_gen.h\nindex 377b4be9e4d5..71b57c731dcb 100644\n--- a/net/netfilter/ipset/ip_set_hash_gen.h\n+++ b/net/netfilter/ipset/ip_set_hash_gen.h\n@@ -501,6 +501,8 @@ mtype_gc_do(struct ip_set *set, struct htype *h, struct htable *t, u32 r)\n \t\t\tcontinue;\n \t\tpos = smp_load_acquire(&n->pos);\n \t\tfor (j = 0, d = 0; j < pos; j++) {\n+\t\t\tif (atomic_read(&t->ref))\n+\t\t\t\tgoto resize_in_progress;\n \t\t\tif (!test_bit(j, n->used)) {\n \t\t\t\td++;\n \t\t\t\tcontinue;\n@@ -552,6 +554,7 @@ mtype_gc_do(struct ip_set *set, struct htype *h, struct htable *t, u32 r)\n \t\t\tkfree_rcu(n, rcu);\n \t\t}\n \t}\n+resize_in_progress:\n \tspin_unlock_bh(&t->hregion[r].lock);\n }\n \n@@ -672,7 +675,10 @@ mtype_resize(struct ip_set *set, bool retried)\n \t\tspin_lock_init(&t->hregion[i].lock);\n \n \t/* There can't be another parallel resizing,\n-\t * but dumping, gc, kernel side add/del are possible\n+\t * but dumping, kernel side add/del are possible.\n+\t * gc must detect ongoing resize when comments are in use\n+\t * in order not to free the comment extension area shared\n+\t * between the original and resized sets.\n \t */\n \torig = ipset_dereference_bh_nfnl(h->table);\n \tatomic_set(&orig->ref, 1);\n", "prefixes": [ "v6", "7/8" ] }