From: Florian Westphal <fw@strlen.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf-next 4/4] netfilter: nft_set_rbtree: validate open interval overlap
Date: Fri, 30 Jan 2026 13:34:57 +0100 [thread overview]
Message-ID: <aXylcZ53xTI3Gp4Q@strlen.de> (raw)
In-Reply-To: <20260128014251.754512-5-pablo@netfilter.org>
Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> Open intervals do not have an end element, in particular an open
> interval at the end of the set is hard to validate because of it is
> lacking the end element, and interval validation relies on such end
> element to perform the checks.
>
> This patch adds a new flag field to struct nft_set_elem, this is not an
> issue because this is a temporary object that is allocated in the stack
> from the insert/deactivate path. This flag field is used to specify that
> this is the last element in this add/delete command.
>
> The last flag is used, in combination with the start element cookie, to
> check if there is a partial overlap, eg.
>
> Already exists: 255.255.255.0-255.255.255.254
> Add interval: 255.255.255.0-255.255.255.255
> ~~~~~~~~~~~~~
> start element overlap
>
> Basically, the idea is to check for an existing end element in the set
> if there is an overlap with an existing start element.
This patch causes:
W: [FAILED] 1/1 tests/shell/testcases/maps/named_limits
It passes without this patch.
I pushed a minor change to the test to ease debugging, failing command
is:
FAIL: Command add saddr6limit { c01a::/64 : "tarpit-bps" } failed
and the map is:
map saddr6limit {
typeof ip6 saddr : limit
flags interval
elements = { dead::beef-dead::1:aced : "tarpit-pps",
fee1::dead : "tarpit-pps" }
}
I don't think this should fail?
next prev parent reply other threads:[~2026-01-30 12:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-28 1:42 [PATCH nf-next 0/4] nf_tables: complete interval overlap detection Pablo Neira Ayuso
2026-01-28 1:42 ` [PATCH nf-next 1/4] netfilter: nft_set_rbtree: fix bogus EEXIST with NLM_F_CREATE with null interval Pablo Neira Ayuso
2026-01-28 1:42 ` [PATCH nf-next 2/4] netfilter: nft_set_rbtree: check for partial overlaps in anonymous sets Pablo Neira Ayuso
2026-01-28 1:42 ` [PATCH nf-next 3/4] netfilter: nft_set_rbtree: validate element belonging to interval Pablo Neira Ayuso
2026-01-28 1:42 ` [PATCH nf-next 4/4] netfilter: nft_set_rbtree: validate open interval overlap Pablo Neira Ayuso
2026-01-30 12:34 ` Florian Westphal [this message]
2026-01-28 15:45 ` [PATCH nf-next 0/4] nf_tables: complete interval overlap detection Florian Westphal
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=aXylcZ53xTI3Gp4Q@strlen.de \
--to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox