Skip to contentSkip to conversation

ipset patch for the nf tree

PATCH In review Jozsef Kadlecsik 2 participants 4 messages Nov 22, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover ipset patch for the nf tree

Hi Pablo,

Please apply the next one-liner patch to your nf tree. Thanks!

- The "netfilter: ipset: enforce documented limit to prevent allocating huge memory" patch contained a wrong condition which makes impossible to add up to 64 clashing elements to a hash:net,iface type of set while it is the documented feature of the set type. The patch fixes the condition and thus makes possible to add the elements while keeps preventing allocating huge memory.

Best regards,
Jozsef

The following changes since commit c7aa1a76d4a0a3c401025b60c401412bbb60f8c6:

netfilter: ipset: regression in ip_set_hash_ip.c (2022-11-21 15:00:45 +0100)

are available in the Git repository at:

git://blackhole.kfki.hu/nf 5e8cc0ff84d763559

for you to fetch changes up to 5e8cc0ff84d763559d34e3ddf5a1e645712ead54:

netfilter: ipset: restore allowing 64 clashing elements in hash:net,iface (2022-11-22 20:07:27 +0100)

----------------------------------------------------------------
Jozsef Kadlecsik (1):
netfilter: ipset: restore allowing 64 clashing elements in hash:net,iface

 net/netfilter/ipset/ip_set_hash_gen.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
#1 lore raw

PATCH 1/1 netfilter: ipset: restore allowing 64 clashing elements in hash:net,iface

The patch "netfilter: ipset: enforce documented limit to prevent allocating huge memory" was too strict and prevented to add up to 64 clashing elements to a hash:net,iface type of set. This patch fixes the issue and now the type behaves as documented.

---
 net/netfilter/ipset/ip_set_hash_gen.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/ipset/ip_set_hash_gen.h +1 -1
index 3adc291d9ce1..7499192af586 100644
@@ -916,7 +916,7 @@ mtype_add(struct ip_set *set, void *value, const struct ip_set_ext *ext,
 #ifdef IP_SET_HASH_WITH_MULTI
 		if (h->bucketsize >= AHASH_MAX_TUNED)
 			goto set_full;
-		else if (h->bucketsize < multi)
+		else if (h->bucketsize <= multi)
 			h->bucketsize += AHASH_INIT_SIZE;
 #endif
 		if (n->size >= AHASH_MAX(h)) {
Signature · 1 line
2.30.2
#2 lore raw

Re: [PATCH 1/1] netfilter: ipset: restore allowing 64 clashing elements in hash:net,iface

Hi Jozsef,

Quoted 4 lines · Jozsef Kadlecsik

The patch "netfilter: ipset: enforce documented limit to prevent allocating huge memory" was too strict and prevented to add up to 64 clashing elements to a hash:net,iface type of set. This patch fixes the issue and now the type behaves as documented.

I have manually applied, this to add the Fixes: tag, upstream maintainers usually require this and it also helps robots to identify patches which should go into -stable.

#3 lore raw

Re: [PATCH 1/1] netfilter: ipset: restore allowing 64 clashing elements in hash:net,iface

Hi Pablo,

Quoted 9 lines · Pablo Neira Ayuso
Quoted 4 lines · Jozsef Kadlecsik

The patch "netfilter: ipset: enforce documented limit to prevent allocating huge memory" was too strict and prevented to add up to 64 clashing elements to a hash:net,iface type of set. This patch fixes the issue and now the type behaves as documented.

I have manually applied, this to add the Fixes: tag, upstream maintainers usually require this and it also helps robots to identify patches which should go into -stable.

I forgot to add the Fixes: tag, thanks!

Best regards,
Jozsef
-
E-mail : [email protected], [email protected] PGP key : https://wigner.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics

          H-1525 Budapest 114, POB. 49, Hungary