From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Florian Westphal <fw@strlen.de>, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf] netfilter: nf_tables: validate family when identifying table via handle
Date: Tue, 5 Dec 2023 14:10:40 +0100 [thread overview]
Message-ID: <ZW8hUKEizy9bNbML@orbyte.nwl.cc> (raw)
In-Reply-To: <ZW3cuXX5H55V3xUN@calendula>
On Mon, Dec 04, 2023 at 03:05:45PM +0100, Pablo Neira Ayuso wrote:
> On Mon, Dec 04, 2023 at 03:03:41PM +0100, Florian Westphal wrote:
> > Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > > Validate table family when looking up for it via NFTA_TABLE_HANDLE.
> > >
> > > Reported-by: Xingyuan Mo <hdthky0@gmail.com>
> > > Fixes: 3ecbfd65f50e ("netfilter: nf_tables: allocate handle and delete objects via handle")
> > > Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
> > > ---
> > > net/netfilter/nf_tables_api.c | 5 +++--
> > > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > This changes behaviour, before this change you can do
> >
> > nft delete table handle 42
> >
> > and it will delete the table with handle 42.
>
> Default family is 'ip' if not specified, that is inconsistent with
> other objects?
I would say the table's handle is a complete replacement of its family
and name, also because it's pernet-unique. Though looking at the docs,
we surprisingly claim to support:
| delete table [<family>] handle <handle>
So either we accept user space is wrong and the family value doesn't
matter there or we artificially limit table lookup by handle to the
given family. IMHO either way kind of breaks user space.
Off-topic here, but I would prefer for all handles to be pernet-unique
so user space could 'nft delete <whatever> handle <handle>'. Why was a
table-unique value chosen here?
Cheers, Phil
next prev parent reply other threads:[~2023-12-05 13:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-04 13:54 [PATCH nf] netfilter: nf_tables: validate family when identifying table via handle Pablo Neira Ayuso
2023-12-04 14:03 ` Florian Westphal
2023-12-04 14:05 ` Pablo Neira Ayuso
2023-12-05 13:10 ` Phil Sutter [this message]
2023-12-05 14:17 ` Pablo Neira Ayuso
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=ZW8hUKEizy9bNbML@orbyte.nwl.cc \
--to=phil@nwl.cc \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/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.