lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250912112523.4914c6bf@canb.auug.org.au>
Date: Fri, 12 Sep 2025 11:25:23 +1000
From: Stephen Rothwell <sfr@...b.auug.org.au>
To: David Miller <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
 Paolo Abeni <pabeni@...hat.com>
Cc: Networking <netdev@...r.kernel.org>, Florian Westphal <fw@...len.de>,
 Sebastian Andrzej Siewior <bigeasy@...utronix.de>, Matthieu Baerts
 <matttbe@...nel.org>, Linux Kernel Mailing List
 <linux-kernel@...r.kernel.org>, Linux Next Mailing List
 <linux-next@...r.kernel.org>
Subject: linux-next: manual merge of the net-next tree with the net tree

Hi all,

Today's linux-next merge of the net-next tree got conflicts in:

  net/netfilter/nft_set_pipapo.c
  net/netfilter/nft_set_pipapo_avx2.c

between commit:

  c4eaca2e1052 ("netfilter: nft_set_pipapo: don't check genbit from packetpath lookups")

from the net tree and commit:

  416e53e39516 ("netfilter: nft_set_pipapo_avx2: split lookup function in two parts")

(and maybe others) from the net-next tree.

I used the resoution provided by Matthieu, thanks.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/netfilter/nft_set_pipapo.c
index 793790d79d13,4b64c3bd8e70..000000000000
--- a/net/netfilter/nft_set_pipapo.c
+++ b/net/netfilter/nft_set_pipapo.c
@@@ -539,7 -562,7 +578,7 @@@ nft_pipapo_lookup(const struct net *net
  	const struct nft_pipapo_elem *e;
  
  	m = rcu_dereference(priv->match);
- 	e = pipapo_get(m, (const u8 *)key, NFT_GENMASK_ANY, get_jiffies_64());
 -	e = pipapo_get_slow(m, (const u8 *)key, genmask, get_jiffies_64());
++	e = pipapo_get_slow(m, (const u8 *)key, NFT_GENMASK_ANY, get_jiffies_64());
  
  	return e ? &e->ext : NULL;
  }
diff --cc net/netfilter/nft_set_pipapo_avx2.c
index c0884fa68c79,7559306d0aed..000000000000
--- a/net/netfilter/nft_set_pipapo_avx2.c
+++ b/net/netfilter/nft_set_pipapo_avx2.c
@@@ -1241,28 -1226,75 +1226,74 @@@ next_match
  
  #undef NFT_SET_PIPAPO_AVX2_LOOKUP
  
- 		if (ret < 0)
- 			goto out;
- 
- 		if (last) {
- 			const struct nft_set_ext *e = &f->mt[ret].e->ext;
- 
- 			if (unlikely(nft_set_elem_expired(e)))
- 				goto next_match;
- 
- 			ext = e;
- 			goto out;
+ 		if (ret < 0) {
+ 			scratch->map_index = map_index;
+ 			kernel_fpu_end();
+ 			__local_unlock_nested_bh(&scratch->bh_lock);
+ 			return NULL;
  		}
  
+ 		if (last) {
+ 			struct nft_pipapo_elem *e;
+ 
+ 			e = f->mt[ret].e;
+ 			if (unlikely(__nft_set_elem_expired(&e->ext, tstamp) ||
+ 				     !nft_set_elem_active(&e->ext, genmask)))
+ 				goto next_match;
+ 
+ 			scratch->map_index = map_index;
+ 			kernel_fpu_end();
+ 			__local_unlock_nested_bh(&scratch->bh_lock);
+ 			return e;
+ 		}
+ 
+ 		map_index = !map_index;
  		swap(res, fill);
- 		rp += NFT_PIPAPO_GROUPS_PADDED_SIZE(f);
+ 		data += NFT_PIPAPO_GROUPS_PADDED_SIZE(f);
  	}
  
- out:
- 	if (i % 2)
- 		scratch->map_index = !map_index;
  	kernel_fpu_end();
+ 	__local_unlock_nested_bh(&scratch->bh_lock);
+ 	return NULL;
+ }
+ 
+ /**
+  * nft_pipapo_avx2_lookup() - Dataplane frontend for AVX2 implementation
+  * @net:	Network namespace
+  * @set:	nftables API set representation
+  * @key:	nftables API element representation containing key data
+  *
+  * This function is called from the data path.  It will search for
+  * an element matching the given key in the current active copy using
+  * the AVX2 routines if the FPU is usable or fall back to the generic
+  * implementation of the algorithm otherwise.
+  *
+  * Return: nftables API extension pointer or NULL if no match.
+  */
+ const struct nft_set_ext *
+ nft_pipapo_avx2_lookup(const struct net *net, const struct nft_set *set,
+ 		       const u32 *key)
+ {
+ 	struct nft_pipapo *priv = nft_set_priv(set);
 -	u8 genmask = nft_genmask_cur(net);
+ 	const struct nft_pipapo_match *m;
+ 	const u8 *rp = (const u8 *)key;
+ 	const struct nft_pipapo_elem *e;
+ 
+ 	local_bh_disable();
+ 
+ 	if (unlikely(!irq_fpu_usable())) {
+ 		const struct nft_set_ext *ext;
+ 
+ 		ext = nft_pipapo_lookup(net, set, key);
+ 
+ 		local_bh_enable();
+ 		return ext;
+ 	}
+ 
+ 	m = rcu_dereference(priv->match);
+ 
 -	e = pipapo_get_avx2(m, rp, genmask, get_jiffies_64());
++	e = pipapo_get_avx2(m, rp, NFT_GENMASK_ANY, get_jiffies_64());
  	local_bh_enable();
  
- 	return ext;
+ 	return e ? &e->ext : NULL;
  }

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ