From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf] netfilter: nf_tables: validate family when identifying table via handle
Date: Mon, 4 Dec 2023 15:05:45 +0100 [thread overview]
Message-ID: <ZW3cuXX5H55V3xUN@calendula> (raw)
In-Reply-To: <20231204140341.GC29636@breakpoint.cc>
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?
> After this change, the command will only work if this table happens
> to be in 'ip' family.
>
> > - table = nft_table_lookup_byhandle(net, attr, genmask,
> > + table = nft_table_lookup_byhandle(net, attr, family, genmask,
> > NETLINK_CB(skb).portid);
>
> Perhaps leave as-is and:
> if (!IS_ERR(table))
> family = table->family?
>
> (or ctx.family =, but then the strange ctx.family assignment at end
> of function needs to go).
next prev parent reply other threads:[~2023-12-04 14:05 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 [this message]
2023-12-05 13:10 ` Phil Sutter
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=ZW3cuXX5H55V3xUN@calendula \
--to=pablo@netfilter.org \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.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.