From: Haoze Xie <royenheart@gmail.com>
To: Florian Westphal <fw@strlen.de>, Ren Wei <n05ec@lzu.edu.cn>
Cc: netfilter-devel@vger.kernel.org, pablo@netfilter.org,
phil@nwl.cc, luciano.coelho@nokia.com, kaber@trash.net,
yuantan098@gmail.com, yifanwucs@gmail.com,
tomapufckgml@gmail.com, bird@lzu.edu.cn, royenheart@gmail.com
Subject: Re: [PATCH nf 1/1] netfilter: xt_IDLETIMER: scope timer reuse to the owning netns
Date: Fri, 15 May 2026 09:54:35 +0800 [thread overview]
Message-ID: <b15744af-c026-4d35-9a23-5d4ac39e1da8@gmail.com> (raw)
In-Reply-To: <agWhUUyIy4JZlVlq@strlen.de>
On 5/14/2026 6:17 PM, Florian Westphal wrote:
> Ren Wei <n05ec@lzu.edu.cn> wrote:
>> From: Haoze Xie <royenheart@gmail.com>
>>
>> IDLETIMER keeps timers in a module-global list and reuses them
>> solely by label text.
>>
>> The existing rev0 ALARM guard avoids the panic when rev0 reuses
>> a rev1 ALARM timer from another netns, but it still lets same
>> labels in different netns share the same timer object and the
>> same sysfs entry.
>
> Isn't that by design?
My patch was based on the premise here: I treated this as a
namespace-isolation bug and tried to enforce per-netns label ownership,
but that is not how xt_IDLETIMER is defined today.
>
>> Track the owning netns in struct idletimer_tg and only reuse
>> timers when both the label and netns match. For non-init_net
>> timers, derive a namespace-scoped sysfs name from the netns
>> inode so non-init namespaces no longer collide in the global
>> xt_idletimer sysfs directory.
>
> How can that work? How would userspace daemon relize that the
> name has changed?
My proposed sysfs renaming for non-init_net users would introduce
userspace-visible semantic changes, and I did not justify how existing
userspace would discover or adapt to the renamed entries.
>
>> This keeps init_net sysfs paths unchanged for ABI compatibility
>> and preserves same-netns label reuse, while preventing the
>> cross-netns timer-object aliasing that caused refcount, expiry,
>> and teardown interference.
>
> I don't think there is a bug here. Two netns using same
> files having same sysfs mount should naturally "conflict".
>
> Maybe one could make a patch to force-detach an idletime
> in a non-init userns if init userns asks for "foo" that
> is already claimed by different userns (to avoid the "Dos"
> angle).
>
> But I'm not sure its worth it.
Thanks for the suggestion. We may experiment it later, but for now we
decided to scratch this patch since it didn't reproduces the more
severe behavior.
prev parent reply other threads:[~2026-05-15 1:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1775353240.git.royenheart@gmail.com>
2026-05-14 4:05 ` [PATCH nf 1/1] netfilter: xt_IDLETIMER: scope timer reuse to the owning netns Ren Wei
2026-05-14 10:17 ` Florian Westphal
2026-05-15 1:54 ` Haoze Xie [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b15744af-c026-4d35-9a23-5d4ac39e1da8@gmail.com \
--to=royenheart@gmail.com \
--cc=bird@lzu.edu.cn \
--cc=fw@strlen.de \
--cc=kaber@trash.net \
--cc=luciano.coelho@nokia.com \
--cc=n05ec@lzu.edu.cn \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=phil@nwl.cc \
--cc=tomapufckgml@gmail.com \
--cc=yifanwucs@gmail.com \
--cc=yuantan098@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.