From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=217.70.190.124 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== 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== 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 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) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 73961606A680 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=netfilter.org 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 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== 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) From: Pablo Neira Ayuso To: netfilter-devel@vger.kernel.org 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 Subject: [PATCH net 02/10] netfilter: xt_IDLETIMER: restrict to init_net Date: Mon, 30 Nov 2026 22:51:33 +0100 Message-ID: <20261130215141.1009148-3-pablo@netfilter.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261130215141.1009148-1-pablo@netfilter.org> References: <20261130215141.1009148-1-pablo@netfilter.org> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Zhiling Zou 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 Signed-off-by: Zhiling Zou Signed-off-by: Pablo Neira Ayuso --- 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 #include #include +#include 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