Article View: linux.kernel.netdev
Article #24802[PATCH net 02/10] netfilter: xt_IDLETIMER: restrict to init_net
From: Pablo Neira Ayuso
Date: Mon, 30 Nov 2026 21:51
Date: Mon, 30 Nov 2026 21:51
55 lines
9878 bytes
9878 bytes
From: Zhiling Zou <zhilinz@nebusec.ai>
IDLETIMER keeps its timer registry, reference counts, and sysfs files in
module-global state, while Xtables invokes checkentry and destroy for
rules in individual network namespaces. A matching label from another
namespace can therefore reuse and control an existing timer.
The sysfs interface is global and cannot represent per-namespace labels
with the current target design. Reject IDLETIMER rules outside init_net
so that global state stays in the namespace it was built for.
Fixes: 0902b469bd25 ("netfilter: xtables: idletimer target implementation")
Cc: stable@vger.kernel.org
Reported-by: Vega <vega@nebusec.ai>
Signed-off-by: Zhiling Zou <zhilinz@nebusec.ai>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
net/netfilter/xt_IDLETIMER.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/net/netfilter/xt_IDLETIMER.c b/net/netfilter/xt_IDLETIMER.c
index 71b78b5da698..2449c091cdf6 100644
--- a/net/netfilter/xt_IDLETIMER.c
+++ b/net/netfilter/xt_IDLETIMER.c
@@ -28,6 +28,7 @@
#include <linux/kobject.h>
#include <linux/workqueue.h>
#include <linux/sysfs.h>
+#include <net/net_namespace.h>
struct idletimer_tg {
struct list_head entry;
@@ -308,6 +309,9 @@ static int idletimer_tg_checkentry(const struct xt_tgchk_param *par)
struct idletimer_tg_info *info = par->targinfo;
int ret;
+ if (!net_eq(par->net, &init_net))
+ return -EOPNOTSUPP;
+
ret = idletimer_tg_helper(info);
if(ret < 0)
return -EINVAL;
@@ -341,6 +345,9 @@ static int idletimer_tg_checkentry_v1(const struct xt_tgchk_param *par)
struct idletimer_tg_info_v1 *info = par->targinfo;
int ret;
+ if (!net_eq(par->net, &init_net))
+ return -EOPNOTSUPP;
+
if (info->send_nl_msg)
return -EOPNOTSUPP;
--
2.47.3
Technical Details
Message-ID:
<20261130215141.1009148-3-pablo@netfilter.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374478-linux-kernel-netdev=dewy.ruReferences:
<20261130215141.1009148-1-pablo@netfilter.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374478-linux-kernel-netdev=dewy.ru From: pablo@netfilter.org (Pablo Neira Ayuso) Newsgroups: linux.kernel.netdev Subject: [PATCH net 02/10] netfilter: xt_IDLETIMER: restrict to init_net Date: Mon, 30 Nov 2026 22:51:33 +0100 Organization: Usenet Network Message-ID: <20261130215141.1009148-3-pablo@netfilter.org> References: <20261130215141.1009148-1-pablo@netfilter.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1547357"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:6B9So9+If5olWAL4pDi1Kiq3g9A= sha256:c6tJmFiY0/ML9fBq95LazDBjqSakYY5MzRleEdPNKEk= sha1:AuPxO/1mmxp8v6Rx1wvPlZQ6WDc= sha256:WAovW7m8MFY8BxKXiBgEkCmUQxpPt24G3Xlu02QH9PY= 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 1B435126010; Tue, 1 Dec 2026 00:52:14 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.151 X-Spam-Status: No, score=-3.151 tagged_above=-9999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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 (2048-bit key) header.d=netfilter.org 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 fgbeJpOVqIQy; Tue, 1 Dec 2026 00:52:11 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-374478-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=netfilter.org X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 4CD62126013; Tue, 1 Dec 2026 00:52:02 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 7013B28E2C; Mon, 30 Nov 2026 21:51:56 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail; t=1796075512; b=4EvjeITWE7wEqvqwMgPhjsA+7jVBP/tbSW4oNDoC1k9/xOYzw5fNds4Brz+BNYw5QicM RFG6c502RYlcdCktNNpbt2zvRVQrpbPhLyh6jXEYkT8bKsJ53JvvdvwcVT3fyl5HFKnHH DrWOYetxdwFJkwyhijWsJQSRgYyGrGp2WNX1fhLcW5WIe6OMiU30rGWDUAh9g3ve+kAQk EeDxEYhbdR2TSTRjZ2CDruGwbAyhPLRq5oLrMKKAkaZd8A9XtUfUCi8gbIP4FXuqeY8KF /msQMWI9dP73zyq47J0/jcH1KL5tF+oh45ZBL6uIT8m2ARoHIL4QfGrs6lpx0lTmBWg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796075512; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:From:To: Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding; bh=3Lnc49AWQMCmdTsSXfhTvcnoOYTRqlTkDMKMjTZIfZ8=; b=HF7qx9uNxp8sXoFQ8A5vlOFsaLtmTflY6hPjEMjU+etHo9N/r5J4mXKWtxf0vfRCSdLx NJslfIYqUP8eh02KbppglppYeWaP95nQiQoE3tpsurn+HG0iDvQZHyasZPkTHj6tNZ+yU 7rnCnQlX2Czy9xkZIXC2fq1gSfGkWvvrWbRZTHoAINLmViy980CPu/aP5iokrfXRnoIp5 JMgrPHW84FOQbSpsikduFYjYYu7lfzgA68fi6oFO3ecBMFgczvLpqlHvjR4Q4bsSPDfuz T9ppsnCJeLB7zMHmP0oNMzPKOLRderOeoK/6NbMwcwtzz9Nee8tRy03EwhY9ZqzaIWw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=netfilter.org header.i=@netfilter.org header.a=rsa-sha256 header.s=2025 header.b=X4m0PBhg; dmarc=none header.from=netfilter.org; spf=pass smtp.mailfrom=netfilter.org; arc=fail smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BB0B4606A329; Mon, 30 Nov 2026 21:51:52 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=netfilter.org header.i=@netfilter.org header.a=rsa-sha256 header.s=2025 header.b=X4m0PBhg X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=217.70.190.124 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796075511; b=mkKH0LNW9WDfq3p6S62iLt796EZWwW13BANvfoKy93oYfaHVhO8/yOgWTRRs98GjvGXg JvpaVw4Bh32Z+gK6hHpIKpdidYUlraIRS0s+y/GYUif87h2jcaktER4U4fOHYB3em563E 48UUtghsm+EeNm1XuofhRVUc0rEJT+Pzw51UrxRiNEmd5v9HO9Tb8oDl+l00UHOKvznL2 iIf2+NkAE/1PlhQCyu30H5VauNnLBz6GhIdZRjmbqbsvZk5OflKShR29CYD5oqmzR9YY6 JhVsTlQtiYAXqKyfwzUHEWCqKVluSYK7r6TJbUpEV9yHNHNFuLzkoxTYNbhOVFKMdhw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796075511; h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Spam-Status:X-Spam-Checker-Version; bh=3Lnc49AWQMCmdTsSXfhTvcnoOYTRqlTkDMKMjTZIfZ8=; b=KxyJdsgnR24q01fCcmAKUtbhWGJjsdzArP3cfXwYujCZdKFhDym/fz6auiWf0FqKEBpZ 6cDS03YhvNf7oB8C0x3e5CgAYNCOhb9eV84tX2kMdGCELkIwUYBWYOGyN6eNetLWdQBwv xjNEQnsmoe3mODssmxeBeGcuMcgtVy/X9jfBZIYcjhwUpTDyB9hFJvES4ok3al870NVW/ iorqKvgtkqva8mHS1YouQWCEsCwxDCoSHfQtzwAwgPhzErwd2X28HquIRHlsYZMhy2sHB OAO+cDncbvqCsWI5ILluXUdKt9qHDDgLTlXJkf+jNog04K86Vpy9tN6anysOPzyC+6w== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=netfilter.org; spf=pass smtp.mailfrom=netfilter.org; dkim=pass header.d=netfilter.org header.i=@netfilter.org header.a=rsa-sha256 header.s=2025 header.b=X4m0PBhg; arc=none smtp.remote-ip=217.70.190.124 X-Received: from mail.netfilter.org (mail.netfilter.org [217.70.190.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73961606A680; Mon, 30 Nov 2026 21:51:50 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 73961606A680 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=netfilter.org X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netfilter.org; s=2025; t=1796075509; bh=3Lnc49AWQMCmdTsSXfhTvcnoOYTRqlTkDMKMjTZIfZ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X4m0PBhgncbn9nZymmnRsmEGlAO9nU8/amXOwB+ev0KDMRkPVDLs7SFn6ozTULJs9 UlxUZ9si0dXDEbmbixjdG+PW/sNlUjsWmyjWgwj529Anwhke29Goy4O3niCozmzLmn iSb5dOycD6qnztVDDQxXc5PzuY77y+0an91IqIcqIyufv7Zd3ikeHQlHheHJ/EnJcr 2pr9yWjb9M9Sfohujd2tCBp8ZrUoqtGQIgapEUEKY24JOlZms8FcuO8oXjgKqqc9hS WdsC1lW+xZgG6kzVCXZlU8FLezxIEdNZGcWoGuSQEuNkeGOof5jWrryWxxnHun1Aao MI3cOghCCXEfA== X-Received: from localhost.localdomain (mail-agni [217.70.190.124]) by mail.netfilter.org (Postfix) with ESMTPSA id 9F93C60060; Mon, 30 Nov 2026 22:51:48 +0100 (CET) X-Cc: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org, pabeni@redhat.com, edumazet@kernel.org, horms@kernel.org, fw@strlen.de, ja@ssi.bg X-Mailer: git-send-email 2.47.3 X-In-Reply-To: <20261130215141.1009148-1-pablo@netfilter.org> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list