From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Avinash Duduskar <avinash.duduskar@gmail.com>
Cc: Phil Sutter <phil@nwl.cc>, Florian Westphal <fw@strlen.de>,
netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nft] datatype: accept a numeric cgroupsv2 id on input
Date: Tue, 28 Jul 2026 22:31:16 +0200 [thread overview]
Message-ID: <amkRlAy1nz2KMx5N@chamomile> (raw)
In-Reply-To: <20260728201909.1773000-1-avinash.duduskar@gmail.com>
On Wed, Jul 29, 2026 at 01:49:09AM +0530, Avinash Duduskar wrote:
> On Tue, Jul 28, 2026 at 09:16:54PM +0200, Pablo Neira Ayuso wrote:
> > On Tue, Jul 28, 2026 at 06:19:25PM +0200, Phil Sutter wrote:
> > > So with nft printing non-existent cgroup names using PRIu64 and parsing
> > > code still performs the path lookup first, what is all the fuss about
> > > non-decimal number input?
> >
> > They claim they cannot delete entries via numeric value, it seems.
>
> Correct, the earlier example proves it.
>
> A typo'd id can collide with a live inode and then list as another
> cgroup's path. Fine with dropping the checks if you prefer.
>
> > > Is this AI output?
>
> Yes. Point taken on the length.
>
> > > Can't this just be something like (untested):
> > > [...]
>
> Yes. v2, keeping the two checks:
>
> if (stat(cgroupv2_path, &st) == 0) {
> ino = st.st_ino;
> } else if (isdigit((unsigned char)sym->identifier[0])) {
> char *end;
>
> errno = 0;
> ino = strtoull(sym->identifier, &end, 10);
> if (*end != '\0' || errno == ERANGE)
> return error(&sym->location, "invalid cgroupv2 id");
> } else {
> return error(&sym->location, "cgroupv2 path fails: %s",
> strerror(errno));
> }
Did you consider to parse this via integer_parse() for consistency?
Thanks.
next prev parent reply other threads:[~2026-07-28 20:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 8:24 [PATCH nft] datatype: accept a numeric cgroupsv2 id on input Avinash Duduskar
2026-07-28 16:19 ` Phil Sutter
2026-07-28 19:16 ` Pablo Neira Ayuso
2026-07-28 20:19 ` Avinash Duduskar
2026-07-28 20:31 ` Pablo Neira Ayuso [this message]
2026-07-28 20:55 ` Avinash Duduskar
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=amkRlAy1nz2KMx5N@chamomile \
--to=pablo@netfilter.org \
--cc=avinash.duduskar@gmail.com \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=phil@nwl.cc \
/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.