All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH nf 0/4] nftables: Consistently report partial and entire set overlaps
@ 2020-03-05 20:33 Stefano Brivio
  2020-03-05 20:33 ` [PATCH nf 1/4] nf_tables: Allow set back-ends to report partial overlaps on insertion Stefano Brivio
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Stefano Brivio @ 2020-03-05 20:33 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Phil Sutter, netfilter-devel

Phil reports that inserting an element, that includes a concatenated
range colliding with an existing one, fails silently.

This is because so far set back-ends have no way to tell apart cases
of identical elements being inserted from clashing elements. On
insertion, the front-end would strip -EEXIST if NLM_F_EXCL is not
passed, so we return success to userspace while an error in fact
occurred.

As suggested by Pablo, allow back-ends to return -ENOTEMPTY in case
of partial overlaps, with patch 1/4. Then, with patches 2/4 to 4/4,
update nft_set_pipapo and nft_set_rbtree to report partial overlaps
using the new error code.

Stefano Brivio (4):
  nf_tables: Allow set back-ends to report partial overlaps on insertion
  nft_set_pipapo: Separate partial and complete overlap cases on
    insertion
  nft_set_rbtree: Introduce and use nft_rbtree_interval_start()
  nft_set_rbtree: Detect partial overlaps on insertion

 net/netfilter/nf_tables_api.c  |  5 ++
 net/netfilter/nft_set_pipapo.c | 34 +++++++++++---
 net/netfilter/nft_set_rbtree.c | 85 ++++++++++++++++++++++++++++++----
 3 files changed, 108 insertions(+), 16 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-03-19 20:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-05 20:33 [PATCH nf 0/4] nftables: Consistently report partial and entire set overlaps Stefano Brivio
2020-03-05 20:33 ` [PATCH nf 1/4] nf_tables: Allow set back-ends to report partial overlaps on insertion Stefano Brivio
2020-03-05 20:33 ` [PATCH nf 2/4] nft_set_pipapo: Separate partial and complete overlap cases " Stefano Brivio
2020-03-05 20:33 ` [PATCH nf 3/4] nft_set_rbtree: Introduce and use nft_rbtree_interval_start() Stefano Brivio
2020-03-05 20:33 ` [PATCH nf 4/4] nft_set_rbtree: Detect partial overlaps on insertion Stefano Brivio
2020-03-19 19:32   ` Pablo Neira Ayuso
2020-03-19 20:49     ` Stefano Brivio

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.