* [PATCH net 0/2] Netfilter fixes for net
@ 2021-02-09 21:35 Pablo Neira Ayuso
0 siblings, 0 replies; 29+ messages in thread
From: Pablo Neira Ayuso @ 2021-02-09 21:35 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba
Hi,
The following patchset contains Netfilter fixes for net:
1) nf_conntrack_tuple_taken() needs to recheck zone for
NAT clash resolution, from Florian Westphal.
2) Restore support for stateful expressions when set definition
specifies no stateful expressions.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git
Thanks!
----------------------------------------------------------------
The following changes since commit ce7536bc7398e2ae552d2fabb7e0e371a9f1fe46:
vsock/virtio: update credit only if socket is not closed (2021-02-08 13:27:46 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git HEAD
for you to fetch changes up to 664899e85c1312e51d2761e7f8b2f25d053e8489:
netfilter: nftables: relax check for stateful expressions in set definition (2021-02-09 00:50:14 +0100)
----------------------------------------------------------------
Florian Westphal (1):
netfilter: conntrack: skip identical origin tuple in same zone only
Pablo Neira Ayuso (1):
netfilter: nftables: relax check for stateful expressions in set definition
net/netfilter/nf_conntrack_core.c | 3 ++-
net/netfilter/nf_tables_api.c | 28 +++++++++++++++-------------
2 files changed, 17 insertions(+), 14 deletions(-)
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH net 0/2] Netfilter fixes for net
@ 2021-06-02 12:44 Pablo Neira Ayuso
0 siblings, 0 replies; 29+ messages in thread
From: Pablo Neira Ayuso @ 2021-06-02 12:44 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba
Hi,
The following patchset contains Netfilter fixes for net:
1) Do not allow to add conntrack helper extension for confirmed
conntracks in the nf_tables ct expectation support.
2) Fix bogus EBUSY in nfnetlink_cthelper when NFCTH_PRIV_DATA_LEN
is passed on userspace helper updates.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git
Thank you!
----------------------------------------------------------------
The following changes since commit b000372627ce9dbbe641dafbf40db0718276ab77:
MAINTAINERS: nfc mailing lists are subscribers-only (2021-06-01 17:09:28 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git HEAD
for you to fetch changes up to 8971ee8b087750a23f3cd4dc55bff2d0303fd267:
netfilter: nfnetlink_cthelper: hit EBUSY on updates if size mismatches (2021-06-02 12:43:50 +0200)
----------------------------------------------------------------
Pablo Neira Ayuso (2):
netfilter: nft_ct: skip expectations for confirmed conntrack
netfilter: nfnetlink_cthelper: hit EBUSY on updates if size mismatches
net/netfilter/nfnetlink_cthelper.c | 8 ++++++--
net/netfilter/nft_ct.c | 2 +-
2 files changed, 7 insertions(+), 3 deletions(-)
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH net 0/2] Netfilter fixes for net
@ 2022-04-05 10:09 Pablo Neira Ayuso
0 siblings, 0 replies; 29+ messages in thread
From: Pablo Neira Ayuso @ 2022-04-05 10:09 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba
Hi,
The following patchset contains Netfilter fixes for net:
1) Incorrect comparison in bitmask .reduce, from Jeremy Sowden.
2) Missing GFP_KERNEL_ACCOUNT for dynamically allocated objects,
from Vasily Averin.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git
Thanks.
----------------------------------------------------------------
The following changes since commit ad7da1ce5749c0eb4f09dd7e5510123be56f10fb:
net: lan966x: fix kernel oops on ioctl when I/F is down (2022-03-29 10:47:24 +0200)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git HEAD
for you to fetch changes up to 42193ffd79bd3acd91bd947e53f3548a3661d0a1:
netfilter: nf_tables: memcg accounting for dynamically allocated objects (2022-04-05 11:55:46 +0200)
----------------------------------------------------------------
Jeremy Sowden (1):
netfilter: bitwise: fix reduce comparisons
Vasily Averin (1):
netfilter: nf_tables: memcg accounting for dynamically allocated objects
net/netfilter/nf_tables_api.c | 2 +-
net/netfilter/nft_bitwise.c | 4 ++--
net/netfilter/nft_connlimit.c | 2 +-
net/netfilter/nft_counter.c | 2 +-
net/netfilter/nft_last.c | 2 +-
net/netfilter/nft_limit.c | 2 +-
net/netfilter/nft_quota.c | 2 +-
7 files changed, 8 insertions(+), 8 deletions(-)
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH net 0/2] Netfilter fixes for net
@ 2022-04-12 9:42 Pablo Neira Ayuso
0 siblings, 0 replies; 29+ messages in thread
From: Pablo Neira Ayuso @ 2022-04-12 9:42 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba
Hi,
The following patchset contains Netfilter fixes for net:
1) Fix cgroupv2 from the input path, from Florian Westphal.
2) Fix incorrect return value of nft_parse_register(), from Antoine Tenart.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git
Thanks.
----------------------------------------------------------------
The following changes since commit e8a64bbaaad1f6548cec5508297bc6d45e8ab69e:
net/sched: taprio: Check if socket flags are valid (2022-04-11 10:51:00 +0100)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git HEAD
for you to fetch changes up to 6c6f9f31ecd47dce1d0dafca4bec8805f9bc97cd:
netfilter: nf_tables: nft_parse_register can return a negative value (2022-04-12 11:36:37 +0200)
----------------------------------------------------------------
Antoine Tenart (1):
netfilter: nf_tables: nft_parse_register can return a negative value
Florian Westphal (1):
netfilter: nft_socket: make cgroup match work in input too
net/netfilter/nf_tables_api.c | 2 +-
net/netfilter/nft_socket.c | 7 +++----
2 files changed, 4 insertions(+), 5 deletions(-)
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH net 0/2] Netfilter fixes for net
@ 2022-05-26 20:54 Pablo Neira Ayuso
0 siblings, 0 replies; 29+ messages in thread
From: Pablo Neira Ayuso @ 2022-05-26 20:54 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba, pabeni
Hi,
The following patchset contains Netfilter fixes for net:
1) Fix UAF when creating non-stateful expression in set.
2) Set limit cost when cloning expression accordingly, from Phil Sutter.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git
Thanks.
----------------------------------------------------------------
The following changes since commit 6c465408a7709cf180cde7569e141191b67a175c:
dt-bindings: net: adin: Fix adi,phy-output-clock description syntax (2022-05-25 22:03:45 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git HEAD
for you to fetch changes up to 558254b0b602b8605d7246a10cfeb584b1fcabfc:
netfilter: nft_limit: Clone packet limits' cost value (2022-05-26 22:50:34 +0200)
----------------------------------------------------------------
Pablo Neira Ayuso (1):
netfilter: nf_tables: disallow non-stateful expression in sets earlier
Phil Sutter (1):
netfilter: nft_limit: Clone packet limits' cost value
net/netfilter/nf_tables_api.c | 19 ++++++++++---------
net/netfilter/nft_limit.c | 2 ++
2 files changed, 12 insertions(+), 9 deletions(-)
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH net 0/2] Netfilter fixes for net
@ 2022-07-02 19:10 Pablo Neira Ayuso
0 siblings, 0 replies; 29+ messages in thread
From: Pablo Neira Ayuso @ 2022-07-02 19:10 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba, pabeni, edumazet
Hi,
The following patchset contains Netfilter fixes for net:
1) Insufficient validation of element datatype and length in
nft_setelem_parse_data(). At least commit 7d7402642eaf updates
maximum element data area up to 64 bytes when only 16 bytes
where supported at the time. Support for larger element size
came later in fdb9c405e35b though. Picking this older commit
as Fixes: tag to be safe than sorry.
2) Memleak in pipapo destroy path, reproducible when transaction
in aborted. This is already triggering in the existing netfilter
test infrastructure since more recent new tests are covering this
path.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git
Thanks.
----------------------------------------------------------------
The following changes since commit f8ebb3ac881b17712e1d5967c97ab1806b16d3d6:
net: usb: ax88179_178a: Fix packet receiving (2022-06-30 10:41:57 +0200)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git HEAD
for you to fetch changes up to 9827a0e6e23bf43003cd3d5b7fb11baf59a35e1e:
netfilter: nft_set_pipapo: release elements in clone from abort path (2022-07-02 21:04:19 +0200)
----------------------------------------------------------------
Pablo Neira Ayuso (2):
netfilter: nf_tables: stricter validation of element data
netfilter: nft_set_pipapo: release elements in clone from abort path
net/netfilter/nf_tables_api.c | 9 +++++++-
net/netfilter/nft_set_pipapo.c | 48 +++++++++++++++++++++++++++++-------------
2 files changed, 41 insertions(+), 16 deletions(-)
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH net 0/2] Netfilter fixes for net
@ 2022-10-19 6:52 Pablo Neira Ayuso
0 siblings, 0 replies; 29+ messages in thread
From: Pablo Neira Ayuso @ 2022-10-19 6:52 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba, pabeni, edumazet
Hi,
The following patchset contains Netfilter fixes for net:
1) Missing flowi uid field in nft_fib expression, from Guillaume Nault.
This is broken since the creation of the fib expression.
2) Relax sanity check to fix bogus EINVAL error when deleting elements
belonging set intervals. Broken since 6.0-rc.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git
Thanks.
----------------------------------------------------------------
The following changes since commit 1ca695207ed2271ecbf8ee6c641970f621c157cc:
ip6mr: fix UAF issue in ip6mr_sk_done() when addrconf_init_net() failed (2022-10-18 11:05:55 +0200)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git HEAD
for you to fetch changes up to 96df8360dbb435cc69f7c3c8db44bf8b1c24cd7b:
netfilter: nf_tables: relax NFTA_SET_ELEM_KEY_END set flags requirements (2022-10-19 08:46:48 +0200)
----------------------------------------------------------------
Guillaume Nault (1):
netfilter: rpfilter/fib: Set ->flowic_uid correctly for user namespaces.
Pablo Neira Ayuso (1):
netfilter: nf_tables: relax NFTA_SET_ELEM_KEY_END set flags requirements
net/ipv4/netfilter/ipt_rpfilter.c | 1 +
net/ipv4/netfilter/nft_fib_ipv4.c | 1 +
net/ipv6/netfilter/ip6t_rpfilter.c | 1 +
net/ipv6/netfilter/nft_fib_ipv6.c | 2 ++
net/netfilter/nf_tables_api.c | 5 +++--
5 files changed, 8 insertions(+), 2 deletions(-)
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH net 0/2] Netfilter fixes for net
@ 2022-11-18 14:29 Pablo Neira Ayuso
0 siblings, 0 replies; 29+ messages in thread
From: Pablo Neira Ayuso @ 2022-11-18 14:29 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba, pabeni, edumazet
Hi,
The following patchset contains late Netfilter fixes for net:
1) Use READ_ONCE()/WRITE_ONCE() to update ct->mark, from Daniel Xu.
Not reported by syzbot, but I presume KASAN would trigger post
a splat on this. This is a rather old issue, predating git history.
2) Do not set up extensions for set element with end interval flag
set on. This leads to bogusly skipping this elements as expired
when listing the set/map to userspace as well as increasing
memory consumpton when stateful expressions are used. This issue
has been present since 4.18, when timeout support for rbtree set
was added.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git
Thanks.
----------------------------------------------------------------
The following changes since commit 40b9d1ab63f5c4f3cb69450044d07b45e5af72e1:
ipvlan: hold lower dev to avoid possible use-after-free (2022-11-18 10:39:22 +0000)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git HEAD
for you to fetch changes up to 33c7aba0b4ffd6d7cdab862a034eb582a5120a38:
netfilter: nf_tables: do not set up extensions for end interval (2022-11-18 15:21:32 +0100)
----------------------------------------------------------------
Daniel Xu (1):
netfilter: conntrack: Fix data-races around ct mark
Pablo Neira Ayuso (1):
netfilter: nf_tables: do not set up extensions for end interval
net/core/flow_dissector.c | 2 +-
net/ipv4/netfilter/ipt_CLUSTERIP.c | 4 ++--
net/netfilter/nf_conntrack_core.c | 2 +-
net/netfilter/nf_conntrack_netlink.c | 24 ++++++++++++++----------
net/netfilter/nf_conntrack_standalone.c | 2 +-
net/netfilter/nf_tables_api.c | 6 ++++--
net/netfilter/nft_ct.c | 6 +++---
net/netfilter/xt_connmark.c | 18 ++++++++++--------
net/openvswitch/conntrack.c | 8 ++++----
net/sched/act_connmark.c | 4 ++--
net/sched/act_ct.c | 8 ++++----
net/sched/act_ctinfo.c | 6 +++---
12 files changed, 49 insertions(+), 41 deletions(-)
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH net 0/2] Netfilter fixes for net
@ 2023-01-23 21:15 Pablo Neira Ayuso
2023-01-23 21:16 ` [PATCH net 1/2] netfilter: nft_set_rbtree: Switch to node list walk for overlap detection Pablo Neira Ayuso
2023-01-23 21:16 ` [PATCH net 2/2] netfilter: nft_set_rbtree: skip elements in transaction from garbage collection Pablo Neira Ayuso
0 siblings, 2 replies; 29+ messages in thread
From: Pablo Neira Ayuso @ 2023-01-23 21:15 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba, pabeni, edumazet
Hi,
The following patchset contains Netfilter fixes for net:
1) Fix overlap detection in rbtree set backend: Detect overlap by going
through the ordered list of valid tree nodes. To shorten the number of
visited nodes in the list, this algorithm descends the tree to search
for an existing element greater than the key value to insert that is
greater than the new element.
2) Fix for the rbtree set garbage collector: Skip inactive and busy
elements when checking for expired elements to avoid interference
with an ongoing transaction from control plane.
This is a rather large fix coming at this stage of the 6.2-rc. Since
33c7aba0b4ff ("netfilter: nf_tables: do not set up extensions for end
interval"), bogus overlap errors in the rbtree set occur more frequently.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git
Thanks.
----------------------------------------------------------------
The following changes since commit 71ab9c3e2253619136c31c89dbb2c69305cc89b1:
net: fix UaF in netns ops registration error path (2023-01-20 18:51:18 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git HEAD
for you to fetch changes up to 5d235d6ce75c12a7fdee375eb211e4116f7ab01b:
netfilter: nft_set_rbtree: skip elements in transaction from garbage collection (2023-01-23 21:38:33 +0100)
----------------------------------------------------------------
Pablo Neira Ayuso (2):
netfilter: nft_set_rbtree: Switch to node list walk for overlap detection
netfilter: nft_set_rbtree: skip elements in transaction from garbage collection
net/netfilter/nft_set_rbtree.c | 332 +++++++++++++++++++++++++----------------
1 file changed, 204 insertions(+), 128 deletions(-)
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH net 1/2] netfilter: nft_set_rbtree: Switch to node list walk for overlap detection
2023-01-23 21:15 [PATCH net 0/2] Netfilter fixes for net Pablo Neira Ayuso
@ 2023-01-23 21:16 ` Pablo Neira Ayuso
2023-01-24 6:00 ` patchwork-bot+netdevbpf
2023-01-23 21:16 ` [PATCH net 2/2] netfilter: nft_set_rbtree: skip elements in transaction from garbage collection Pablo Neira Ayuso
1 sibling, 1 reply; 29+ messages in thread
From: Pablo Neira Ayuso @ 2023-01-23 21:16 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba, pabeni, edumazet
...instead of a tree descent, which became overly complicated in an
attempt to cover cases where expired or inactive elements would affect
comparisons with the new element being inserted.
Further, it turned out that it's probably impossible to cover all those
cases, as inactive nodes might entirely hide subtrees consisting of a
complete interval plus a node that makes the current insertion not
overlap.
To speed up the overlap check, descent the tree to find a greater
element that is closer to the key value to insert. Then walk down the
node list for overlap detection. Starting the overlap check from
rb_first() unconditionally is slow, it takes 10 times longer due to the
full linear traversal of the list.
Moreover, perform garbage collection of expired elements when walking
down the node list to avoid bogus overlap reports.
For the insertion operation itself, this essentially reverts back to the
implementation before commit 7c84d41416d8 ("netfilter: nft_set_rbtree:
Detect partial overlaps on insertion"), except that cases of complete
overlap are already handled in the overlap detection phase itself, which
slightly simplifies the loop to find the insertion point.
Based on initial patch from Stefano Brivio, including text from the
original patch description too.
Fixes: 7c84d41416d8 ("netfilter: nft_set_rbtree: Detect partial overlaps on insertion")
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
net/netfilter/nft_set_rbtree.c | 316 ++++++++++++++++++++-------------
1 file changed, 189 insertions(+), 127 deletions(-)
diff --git a/net/netfilter/nft_set_rbtree.c b/net/netfilter/nft_set_rbtree.c
index 7325bee7d144..217225e13faf 100644
--- a/net/netfilter/nft_set_rbtree.c
+++ b/net/netfilter/nft_set_rbtree.c
@@ -38,10 +38,12 @@ static bool nft_rbtree_interval_start(const struct nft_rbtree_elem *rbe)
return !nft_rbtree_interval_end(rbe);
}
-static bool nft_rbtree_equal(const struct nft_set *set, const void *this,
- const struct nft_rbtree_elem *interval)
+static int nft_rbtree_cmp(const struct nft_set *set,
+ const struct nft_rbtree_elem *e1,
+ const struct nft_rbtree_elem *e2)
{
- return memcmp(this, nft_set_ext_key(&interval->ext), set->klen) == 0;
+ return memcmp(nft_set_ext_key(&e1->ext), nft_set_ext_key(&e2->ext),
+ set->klen);
}
static bool __nft_rbtree_lookup(const struct net *net, const struct nft_set *set,
@@ -52,7 +54,6 @@ static bool __nft_rbtree_lookup(const struct net *net, const struct nft_set *set
const struct nft_rbtree_elem *rbe, *interval = NULL;
u8 genmask = nft_genmask_cur(net);
const struct rb_node *parent;
- const void *this;
int d;
parent = rcu_dereference_raw(priv->root.rb_node);
@@ -62,12 +63,11 @@ static bool __nft_rbtree_lookup(const struct net *net, const struct nft_set *set
rbe = rb_entry(parent, struct nft_rbtree_elem, node);
- this = nft_set_ext_key(&rbe->ext);
- d = memcmp(this, key, set->klen);
+ d = memcmp(nft_set_ext_key(&rbe->ext), key, set->klen);
if (d < 0) {
parent = rcu_dereference_raw(parent->rb_left);
if (interval &&
- nft_rbtree_equal(set, this, interval) &&
+ !nft_rbtree_cmp(set, rbe, interval) &&
nft_rbtree_interval_end(rbe) &&
nft_rbtree_interval_start(interval))
continue;
@@ -215,154 +215,216 @@ static void *nft_rbtree_get(const struct net *net, const struct nft_set *set,
return rbe;
}
+static int nft_rbtree_gc_elem(const struct nft_set *__set,
+ struct nft_rbtree *priv,
+ struct nft_rbtree_elem *rbe)
+{
+ struct nft_set *set = (struct nft_set *)__set;
+ struct rb_node *prev = rb_prev(&rbe->node);
+ struct nft_rbtree_elem *rbe_prev;
+ struct nft_set_gc_batch *gcb;
+
+ gcb = nft_set_gc_batch_check(set, NULL, GFP_ATOMIC);
+ if (!gcb)
+ return -ENOMEM;
+
+ /* search for expired end interval coming before this element. */
+ do {
+ rbe_prev = rb_entry(prev, struct nft_rbtree_elem, node);
+ if (nft_rbtree_interval_end(rbe_prev))
+ break;
+
+ prev = rb_prev(prev);
+ } while (prev != NULL);
+
+ rb_erase(&rbe_prev->node, &priv->root);
+ rb_erase(&rbe->node, &priv->root);
+ atomic_sub(2, &set->nelems);
+
+ nft_set_gc_batch_add(gcb, rbe);
+ nft_set_gc_batch_complete(gcb);
+
+ return 0;
+}
+
+static bool nft_rbtree_update_first(const struct nft_set *set,
+ struct nft_rbtree_elem *rbe,
+ struct rb_node *first)
+{
+ struct nft_rbtree_elem *first_elem;
+
+ first_elem = rb_entry(first, struct nft_rbtree_elem, node);
+ /* this element is closest to where the new element is to be inserted:
+ * update the first element for the node list path.
+ */
+ if (nft_rbtree_cmp(set, rbe, first_elem) < 0)
+ return true;
+
+ return false;
+}
+
static int __nft_rbtree_insert(const struct net *net, const struct nft_set *set,
struct nft_rbtree_elem *new,
struct nft_set_ext **ext)
{
- bool overlap = false, dup_end_left = false, dup_end_right = false;
+ struct nft_rbtree_elem *rbe, *rbe_le = NULL, *rbe_ge = NULL;
+ struct rb_node *node, *parent, **p, *first = NULL;
struct nft_rbtree *priv = nft_set_priv(set);
u8 genmask = nft_genmask_next(net);
- struct nft_rbtree_elem *rbe;
- struct rb_node *parent, **p;
- int d;
+ int d, err;
- /* Detect overlaps as we descend the tree. Set the flag in these cases:
- *
- * a1. _ _ __>| ?_ _ __| (insert end before existing end)
- * a2. _ _ ___| ?_ _ _>| (insert end after existing end)
- * a3. _ _ ___? >|_ _ __| (insert start before existing end)
- *
- * and clear it later on, as we eventually reach the points indicated by
- * '?' above, in the cases described below. We'll always meet these
- * later, locally, due to tree ordering, and overlaps for the intervals
- * that are the closest together are always evaluated last.
- *
- * b1. _ _ __>| !_ _ __| (insert end before existing start)
- * b2. _ _ ___| !_ _ _>| (insert end after existing start)
- * b3. _ _ ___! >|_ _ __| (insert start after existing end, as a leaf)
- * '--' no nodes falling in this range
- * b4. >|_ _ ! (insert start before existing start)
- *
- * Case a3. resolves to b3.:
- * - if the inserted start element is the leftmost, because the '0'
- * element in the tree serves as end element
- * - otherwise, if an existing end is found immediately to the left. If
- * there are existing nodes in between, we need to further descend the
- * tree before we can conclude the new start isn't causing an overlap
- *
- * or to b4., which, preceded by a3., means we already traversed one or
- * more existing intervals entirely, from the right.
- *
- * For a new, rightmost pair of elements, we'll hit cases b3. and b2.,
- * in that order.
- *
- * The flag is also cleared in two special cases:
- *
- * b5. |__ _ _!|<_ _ _ (insert start right before existing end)
- * b6. |__ _ >|!__ _ _ (insert end right after existing start)
- *
- * which always happen as last step and imply that no further
- * overlapping is possible.
- *
- * Another special case comes from the fact that start elements matching
- * an already existing start element are allowed: insertion is not
- * performed but we return -EEXIST in that case, and the error will be
- * cleared by the caller if NLM_F_EXCL is not present in the request.
- * This way, request for insertion of an exact overlap isn't reported as
- * error to userspace if not desired.
- *
- * However, if the existing start matches a pre-existing start, but the
- * end element doesn't match the corresponding pre-existing end element,
- * we need to report a partial overlap. This is a local condition that
- * can be noticed without need for a tracking flag, by checking for a
- * local duplicated end for a corresponding start, from left and right,
- * separately.
+ /* Descend the tree to search for an existing element greater than the
+ * key value to insert that is greater than the new element. This is the
+ * first element to walk the ordered elements to find possible overlap.
*/
-
parent = NULL;
p = &priv->root.rb_node;
while (*p != NULL) {
parent = *p;
rbe = rb_entry(parent, struct nft_rbtree_elem, node);
- d = memcmp(nft_set_ext_key(&rbe->ext),
- nft_set_ext_key(&new->ext),
- set->klen);
+ d = nft_rbtree_cmp(set, rbe, new);
+
if (d < 0) {
p = &parent->rb_left;
-
- if (nft_rbtree_interval_start(new)) {
- if (nft_rbtree_interval_end(rbe) &&
- nft_set_elem_active(&rbe->ext, genmask) &&
- !nft_set_elem_expired(&rbe->ext) && !*p)
- overlap = false;
- } else {
- if (dup_end_left && !*p)
- return -ENOTEMPTY;
-
- overlap = nft_rbtree_interval_end(rbe) &&
- nft_set_elem_active(&rbe->ext,
- genmask) &&
- !nft_set_elem_expired(&rbe->ext);
-
- if (overlap) {
- dup_end_right = true;
- continue;
- }
- }
} else if (d > 0) {
- p = &parent->rb_right;
+ if (!first ||
+ nft_rbtree_update_first(set, rbe, first))
+ first = &rbe->node;
- if (nft_rbtree_interval_end(new)) {
- if (dup_end_right && !*p)
- return -ENOTEMPTY;
-
- overlap = nft_rbtree_interval_end(rbe) &&
- nft_set_elem_active(&rbe->ext,
- genmask) &&
- !nft_set_elem_expired(&rbe->ext);
-
- if (overlap) {
- dup_end_left = true;
- continue;
- }
- } else if (nft_set_elem_active(&rbe->ext, genmask) &&
- !nft_set_elem_expired(&rbe->ext)) {
- overlap = nft_rbtree_interval_end(rbe);
- }
+ p = &parent->rb_right;
} else {
- if (nft_rbtree_interval_end(rbe) &&
- nft_rbtree_interval_start(new)) {
+ if (nft_rbtree_interval_end(rbe))
p = &parent->rb_left;
-
- if (nft_set_elem_active(&rbe->ext, genmask) &&
- !nft_set_elem_expired(&rbe->ext))
- overlap = false;
- } else if (nft_rbtree_interval_start(rbe) &&
- nft_rbtree_interval_end(new)) {
+ else
p = &parent->rb_right;
+ }
+ }
+
+ if (!first)
+ first = rb_first(&priv->root);
+
+ /* Detect overlap by going through the list of valid tree nodes.
+ * Values stored in the tree are in reversed order, starting from
+ * highest to lowest value.
+ */
+ for (node = first; node != NULL; node = rb_next(node)) {
+ rbe = rb_entry(node, struct nft_rbtree_elem, node);
+
+ if (!nft_set_elem_active(&rbe->ext, genmask))
+ continue;
- if (nft_set_elem_active(&rbe->ext, genmask) &&
- !nft_set_elem_expired(&rbe->ext))
- overlap = false;
- } else if (nft_set_elem_active(&rbe->ext, genmask) &&
- !nft_set_elem_expired(&rbe->ext)) {
- *ext = &rbe->ext;
- return -EEXIST;
- } else {
- overlap = false;
- if (nft_rbtree_interval_end(rbe))
- p = &parent->rb_left;
- else
- p = &parent->rb_right;
+ /* perform garbage collection to avoid bogus overlap reports. */
+ if (nft_set_elem_expired(&rbe->ext)) {
+ err = nft_rbtree_gc_elem(set, priv, rbe);
+ if (err < 0)
+ return err;
+
+ continue;
+ }
+
+ d = nft_rbtree_cmp(set, rbe, new);
+ if (d == 0) {
+ /* Matching end element: no need to look for an
+ * overlapping greater or equal element.
+ */
+ if (nft_rbtree_interval_end(rbe)) {
+ rbe_le = rbe;
+ break;
+ }
+
+ /* first element that is greater or equal to key value. */
+ if (!rbe_ge) {
+ rbe_ge = rbe;
+ continue;
+ }
+
+ /* this is a closer more or equal element, update it. */
+ if (nft_rbtree_cmp(set, rbe_ge, new) != 0) {
+ rbe_ge = rbe;
+ continue;
}
+
+ /* element is equal to key value, make sure flags are
+ * the same, an existing more or equal start element
+ * must not be replaced by more or equal end element.
+ */
+ if ((nft_rbtree_interval_start(new) &&
+ nft_rbtree_interval_start(rbe_ge)) ||
+ (nft_rbtree_interval_end(new) &&
+ nft_rbtree_interval_end(rbe_ge))) {
+ rbe_ge = rbe;
+ continue;
+ }
+ } else if (d > 0) {
+ /* annotate element greater than the new element. */
+ rbe_ge = rbe;
+ continue;
+ } else if (d < 0) {
+ /* annotate element less than the new element. */
+ rbe_le = rbe;
+ break;
}
+ }
- dup_end_left = dup_end_right = false;
+ /* - new start element matching existing start element: full overlap
+ * reported as -EEXIST, cleared by caller if NLM_F_EXCL is not given.
+ */
+ if (rbe_ge && !nft_rbtree_cmp(set, new, rbe_ge) &&
+ nft_rbtree_interval_start(rbe_ge) == nft_rbtree_interval_start(new)) {
+ *ext = &rbe_ge->ext;
+ return -EEXIST;
+ }
+
+ /* - new end element matching existing end element: full overlap
+ * reported as -EEXIST, cleared by caller if NLM_F_EXCL is not given.
+ */
+ if (rbe_le && !nft_rbtree_cmp(set, new, rbe_le) &&
+ nft_rbtree_interval_end(rbe_le) == nft_rbtree_interval_end(new)) {
+ *ext = &rbe_le->ext;
+ return -EEXIST;
}
- if (overlap)
+ /* - new start element with existing closest, less or equal key value
+ * being a start element: partial overlap, reported as -ENOTEMPTY.
+ * Anonymous sets allow for two consecutive start element since they
+ * are constant, skip them to avoid bogus overlap reports.
+ */
+ if (!nft_set_is_anonymous(set) && rbe_le &&
+ nft_rbtree_interval_start(rbe_le) && nft_rbtree_interval_start(new))
+ return -ENOTEMPTY;
+
+ /* - new end element with existing closest, less or equal key value
+ * being a end element: partial overlap, reported as -ENOTEMPTY.
+ */
+ if (rbe_le &&
+ nft_rbtree_interval_end(rbe_le) && nft_rbtree_interval_end(new))
return -ENOTEMPTY;
+ /* - new end element with existing closest, greater or equal key value
+ * being an end element: partial overlap, reported as -ENOTEMPTY
+ */
+ if (rbe_ge &&
+ nft_rbtree_interval_end(rbe_ge) && nft_rbtree_interval_end(new))
+ return -ENOTEMPTY;
+
+ /* Accepted element: pick insertion point depending on key value */
+ parent = NULL;
+ p = &priv->root.rb_node;
+ while (*p != NULL) {
+ parent = *p;
+ rbe = rb_entry(parent, struct nft_rbtree_elem, node);
+ d = nft_rbtree_cmp(set, rbe, new);
+
+ if (d < 0)
+ p = &parent->rb_left;
+ else if (d > 0)
+ p = &parent->rb_right;
+ else if (nft_rbtree_interval_end(rbe))
+ p = &parent->rb_left;
+ else
+ p = &parent->rb_right;
+ }
+
rb_link_node_rcu(&new->node, parent, p);
rb_insert_color(&new->node, &priv->root);
return 0;
--
2.30.2
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH net 2/2] netfilter: nft_set_rbtree: skip elements in transaction from garbage collection
2023-01-23 21:15 [PATCH net 0/2] Netfilter fixes for net Pablo Neira Ayuso
2023-01-23 21:16 ` [PATCH net 1/2] netfilter: nft_set_rbtree: Switch to node list walk for overlap detection Pablo Neira Ayuso
@ 2023-01-23 21:16 ` Pablo Neira Ayuso
1 sibling, 0 replies; 29+ messages in thread
From: Pablo Neira Ayuso @ 2023-01-23 21:16 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba, pabeni, edumazet
Skip interference with an ongoing transaction, do not perform garbage
collection on inactive elements. Reset annotated previous end interval
if the expired element is marked as busy (control plane removed the
element right before expiration).
Fixes: 8d8540c4f5e0 ("netfilter: nft_set_rbtree: add timeout support")
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
net/netfilter/nft_set_rbtree.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/net/netfilter/nft_set_rbtree.c b/net/netfilter/nft_set_rbtree.c
index 217225e13faf..19ea4d3c3553 100644
--- a/net/netfilter/nft_set_rbtree.c
+++ b/net/netfilter/nft_set_rbtree.c
@@ -563,23 +563,37 @@ static void nft_rbtree_gc(struct work_struct *work)
struct nft_rbtree *priv;
struct rb_node *node;
struct nft_set *set;
+ struct net *net;
+ u8 genmask;
priv = container_of(work, struct nft_rbtree, gc_work.work);
set = nft_set_container_of(priv);
+ net = read_pnet(&set->net);
+ genmask = nft_genmask_cur(net);
write_lock_bh(&priv->lock);
write_seqcount_begin(&priv->count);
for (node = rb_first(&priv->root); node != NULL; node = rb_next(node)) {
rbe = rb_entry(node, struct nft_rbtree_elem, node);
+ if (!nft_set_elem_active(&rbe->ext, genmask))
+ continue;
+
+ /* elements are reversed in the rbtree for historical reasons,
+ * from highest to lowest value, that is why end element is
+ * always visited before the start element.
+ */
if (nft_rbtree_interval_end(rbe)) {
rbe_end = rbe;
continue;
}
if (!nft_set_elem_expired(&rbe->ext))
continue;
- if (nft_set_elem_mark_busy(&rbe->ext))
+
+ if (nft_set_elem_mark_busy(&rbe->ext)) {
+ rbe_end = NULL;
continue;
+ }
if (rbe_prev) {
rb_erase(&rbe_prev->node, &priv->root);
--
2.30.2
^ permalink raw reply related [flat|nested] 29+ messages in thread
* Re: [PATCH net 1/2] netfilter: nft_set_rbtree: Switch to node list walk for overlap detection
2023-01-23 21:16 ` [PATCH net 1/2] netfilter: nft_set_rbtree: Switch to node list walk for overlap detection Pablo Neira Ayuso
@ 2023-01-24 6:00 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 29+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-01-24 6:00 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: netfilter-devel, davem, netdev, kuba, pabeni, edumazet
Hello:
This series was applied to netdev/net.git (master)
by Pablo Neira Ayuso <pablo@netfilter.org>:
On Mon, 23 Jan 2023 22:16:00 +0100 you wrote:
> ...instead of a tree descent, which became overly complicated in an
> attempt to cover cases where expired or inactive elements would affect
> comparisons with the new element being inserted.
>
> Further, it turned out that it's probably impossible to cover all those
> cases, as inactive nodes might entirely hide subtrees consisting of a
> complete interval plus a node that makes the current insertion not
> overlap.
>
> [...]
Here is the summary with links:
- [net,1/2] netfilter: nft_set_rbtree: Switch to node list walk for overlap detection
https://git.kernel.org/netdev/net/c/c9e6978e2725
- [net,2/2] netfilter: nft_set_rbtree: skip elements in transaction from garbage collection
https://git.kernel.org/netdev/net/c/5d235d6ce75c
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH net 0/2] Netfilter fixes for net
@ 2023-01-31 13:31 Pablo Neira Ayuso
0 siblings, 0 replies; 29+ messages in thread
From: Pablo Neira Ayuso @ 2023-01-31 13:31 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba, pabeni, edumazet
Hi,
The following patchset contains two Netfilter fixes for net:
1) Release bridge info once packet escapes the br_netfilter path,
from Florian Westphal.
2) Revert incorrect fix for the SCTP connection tracking chunk
iterator, also from Florian.
First path fixes a long standing issue, the second path addresses
a mistake in the previous pull request for net.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git
Thanks.
----------------------------------------------------------------
The following changes since commit 9b3fc325c2a7e9e17e22b008357cb0ceb810d9b2:
Merge tag 'ieee802154-for-net-2023-01-30' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan (2023-01-30 21:11:11 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git HEAD
for you to fetch changes up to bd0e06f0def75ba26572a94e5350324474a55562:
Revert "netfilter: conntrack: fix bug in for_each_sctp_chunk" (2023-01-31 14:02:48 +0100)
----------------------------------------------------------------
Florian Westphal (2):
netfilter: br_netfilter: disable sabotage_in hook after first suppression
Revert "netfilter: conntrack: fix bug in for_each_sctp_chunk"
net/bridge/br_netfilter_hooks.c | 1 +
net/netfilter/nf_conntrack_proto_sctp.c | 5 +++--
2 files changed, 4 insertions(+), 2 deletions(-)
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH net 0/2] Netfilter fixes for net
@ 2023-04-20 17:06 Pablo Neira Ayuso
2023-04-21 3:25 ` Jakub Kicinski
0 siblings, 1 reply; 29+ messages in thread
From: Pablo Neira Ayuso @ 2023-04-20 17:06 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba, pabeni, edumazet
Hi,
The following patchset contains late Netfilter fixes for net:
1) Set on IPS_CONFIRMED before change_status() otherwise EBUSY is
bogusly hit. This bug was introduced in the 6.3 release cycle.
2) Fix nfnetlink_queue conntrack support: Set/dump timeout
accordingly for unconfirmed conntrack entries. Make sure this
is done after IPS_CONFIRMED is set on. This is an old bug, it
happens since the introduction of this feature.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git
Thanks.
----------------------------------------------------------------
The following changes since commit 92e8c732d8518588ac34b4cb3feaf37d2cb87555:
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf (2023-04-18 20:46:31 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git HEAD
for you to fetch changes up to 73db1b8f2bb6725b7391e85aab41fdf592b3c0c1:
netfilter: conntrack: fix wrong ct->timeout value (2023-04-19 12:08:38 +0200)
----------------------------------------------------------------
Pablo Neira Ayuso (1):
netfilter: conntrack: restore IPS_CONFIRMED out of nf_conntrack_hash_check_insert()
Tzung-Bi Shih (1):
netfilter: conntrack: fix wrong ct->timeout value
include/net/netfilter/nf_conntrack_core.h | 6 +++++-
net/netfilter/nf_conntrack_bpf.c | 1 +
net/netfilter/nf_conntrack_core.c | 1 -
net/netfilter/nf_conntrack_netlink.c | 16 ++++++++++++----
4 files changed, 18 insertions(+), 6 deletions(-)
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH net 0/2] Netfilter fixes for net
2023-04-20 17:06 Pablo Neira Ayuso
@ 2023-04-21 3:25 ` Jakub Kicinski
0 siblings, 0 replies; 29+ messages in thread
From: Jakub Kicinski @ 2023-04-21 3:25 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: netfilter-devel, davem, netdev, pabeni, edumazet
On Thu, 20 Apr 2023 19:06:55 +0200 Pablo Neira Ayuso wrote:
> 1) Set on IPS_CONFIRMED before change_status() otherwise EBUSY is
> bogusly hit. This bug was introduced in the 6.3 release cycle.
>
> 2) Fix nfnetlink_queue conntrack support: Set/dump timeout
> accordingly for unconfirmed conntrack entries. Make sure this
> is done after IPS_CONFIRMED is set on. This is an old bug, it
> happens since the introduction of this feature.
It missed our PR anyway so please resend with a signed tag.
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH net 0/2] Netfilter fixes for net
@ 2023-04-21 10:56 Pablo Neira Ayuso
0 siblings, 0 replies; 29+ messages in thread
From: Pablo Neira Ayuso @ 2023-04-21 10:56 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba, pabeni, edumazet
Hi,
The following patchset contains late Netfilter fixes for net:
1) Set on IPS_CONFIRMED before change_status() otherwise EBUSY is
bogusly hit. This bug was introduced in the 6.3 release cycle.
2) Fix nfnetlink_queue conntrack support: Set/dump timeout
accordingly for unconfirmed conntrack entries. Make sure this
is done after IPS_CONFIRMED is set on. This is an old bug, it
happens since the introduction of this feature.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git nf-23-04-21
Thanks.
----------------------------------------------------------------
The following changes since commit 92e8c732d8518588ac34b4cb3feaf37d2cb87555:
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf (2023-04-18 20:46:31 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git nf-23-04-21
for you to fetch changes up to 73db1b8f2bb6725b7391e85aab41fdf592b3c0c1:
netfilter: conntrack: fix wrong ct->timeout value (2023-04-19 12:08:38 +0200)
----------------------------------------------------------------
netfilter pull request
----------------------------------------------------------------
Pablo Neira Ayuso (1):
netfilter: conntrack: restore IPS_CONFIRMED out of nf_conntrack_hash_check_insert()
Tzung-Bi Shih (1):
netfilter: conntrack: fix wrong ct->timeout value
include/net/netfilter/nf_conntrack_core.h | 6 +++++-
net/netfilter/nf_conntrack_bpf.c | 1 +
net/netfilter/nf_conntrack_core.c | 1 -
net/netfilter/nf_conntrack_netlink.c | 16 ++++++++++++----
4 files changed, 18 insertions(+), 6 deletions(-)
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH net 0/2] Netfilter fixes for net
@ 2023-10-25 10:08 Pablo Neira Ayuso
0 siblings, 0 replies; 29+ messages in thread
From: Pablo Neira Ayuso @ 2023-10-25 10:08 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba, pabeni, edumazet, fw
Hi,
This patch contains two late Netfilter's flowtable fixes for net:
1) Flowtable GC pushes back packets to classic path in every GC run,
ie. every second. This is because NF_FLOW_HW_ESTABLISHED is only
used by sched/act_ct (never set) and IPS_SEEN_REPLY might be unset
by the time the flow is offloaded (this status bit is only reliable
in the sched/act_ct datapath).
2) sched/act_ct logic to push back packets to classic path to reevaluate
if UDP flow is unidirectional only applies if IPS_HW_OFFLOAD_BIT is
set on and no hardware offload request is pending to be handled.
From Vlad Buslov.
These two patches fixes two problems that were introduced in the
previous 6.5 development cycle.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git nf-23-10-25
Thanks.
----------------------------------------------------------------
The following changes since commit d2a0fc372aca561556e765d0a9ec365c7c12f0ad:
tcp: fix wrong RTO timeout when received SACK reneging (2023-10-22 11:47:44 +0100)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git nf-23-10-25
for you to fetch changes up to a63b6622120cd03a304796dbccb80655b3a21798:
net/sched: act_ct: additional checks for outdated flows (2023-10-25 11:35:57 +0200)
----------------------------------------------------------------
netfilter pull request 23-10-25
----------------------------------------------------------------
Pablo Neira Ayuso (1):
netfilter: flowtable: GC pushes back packets to classic path
Vlad Buslov (1):
net/sched: act_ct: additional checks for outdated flows
include/net/netfilter/nf_flow_table.h | 1 +
net/netfilter/nf_flow_table_core.c | 14 +++++++-------
net/sched/act_ct.c | 9 +++++++++
3 files changed, 17 insertions(+), 7 deletions(-)
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH net 0/2] Netfilter fixes for net
@ 2023-12-20 15:15 Pablo Neira Ayuso
0 siblings, 0 replies; 29+ messages in thread
From: Pablo Neira Ayuso @ 2023-12-20 15:15 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba, pabeni, edumazet, fw
Hi,
The following patchset contains Netfilter fixes for net:
1) Skip set commit for deleted/destroyed sets, this might trigger
double deactivation of expired elements.
2) Fix packet mangling from egress, set transport offset from
mac header for netdev/egress.
Both fixes address bugs already present in several releases.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git nf-23-12-20
Thanks.
----------------------------------------------------------------
The following changes since commit 8353c2abc02cf8302d5e6177b706c1879e7b833c:
Merge branch 'check-vlan-filter-feature-in-vlan_vids_add_by_dev-and-vlan_vids_del_by_dev' (2023-12-19 13:13:59 +0100)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git tags/nf-23-12-20
for you to fetch changes up to 7315dc1e122c85ffdfc8defffbb8f8b616c2eb1a:
netfilter: nf_tables: skip set commit for deleted/destroyed sets (2023-12-20 13:48:00 +0100)
----------------------------------------------------------------
netfilter pull request 23-12-20
----------------------------------------------------------------
Pablo Neira Ayuso (2):
netfilter: nf_tables: set transport offset from mac header for netdev/egress
netfilter: nf_tables: skip set commit for deleted/destroyed sets
include/net/netfilter/nf_tables_ipv4.h | 2 +-
net/netfilter/nf_tables_api.c | 2 +-
net/netfilter/nf_tables_core.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH net 0/2] Netfilter fixes for net
@ 2023-12-22 10:42 Pablo Neira Ayuso
2023-12-22 10:49 ` Pablo Neira Ayuso
0 siblings, 1 reply; 29+ messages in thread
From: Pablo Neira Ayuso @ 2023-12-22 10:42 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba, pabeni, edumazet, fw
[ resent, apparently this was only posted to netfilter-devel@vger.kernel.org,
not to netdev@vger.kernel.org ]
Hi,
The following patchset contains Netfilter fixes for net:
1) Skip set commit for deleted/destroyed sets, this might trigger
double deactivation of expired elements.
2) Fix packet mangling from egress, set transport offset from
mac header for netdev/egress.
Both fixes address bugs already present in several releases.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git nf-23-12-20
Thanks.
----------------------------------------------------------------
The following changes since commit 8353c2abc02cf8302d5e6177b706c1879e7b833c:
Merge branch 'check-vlan-filter-feature-in-vlan_vids_add_by_dev-and-vlan_vids_del_by_dev' (2023-12-19 13:13:59 +0100)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git tags/nf-23-12-20
for you to fetch changes up to 7315dc1e122c85ffdfc8defffbb8f8b616c2eb1a:
netfilter: nf_tables: skip set commit for deleted/destroyed sets (2023-12-20 13:48:00 +0100)
----------------------------------------------------------------
netfilter pull request 23-12-20
----------------------------------------------------------------
Pablo Neira Ayuso (2):
netfilter: nf_tables: set transport offset from mac header for netdev/egress
netfilter: nf_tables: skip set commit for deleted/destroyed sets
include/net/netfilter/nf_tables_ipv4.h | 2 +-
net/netfilter/nf_tables_api.c | 2 +-
net/netfilter/nf_tables_core.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH net 0/2] Netfilter fixes for net
2023-12-22 10:42 Pablo Neira Ayuso
@ 2023-12-22 10:49 ` Pablo Neira Ayuso
2023-12-22 10:53 ` Pablo Neira Ayuso
0 siblings, 1 reply; 29+ messages in thread
From: Pablo Neira Ayuso @ 2023-12-22 10:49 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba, pabeni, edumazet, fw
On Fri, Dec 22, 2023 at 11:42:03AM +0100, Pablo Neira Ayuso wrote:
> [ resent, apparently this was only posted to netfilter-devel@vger.kernel.org,
> not to netdev@vger.kernel.org ]
For the record, previous is still in patchwork:
https://patchwork.kernel.org/project/netdevbpf/patch/20231220151544.270214-1-pablo@netfilter.org/
> Hi,
>
> The following patchset contains Netfilter fixes for net:
>
> 1) Skip set commit for deleted/destroyed sets, this might trigger
> double deactivation of expired elements.
>
> 2) Fix packet mangling from egress, set transport offset from
> mac header for netdev/egress.
>
> Both fixes address bugs already present in several releases.
>
> Please, pull these changes from:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git nf-23-12-20
>
> Thanks.
>
> ----------------------------------------------------------------
>
> The following changes since commit 8353c2abc02cf8302d5e6177b706c1879e7b833c:
>
> Merge branch 'check-vlan-filter-feature-in-vlan_vids_add_by_dev-and-vlan_vids_del_by_dev' (2023-12-19 13:13:59 +0100)
>
> are available in the Git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git tags/nf-23-12-20
>
> for you to fetch changes up to 7315dc1e122c85ffdfc8defffbb8f8b616c2eb1a:
>
> netfilter: nf_tables: skip set commit for deleted/destroyed sets (2023-12-20 13:48:00 +0100)
>
> ----------------------------------------------------------------
> netfilter pull request 23-12-20
>
> ----------------------------------------------------------------
> Pablo Neira Ayuso (2):
> netfilter: nf_tables: set transport offset from mac header for netdev/egress
> netfilter: nf_tables: skip set commit for deleted/destroyed sets
>
> include/net/netfilter/nf_tables_ipv4.h | 2 +-
> net/netfilter/nf_tables_api.c | 2 +-
> net/netfilter/nf_tables_core.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH net 0/2] Netfilter fixes for net
2023-12-22 10:49 ` Pablo Neira Ayuso
@ 2023-12-22 10:53 ` Pablo Neira Ayuso
0 siblings, 0 replies; 29+ messages in thread
From: Pablo Neira Ayuso @ 2023-12-22 10:53 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba, pabeni, edumazet, fw
On Fri, Dec 22, 2023 at 11:49:14AM +0100, Pablo Neira Ayuso wrote:
> On Fri, Dec 22, 2023 at 11:42:03AM +0100, Pablo Neira Ayuso wrote:
> > [ resent, apparently this was only posted to netfilter-devel@vger.kernel.org,
> > not to netdev@vger.kernel.org ]
>
> For the record, previous is still in patchwork:
>
> https://patchwork.kernel.org/project/netdevbpf/patch/20231220151544.270214-1-pablo@netfilter.org/
Actually, I Cc'ed netdev@vger.kernel.org in PR from Dec 20.
So this PR got lost?
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH net 0/2] Netfilter fixes for net
@ 2024-01-03 11:29 Pablo Neira Ayuso
0 siblings, 0 replies; 29+ messages in thread
From: Pablo Neira Ayuso @ 2024-01-03 11:29 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba, pabeni, edumazet, fw
Hi,
The following patchset contains Netfilter fixes for net:
1) Fix nat packets in the related state in OVS, from Brad Cowie.
2) Drop chain reference counter on error path in case chain binding
fails.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git nf-24-01-03
Thanks.
----------------------------------------------------------------
The following changes since commit 9bf2e9165f90dc9f416af53c902be7e33930f728:
net: qrtr: ns: Return 0 if server port is not present (2024-01-01 18:41:29 +0000)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git nf-24-01-03
for you to fetch changes up to b29be0ca8e816119ccdf95cc7d7c7be9bde005f1:
netfilter: nft_immediate: drop chain reference counter on error (2024-01-03 11:17:17 +0100)
----------------------------------------------------------------
netfilter pull request 24-01-03
----------------------------------------------------------------
Brad Cowie (1):
netfilter: nf_nat: fix action not being set for all ct states
Pablo Neira Ayuso (1):
netfilter: nft_immediate: drop chain reference counter on error
net/netfilter/nf_nat_ovs.c | 3 ++-
net/netfilter/nft_immediate.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH net 0/2] Netfilter fixes for net
@ 2024-06-26 23:38 Pablo Neira Ayuso
0 siblings, 0 replies; 29+ messages in thread
From: Pablo Neira Ayuso @ 2024-06-26 23:38 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba, pabeni, edumazet, fw, torvalds
Hi,
The following patchset contains two Netfilter fixes for net:
Patch #1 fixes CONFIG_SYSCTL=n for a patch coming in the previous PR
to move the sysctl toggle to enable SRv6 netfilter hooks from
nf_conntrack to the core, from Jianguo Wu.
Patch #2 fixes a possible pointer leak to userspace due to insufficient
validation of NFT_DATA_VALUE.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git nf-24-06-27
Thanks.
----------------------------------------------------------------
The following changes since commit 058722ee350c0bdd664e467156feb2bf5d9cc271:
net: usb: ax88179_178a: improve link status logs (2024-06-24 10:15:09 +0100)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git tags/nf-24-06-27
for you to fetch changes up to 7931d32955e09d0a11b1fe0b6aac1bfa061c005c:
netfilter: nf_tables: fully validate NFT_DATA_VALUE on store to data registers (2024-06-27 01:09:51 +0200)
----------------------------------------------------------------
netfilter pull request 24-06-27
----------------------------------------------------------------
Jianguo Wu (1):
netfilter: fix undefined reference to 'netfilter_lwtunnel_*' when CONFIG_SYSCTL=n
Pablo Neira Ayuso (1):
netfilter: nf_tables: fully validate NFT_DATA_VALUE on store to data registers
include/net/netfilter/nf_tables.h | 5 +++++
net/netfilter/nf_hooks_lwtunnel.c | 3 +++
net/netfilter/nf_tables_api.c | 8 ++++----
net/netfilter/nft_lookup.c | 3 ++-
4 files changed, 14 insertions(+), 5 deletions(-)
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH net 0/2] Netfilter fixes for net
@ 2024-07-11 9:39 Pablo Neira Ayuso
0 siblings, 0 replies; 29+ messages in thread
From: Pablo Neira Ayuso @ 2024-07-11 9:39 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba, pabeni, edumazet, fw
Hi,
The following batch contains Netfilter fixes for net:
Patch #1 fixes a bogus WARN_ON splat in nfnetlink_queue.
Patch #2 fixes a crash due to stack overflow in chain loop detection
by using the existing chain validation routines
Both patches from Florian Westphal.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git nf-24-07-11
Thanks.
----------------------------------------------------------------
The following changes since commit c184cf94e73b04ff7048d045f5413899bc664788:
ethtool: netlink: do not return SQI value if link is down (2024-07-11 11:19:07 +0200)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git tags/nf-24-07-11
for you to fetch changes up to cff3bd012a9512ac5ed858d38e6ed65f6391008c:
netfilter: nf_tables: prefer nft_chain_validate (2024-07-11 11:26:35 +0200)
----------------------------------------------------------------
netfilter pull request 24-07-11
----------------------------------------------------------------
Florian Westphal (2):
netfilter: nfnetlink_queue: drop bogus WARN_ON
netfilter: nf_tables: prefer nft_chain_validate
net/netfilter/nf_tables_api.c | 158 ++++------------------------------------
net/netfilter/nfnetlink_queue.c | 2 +-
2 files changed, 14 insertions(+), 146 deletions(-)
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH net 0/2] Netfilter fixes for net
@ 2024-07-31 21:30 Pablo Neira Ayuso
0 siblings, 0 replies; 29+ messages in thread
From: Pablo Neira Ayuso @ 2024-07-31 21:30 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba, pabeni, edumazet, fw
Hi,
The following patchset contains Netfilter fixes for net:
Fix a possible null-ptr-deref sometimes triggered by iptables-restore at
boot time. Register iptables {ipv4,ipv6} nat table pernet in first place
to fix this issue. Patch #1 and #2 from Kuniyuki Iwashima.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git nf-24-07-31
Thanks.
----------------------------------------------------------------
The following changes since commit 0bf50cead4c4710d9f704778c32ab8af47ddf070:
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue (2024-07-30 18:41:10 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git tags/nf-24-07-31
for you to fetch changes up to c22921df777de5606f1047b1345b8d22ef1c0b34:
netfilter: iptables: Fix potential null-ptr-deref in ip6table_nat_table_init(). (2024-07-31 23:21:34 +0200)
----------------------------------------------------------------
netfilter pull request 24-07-31
----------------------------------------------------------------
Kuniyuki Iwashima (2):
netfilter: iptables: Fix null-ptr-deref in iptable_nat_table_init().
netfilter: iptables: Fix potential null-ptr-deref in ip6table_nat_table_init().
net/ipv4/netfilter/iptable_nat.c | 18 ++++++++++--------
net/ipv6/netfilter/ip6table_nat.c | 14 +++++++++-----
2 files changed, 19 insertions(+), 13 deletions(-)
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH net 0/2] Netfilter fixes for net
@ 2024-08-28 21:47 Pablo Neira Ayuso
0 siblings, 0 replies; 29+ messages in thread
From: Pablo Neira Ayuso @ 2024-08-28 21:47 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba, pabeni, edumazet, fw
Hi,
The following patchset contains Netfilter fixes for net:
Patch #1 sets on NFT_PKTINFO_L4PROTO for UDP packets less than 4 bytes
payload from netdev/egress by subtracting skb_network_offset() when
validating IPv4 packet length, otherwise 'meta l4proto udp' never
matches.
Patch #2 subtracts skb_network_offset() when validating IPv6 packet
length for netdev/egress.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git nf-24-08-28
Thanks.
----------------------------------------------------------------
The following changes since commit 8af174ea863c72f25ce31cee3baad8a301c0cf0f:
net: mana: Fix race of mana_hwc_post_rx_wqe and new hwc response (2024-08-23 14:24:24 +0100)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git nf-24-08-28
for you to fetch changes up to 70c261d500951cf3ea0fcf32651aab9a65a91471:
netfilter: nf_tables_ipv6: consider network offset in netdev/egress validation (2024-08-27 18:11:56 +0200)
----------------------------------------------------------------
netfilter pull request 24-08-28
----------------------------------------------------------------
Pablo Neira Ayuso (2):
netfilter: nf_tables: restore IP sanity checks for netdev/egress
netfilter: nf_tables_ipv6: consider network offset in netdev/egress validation
include/net/netfilter/nf_tables_ipv4.h | 10 ++++++----
include/net/netfilter/nf_tables_ipv6.h | 5 +++--
2 files changed, 9 insertions(+), 6 deletions(-)
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH net 0/2] Netfilter fixes for net
@ 2024-09-11 22:25 Pablo Neira Ayuso
0 siblings, 0 replies; 29+ messages in thread
From: Pablo Neira Ayuso @ 2024-09-11 22:25 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba, pabeni, edumazet, fw
Hi,
The following batch contains two fixes from Florian Westphal:
Patch #1 fixes a sk refcount leak in nft_socket on mismatch.
Patch #2 fixes cgroupsv2 matching from containers due to incorrect
level in subtree.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git nf-24-09-12
Thanks.
----------------------------------------------------------------
The following changes since commit d759ee240d3c0c4a19f4d984eb21c36da76bc6ce:
Merge tag 'net-6.11-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net (2024-09-05 17:08:01 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git tags/nf-24-09-12
for you to fetch changes up to 7f3287db654395f9c5ddd246325ff7889f550286:
netfilter: nft_socket: make cgroupsv2 matching work with namespaces (2024-09-12 00:16:58 +0200)
----------------------------------------------------------------
netfilter pull request 24-09-12
----------------------------------------------------------------
Florian Westphal (2):
netfilter: nft_socket: fix sk refcount leaks
netfilter: nft_socket: make cgroupsv2 matching work with namespaces
net/netfilter/nft_socket.c | 48 ++++++++++++++++++++++++++++++++++++++++------
1 file changed, 42 insertions(+), 6 deletions(-)
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH net 0/2] Netfilter fixes for net
@ 2025-01-09 12:35 Pablo Neira Ayuso
0 siblings, 0 replies; 29+ messages in thread
From: Pablo Neira Ayuso @ 2025-01-09 12:35 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba, pabeni, edumazet, fw
Hi,
The following patchset contains Netfilter fixes for net:
1) Fix imbalance between flowtable BIND and UNBIND calls to configure
hardware offload, this fixes a possible kmemleak.
2) Clamp maximum conntrack hashtable size to INT_MAX to fix a possible
WARN_ON_ONCE splat coming from kvmalloc_array(), only possible from
init_netns.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git nf-25-01-09
Thanks.
----------------------------------------------------------------
The following changes since commit 4f619d518db9cd1a933c3a095a5f95d0c1584ae8:
net: wwan: t7xx: Fix FSM command timeout issue (2024-12-30 18:00:32 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git nf-25-01-09
for you to fetch changes up to b541ba7d1f5a5b7b3e2e22dc9e40e18a7d6dbc13:
netfilter: conntrack: clamp maximum hashtable size to INT_MAX (2025-01-09 13:29:45 +0100)
----------------------------------------------------------------
netfilter pull request 25-01-09
----------------------------------------------------------------
Pablo Neira Ayuso (2):
netfilter: nf_tables: imbalance in flowtable binding
netfilter: conntrack: clamp maximum hashtable size to INT_MAX
net/netfilter/nf_conntrack_core.c | 5 ++++-
net/netfilter/nf_tables_api.c | 15 +++++++++++----
2 files changed, 15 insertions(+), 5 deletions(-)
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH net 0/2] Netfilter fixes for net
@ 2025-04-10 10:36 Pablo Neira Ayuso
0 siblings, 0 replies; 29+ messages in thread
From: Pablo Neira Ayuso @ 2025-04-10 10:36 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev, kuba, pabeni, edumazet, fw, horms
Hi,
The following batch contains a Netfilter fix and improved test coverage:
1) Fix AVX2 matching in nft_pipapo, from Florian Westphal.
2) Extend existing test to improve coverage for the aforementioned bug,
also from Florian.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git nf-25-04-10
Thanks.
----------------------------------------------------------------
The following changes since commit aabc6596ffb377c4c9c8f335124b92ea282c9821:
net: ppp: Add bound checking for skb data on ppp_sync_txmung (2025-04-10 11:24:17 +0200)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git tags/nf-25-04-10
for you to fetch changes up to 27eb86e22f1067a39f05e8878fd83f00e3311dc3:
selftests: netfilter: add test case for recent mismatch bug (2025-04-10 12:33:55 +0200)
----------------------------------------------------------------
netfilter pull request 25-04-10
----------------------------------------------------------------
Florian Westphal (2):
nft_set_pipapo: fix incorrect avx2 match of 5th field octet
selftests: netfilter: add test case for recent mismatch bug
net/netfilter/nft_set_pipapo_avx2.c | 3 +-
.../selftests/net/netfilter/nft_concat_range.sh | 39 +++++++++++++++++++++-
2 files changed, 40 insertions(+), 2 deletions(-)
^ permalink raw reply [flat|nested] 29+ messages in thread
end of thread, other threads:[~2025-04-10 10:36 UTC | newest]
Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-23 21:15 [PATCH net 0/2] Netfilter fixes for net Pablo Neira Ayuso
2023-01-23 21:16 ` [PATCH net 1/2] netfilter: nft_set_rbtree: Switch to node list walk for overlap detection Pablo Neira Ayuso
2023-01-24 6:00 ` patchwork-bot+netdevbpf
2023-01-23 21:16 ` [PATCH net 2/2] netfilter: nft_set_rbtree: skip elements in transaction from garbage collection Pablo Neira Ayuso
-- strict thread matches above, loose matches on Subject: below --
2025-04-10 10:36 [PATCH net 0/2] Netfilter fixes for net Pablo Neira Ayuso
2025-01-09 12:35 Pablo Neira Ayuso
2024-09-11 22:25 Pablo Neira Ayuso
2024-08-28 21:47 Pablo Neira Ayuso
2024-07-31 21:30 Pablo Neira Ayuso
2024-07-11 9:39 Pablo Neira Ayuso
2024-06-26 23:38 Pablo Neira Ayuso
2024-01-03 11:29 Pablo Neira Ayuso
2023-12-22 10:42 Pablo Neira Ayuso
2023-12-22 10:49 ` Pablo Neira Ayuso
2023-12-22 10:53 ` Pablo Neira Ayuso
2023-12-20 15:15 Pablo Neira Ayuso
2023-10-25 10:08 Pablo Neira Ayuso
2023-04-21 10:56 Pablo Neira Ayuso
2023-04-20 17:06 Pablo Neira Ayuso
2023-04-21 3:25 ` Jakub Kicinski
2023-01-31 13:31 Pablo Neira Ayuso
2022-11-18 14:29 Pablo Neira Ayuso
2022-10-19 6:52 Pablo Neira Ayuso
2022-07-02 19:10 Pablo Neira Ayuso
2022-05-26 20:54 Pablo Neira Ayuso
2022-04-12 9:42 Pablo Neira Ayuso
2022-04-05 10:09 Pablo Neira Ayuso
2021-06-02 12:44 Pablo Neira Ayuso
2021-02-09 21:35 Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).