]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.14
authorSasha Levin <sashal@kernel.org>
Sun, 30 Jul 2023 13:27:54 +0000 (09:27 -0400)
committerSasha Levin <sashal@kernel.org>
Sun, 30 Jul 2023 13:27:54 +0000 (09:27 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.14/benet-fix-return-value-check-in-be_lancer_xmit_worka.patch [new file with mode: 0644]
queue-4.14/bonding-reset-bond-s-flags-when-down-link-is-p2p-dev.patch [new file with mode: 0644]
queue-4.14/ethernet-atheros-fix-return-value-check-in-atl1e_tso.patch [new file with mode: 0644]
queue-4.14/i40e-fix-an-null-vs-is_err-bug-for-debugfs_create_di.patch [new file with mode: 0644]
queue-4.14/ipv6-addrconf-fix-bug-where-deleting-a-mngtmpaddr-ca.patch [new file with mode: 0644]
queue-4.14/platform-x86-msi-laptop-fix-rfkill-out-of-sync-on-ms.patch [new file with mode: 0644]
queue-4.14/series
queue-4.14/tcp-reduce-chance-of-collisions-in-inet6_hashfn.patch [new file with mode: 0644]
queue-4.14/team-reset-team-s-flags-when-down-link-is-p2p-device.patch [new file with mode: 0644]

diff --git a/queue-4.14/benet-fix-return-value-check-in-be_lancer_xmit_worka.patch b/queue-4.14/benet-fix-return-value-check-in-be_lancer_xmit_worka.patch
new file mode 100644 (file)
index 0000000..8ad0215
--- /dev/null
@@ -0,0 +1,38 @@
+From 4ee2469eebd27799118245c44eb4c9910e40726c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 25 Jul 2023 11:27:26 +0800
+Subject: benet: fix return value check in be_lancer_xmit_workarounds()
+
+From: Yuanjun Gong <ruc_gongyuanjun@163.com>
+
+[ Upstream commit 5c85f7065718a949902b238a6abd8fc907c5d3e0 ]
+
+in be_lancer_xmit_workarounds(), it should go to label 'tx_drop'
+if an unexpected value is returned by pskb_trim().
+
+Fixes: 93040ae5cc8d ("be2net: Fix to trim skb for padded vlan packets to workaround an ASIC Bug")
+Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>
+Link: https://lore.kernel.org/r/20230725032726.15002-1-ruc_gongyuanjun@163.com
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/emulex/benet/be_main.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
+index f8541d0c7bd52..bbe8f4b250d15 100644
+--- a/drivers/net/ethernet/emulex/benet/be_main.c
++++ b/drivers/net/ethernet/emulex/benet/be_main.c
+@@ -1132,7 +1132,8 @@ static struct sk_buff *be_lancer_xmit_workarounds(struct be_adapter *adapter,
+           (lancer_chip(adapter) || BE3_chip(adapter) ||
+            skb_vlan_tag_present(skb)) && is_ipv4_pkt(skb)) {
+               ip = (struct iphdr *)ip_hdr(skb);
+-              pskb_trim(skb, eth_hdr_len + ntohs(ip->tot_len));
++              if (unlikely(pskb_trim(skb, eth_hdr_len + ntohs(ip->tot_len))))
++                      goto tx_drop;
+       }
+       /* If vlan tag is already inlined in the packet, skip HW VLAN
+-- 
+2.39.2
+
diff --git a/queue-4.14/bonding-reset-bond-s-flags-when-down-link-is-p2p-dev.patch b/queue-4.14/bonding-reset-bond-s-flags-when-down-link-is-p2p-dev.patch
new file mode 100644 (file)
index 0000000..7b53faa
--- /dev/null
@@ -0,0 +1,61 @@
+From 03051d51357b96417530353c692938f1ed6ed9f2 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 21 Jul 2023 12:03:55 +0800
+Subject: bonding: reset bond's flags when down link is P2P device
+
+From: Hangbin Liu <liuhangbin@gmail.com>
+
+[ Upstream commit da19a2b967cf1e2c426f50d28550d1915214a81d ]
+
+When adding a point to point downlink to the bond, we neglected to reset
+the bond's flags, which were still using flags like BROADCAST and
+MULTICAST. Consequently, this would initiate ARP/DAD for P2P downlink
+interfaces, such as when adding a GRE device to the bonding.
+
+To address this issue, let's reset the bond's flags for P2P interfaces.
+
+Before fix:
+7: gre0@NONE: <POINTOPOINT,NOARP,SLAVE,UP,LOWER_UP> mtu 1500 qdisc noqueue master bond0 state UNKNOWN group default qlen 1000
+    link/gre6 2006:70:10::1 peer 2006:70:10::2 permaddr 167f:18:f188::
+8: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
+    link/gre6 2006:70:10::1 brd 2006:70:10::2
+    inet6 fe80::200:ff:fe00:0/64 scope link
+       valid_lft forever preferred_lft forever
+
+After fix:
+7: gre0@NONE: <POINTOPOINT,NOARP,SLAVE,UP,LOWER_UP> mtu 1500 qdisc noqueue master bond2 state UNKNOWN group default qlen 1000
+    link/gre6 2006:70:10::1 peer 2006:70:10::2 permaddr c29e:557a:e9d9::
+8: bond0: <POINTOPOINT,NOARP,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
+    link/gre6 2006:70:10::1 peer 2006:70:10::2
+    inet6 fe80::1/64 scope link
+       valid_lft forever preferred_lft forever
+
+Reported-by: Liang Li <liali@redhat.com>
+Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2221438
+Fixes: 872254dd6b1f ("net/bonding: Enable bonding to enslave non ARPHRD_ETHER")
+Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/bonding/bond_main.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
+index 0ffca2890e9a3..e86b21f097b68 100644
+--- a/drivers/net/bonding/bond_main.c
++++ b/drivers/net/bonding/bond_main.c
+@@ -1134,6 +1134,11 @@ static void bond_setup_by_slave(struct net_device *bond_dev,
+       memcpy(bond_dev->broadcast, slave_dev->broadcast,
+               slave_dev->addr_len);
++
++      if (slave_dev->flags & IFF_POINTOPOINT) {
++              bond_dev->flags &= ~(IFF_BROADCAST | IFF_MULTICAST);
++              bond_dev->flags |= (IFF_POINTOPOINT | IFF_NOARP);
++      }
+ }
+ /* On bonding slaves other than the currently active slave, suppress
+-- 
+2.39.2
+
diff --git a/queue-4.14/ethernet-atheros-fix-return-value-check-in-atl1e_tso.patch b/queue-4.14/ethernet-atheros-fix-return-value-check-in-atl1e_tso.patch
new file mode 100644 (file)
index 0000000..d45454d
--- /dev/null
@@ -0,0 +1,44 @@
+From 00f28858ed252ebc451e958fe2b7216b85ad5ae3 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 20 Jul 2023 22:42:19 +0800
+Subject: ethernet: atheros: fix return value check in atl1e_tso_csum()
+
+From: Yuanjun Gong <ruc_gongyuanjun@163.com>
+
+[ Upstream commit 69a184f7a372aac588babfb0bd681aaed9779f5b ]
+
+in atl1e_tso_csum, it should check the return value of pskb_trim(),
+and return an error code if an unexpected value is returned
+by pskb_trim().
+
+Fixes: a6a5325239c2 ("atl1e: Atheros L1E Gigabit Ethernet driver")
+Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>
+Reviewed-by: Simon Horman <simon.horman@corigine.com>
+Link: https://lore.kernel.org/r/20230720144219.39285-1-ruc_gongyuanjun@163.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/atheros/atl1e/atl1e_main.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
+index 0d08039981b54..33a688d8aaba9 100644
+--- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
++++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
+@@ -1650,8 +1650,11 @@ static int atl1e_tso_csum(struct atl1e_adapter *adapter,
+                       real_len = (((unsigned char *)ip_hdr(skb) - skb->data)
+                                       + ntohs(ip_hdr(skb)->tot_len));
+-                      if (real_len < skb->len)
+-                              pskb_trim(skb, real_len);
++                      if (real_len < skb->len) {
++                              err = pskb_trim(skb, real_len);
++                              if (err)
++                                      return err;
++                      }
+                       hdr_len = (skb_transport_offset(skb) + tcp_hdrlen(skb));
+                       if (unlikely(skb->len == hdr_len)) {
+-- 
+2.39.2
+
diff --git a/queue-4.14/i40e-fix-an-null-vs-is_err-bug-for-debugfs_create_di.patch b/queue-4.14/i40e-fix-an-null-vs-is_err-bug-for-debugfs_create_di.patch
new file mode 100644 (file)
index 0000000..f193d20
--- /dev/null
@@ -0,0 +1,40 @@
+From 7a5db1ca28bbc3f5f983f58c9af65e1443c8db3c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 13 Jul 2023 09:42:39 +0800
+Subject: i40e: Fix an NULL vs IS_ERR() bug for debugfs_create_dir()
+
+From: Wang Ming <machel@vivo.com>
+
+[ Upstream commit 043b1f185fb0f3939b7427f634787706f45411c4 ]
+
+The debugfs_create_dir() function returns error pointers.
+It never returns NULL. Most incorrect error checks were fixed,
+but the one in i40e_dbg_init() was forgotten.
+
+Fix the remaining error check.
+
+Fixes: 02e9c290814c ("i40e: debugfs interface")
+Signed-off-by: Wang Ming <machel@vivo.com>
+Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
+Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
+index 126207be492d3..6cf38c7a157e1 100644
+--- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
++++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
+@@ -1850,7 +1850,7 @@ void i40e_dbg_pf_exit(struct i40e_pf *pf)
+ void i40e_dbg_init(void)
+ {
+       i40e_dbg_root = debugfs_create_dir(i40e_driver_name, NULL);
+-      if (!i40e_dbg_root)
++      if (IS_ERR(i40e_dbg_root))
+               pr_info("init of debugfs failed\n");
+ }
+-- 
+2.39.2
+
diff --git a/queue-4.14/ipv6-addrconf-fix-bug-where-deleting-a-mngtmpaddr-ca.patch b/queue-4.14/ipv6-addrconf-fix-bug-where-deleting-a-mngtmpaddr-ca.patch
new file mode 100644 (file)
index 0000000..89aca9f
--- /dev/null
@@ -0,0 +1,96 @@
+From cd96f9175443a52db109dd31dc63caece54f2cb4 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 20 Jul 2023 09:00:22 -0700
+Subject: ipv6 addrconf: fix bug where deleting a mngtmpaddr can create a new
+ temporary address
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Maciej Żenczykowski <maze@google.com>
+
+[ Upstream commit 69172f0bcb6a09110c5d2a6d792627f5095a9018 ]
+
+currently on 6.4 net/main:
+
+  # ip link add dummy1 type dummy
+  # echo 1 > /proc/sys/net/ipv6/conf/dummy1/use_tempaddr
+  # ip link set dummy1 up
+  # ip -6 addr add 2000::1/64 mngtmpaddr dev dummy1
+  # ip -6 addr show dev dummy1
+
+  11: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
+      inet6 2000::44f3:581c:8ca:3983/64 scope global temporary dynamic
+         valid_lft 604800sec preferred_lft 86172sec
+      inet6 2000::1/64 scope global mngtmpaddr
+         valid_lft forever preferred_lft forever
+      inet6 fe80::e8a8:a6ff:fed5:56d4/64 scope link
+         valid_lft forever preferred_lft forever
+
+  # ip -6 addr del 2000::44f3:581c:8ca:3983/64 dev dummy1
+
+  (can wait a few seconds if you want to, the above delete isn't [directly] the problem)
+
+  # ip -6 addr show dev dummy1
+
+  11: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
+      inet6 2000::1/64 scope global mngtmpaddr
+         valid_lft forever preferred_lft forever
+      inet6 fe80::e8a8:a6ff:fed5:56d4/64 scope link
+         valid_lft forever preferred_lft forever
+
+  # ip -6 addr del 2000::1/64 mngtmpaddr dev dummy1
+  # ip -6 addr show dev dummy1
+
+  11: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
+      inet6 2000::81c9:56b7:f51a:b98f/64 scope global temporary dynamic
+         valid_lft 604797sec preferred_lft 86169sec
+      inet6 fe80::e8a8:a6ff:fed5:56d4/64 scope link
+         valid_lft forever preferred_lft forever
+
+This patch prevents this new 'global temporary dynamic' address from being
+created by the deletion of the related (same subnet prefix) 'mngtmpaddr'
+(which is triggered by there already being no temporary addresses).
+
+Cc: Jiri Pirko <jiri@resnulli.us>
+Fixes: 53bd67491537 ("ipv6 addrconf: introduce IFA_F_MANAGETEMPADDR to tell kernel to manage temporary addresses")
+Reported-by: Xiao Ma <xiaom@google.com>
+Signed-off-by: Maciej Żenczykowski <maze@google.com>
+Reviewed-by: David Ahern <dsahern@kernel.org>
+Link: https://lore.kernel.org/r/20230720160022.1887942-1-maze@google.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/ipv6/addrconf.c | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
+index 6703a5b65e4a6..893b93cc5221a 100644
+--- a/net/ipv6/addrconf.c
++++ b/net/ipv6/addrconf.c
+@@ -2436,12 +2436,18 @@ static void manage_tempaddrs(struct inet6_dev *idev,
+                       ipv6_ifa_notify(0, ift);
+       }
+-      if ((create || list_empty(&idev->tempaddr_list)) &&
+-          idev->cnf.use_tempaddr > 0) {
++      /* Also create a temporary address if it's enabled but no temporary
++       * address currently exists.
++       * However, we get called with valid_lft == 0, prefered_lft == 0, create == false
++       * as part of cleanup (ie. deleting the mngtmpaddr).
++       * We don't want that to result in creating a new temporary ip address.
++       */
++      if (list_empty(&idev->tempaddr_list) && (valid_lft || prefered_lft))
++              create = true;
++
++      if (create && idev->cnf.use_tempaddr > 0) {
+               /* When a new public address is created as described
+                * in [ADDRCONF], also create a new temporary address.
+-               * Also create a temporary address if it's enabled but
+-               * no temporary address currently exists.
+                */
+               read_unlock_bh(&idev->lock);
+               ipv6_create_tempaddr(ifp, NULL);
+-- 
+2.39.2
+
diff --git a/queue-4.14/platform-x86-msi-laptop-fix-rfkill-out-of-sync-on-ms.patch b/queue-4.14/platform-x86-msi-laptop-fix-rfkill-out-of-sync-on-ms.patch
new file mode 100644 (file)
index 0000000..af76d52
--- /dev/null
@@ -0,0 +1,79 @@
+From b0796d1add6a8e8b5ce7b322ada38cff3c2d3610 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 21 Jul 2023 17:54:23 +0300
+Subject: platform/x86: msi-laptop: Fix rfkill out-of-sync on MSI Wind U100
+
+From: Maxim Mikityanskiy <maxtram95@gmail.com>
+
+[ Upstream commit ad084a6d99bc182bf109c190c808e2ea073ec57b ]
+
+Only the HW rfkill state is toggled on laptops with quirks->ec_read_only
+(so far only MSI Wind U90/U100). There are, however, a few issues with
+the implementation:
+
+1. The initial HW state is always unblocked, regardless of the actual
+   state on boot, because msi_init_rfkill only sets the SW state,
+   regardless of ec_read_only.
+
+2. The initial SW state corresponds to the actual state on boot, but it
+   can't be changed afterwards, because set_device_state returns
+   -EOPNOTSUPP. It confuses the userspace, making Wi-Fi and/or Bluetooth
+   unusable if it was blocked on boot, and breaking the airplane mode if
+   the rfkill was unblocked on boot.
+
+Address the above issues by properly initializing the HW state on
+ec_read_only laptops and by allowing the userspace to toggle the SW
+state. Don't set the SW state ourselves and let the userspace fully
+control it. Toggling the SW state is a no-op, however, it allows the
+userspace to properly toggle the airplane mode. The actual SW radio
+disablement is handled by the corresponding rtl818x_pci and btusb
+drivers that have their own rfkills.
+
+Tested on MSI Wind U100 Plus, BIOS ver 1.0G, EC ver 130.
+
+Fixes: 0816392b97d4 ("msi-laptop: merge quirk tables to one")
+Fixes: 0de6575ad0a8 ("msi-laptop: Add MSI Wind U90/U100 support")
+Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
+Link: https://lore.kernel.org/r/20230721145423.161057-1-maxtram95@gmail.com
+Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/platform/x86/msi-laptop.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
+index 42b31c549db00..1781e67781a55 100644
+--- a/drivers/platform/x86/msi-laptop.c
++++ b/drivers/platform/x86/msi-laptop.c
+@@ -223,7 +223,7 @@ static ssize_t set_device_state(const char *buf, size_t count, u8 mask)
+               return -EINVAL;
+       if (quirks->ec_read_only)
+-              return -EOPNOTSUPP;
++              return 0;
+       /* read current device state */
+       result = ec_read(MSI_STANDARD_EC_COMMAND_ADDRESS, &rdata);
+@@ -854,15 +854,15 @@ static bool msi_laptop_i8042_filter(unsigned char data, unsigned char str,
+ static void msi_init_rfkill(struct work_struct *ignored)
+ {
+       if (rfk_wlan) {
+-              rfkill_set_sw_state(rfk_wlan, !wlan_s);
++              msi_rfkill_set_state(rfk_wlan, !wlan_s);
+               rfkill_wlan_set(NULL, !wlan_s);
+       }
+       if (rfk_bluetooth) {
+-              rfkill_set_sw_state(rfk_bluetooth, !bluetooth_s);
++              msi_rfkill_set_state(rfk_bluetooth, !bluetooth_s);
+               rfkill_bluetooth_set(NULL, !bluetooth_s);
+       }
+       if (rfk_threeg) {
+-              rfkill_set_sw_state(rfk_threeg, !threeg_s);
++              msi_rfkill_set_state(rfk_threeg, !threeg_s);
+               rfkill_threeg_set(NULL, !threeg_s);
+       }
+ }
+-- 
+2.39.2
+
index 827edf8eeae9319935105c89b128f50cc4d26670..cb94638421c1fa640ee1df4896f247807fd8d658 100644 (file)
@@ -145,3 +145,11 @@ tcp-annotate-data-races-around-rskq_defer_accept.patch
 tcp-annotate-data-races-around-tp-notsent_lowat.patch
 tcp-annotate-data-races-around-fastopenq.max_qlen.patch
 gpio-tps68470-make-tps68470_gpio_output-always-set-t.patch
+i40e-fix-an-null-vs-is_err-bug-for-debugfs_create_di.patch
+ethernet-atheros-fix-return-value-check-in-atl1e_tso.patch
+ipv6-addrconf-fix-bug-where-deleting-a-mngtmpaddr-ca.patch
+tcp-reduce-chance-of-collisions-in-inet6_hashfn.patch
+bonding-reset-bond-s-flags-when-down-link-is-p2p-dev.patch
+team-reset-team-s-flags-when-down-link-is-p2p-device.patch
+platform-x86-msi-laptop-fix-rfkill-out-of-sync-on-ms.patch
+benet-fix-return-value-check-in-be_lancer_xmit_worka.patch
diff --git a/queue-4.14/tcp-reduce-chance-of-collisions-in-inet6_hashfn.patch b/queue-4.14/tcp-reduce-chance-of-collisions-in-inet6_hashfn.patch
new file mode 100644 (file)
index 0000000..1d7d7d2
--- /dev/null
@@ -0,0 +1,75 @@
+From 5e350e97b2a330cdae71c253cd6d1e10bfc8cd15 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 21 Jul 2023 15:24:10 -0700
+Subject: tcp: Reduce chance of collisions in inet6_hashfn().
+
+From: Stewart Smith <trawets@amazon.com>
+
+[ Upstream commit d11b0df7ddf1831f3e170972f43186dad520bfcc ]
+
+For both IPv4 and IPv6 incoming TCP connections are tracked in a hash
+table with a hash over the source & destination addresses and ports.
+However, the IPv6 hash is insufficient and can lead to a high rate of
+collisions.
+
+The IPv6 hash used an XOR to fit everything into the 96 bits for the
+fast jenkins hash, meaning it is possible for an external entity to
+ensure the hash collides, thus falling back to a linear search in the
+bucket, which is slow.
+
+We take the approach of hash the full length of IPv6 address in
+__ipv6_addr_jhash() so that all users can benefit from a more secure
+version.
+
+While this may look like it adds overhead, the reality of modern CPUs
+means that this is unmeasurable in real world scenarios.
+
+In simulating with llvm-mca, the increase in cycles for the hashing
+code was ~16 cycles on Skylake (from a base of ~155), and an extra ~9
+on Nehalem (base of ~173).
+
+In commit dd6d2910c5e0 ("netfilter: conntrack: switch to siphash")
+netfilter switched from a jenkins hash to a siphash, but even the faster
+hsiphash is a more significant overhead (~20-30%) in some preliminary
+testing.  So, in this patch, we keep to the more conservative approach to
+ensure we don't add much overhead per SYN.
+
+In testing, this results in a consistently even spread across the
+connection buckets.  In both testing and real-world scenarios, we have
+not found any measurable performance impact.
+
+Fixes: 08dcdbf6a7b9 ("ipv6: use a stronger hash for tcp")
+Signed-off-by: Stewart Smith <trawets@amazon.com>
+Signed-off-by: Samuel Mendoza-Jonas <samjonas@amazon.com>
+Suggested-by: Eric Dumazet <edumazet@google.com>
+Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
+Reviewed-by: Eric Dumazet <edumazet@google.com>
+Link: https://lore.kernel.org/r/20230721222410.17914-1-kuniyu@amazon.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ include/net/ipv6.h | 8 ++------
+ 1 file changed, 2 insertions(+), 6 deletions(-)
+
+diff --git a/include/net/ipv6.h b/include/net/ipv6.h
+index 7f7e90c1992fa..f127b9a1a3077 100644
+--- a/include/net/ipv6.h
++++ b/include/net/ipv6.h
+@@ -540,12 +540,8 @@ static inline u32 ipv6_addr_hash(const struct in6_addr *a)
+ /* more secured version of ipv6_addr_hash() */
+ static inline u32 __ipv6_addr_jhash(const struct in6_addr *a, const u32 initval)
+ {
+-      u32 v = (__force u32)a->s6_addr32[0] ^ (__force u32)a->s6_addr32[1];
+-
+-      return jhash_3words(v,
+-                          (__force u32)a->s6_addr32[2],
+-                          (__force u32)a->s6_addr32[3],
+-                          initval);
++      return jhash2((__force const u32 *)a->s6_addr32,
++                    ARRAY_SIZE(a->s6_addr32), initval);
+ }
+ static inline bool ipv6_addr_loopback(const struct in6_addr *a)
+-- 
+2.39.2
+
diff --git a/queue-4.14/team-reset-team-s-flags-when-down-link-is-p2p-device.patch b/queue-4.14/team-reset-team-s-flags-when-down-link-is-p2p-device.patch
new file mode 100644 (file)
index 0000000..dc6b84f
--- /dev/null
@@ -0,0 +1,52 @@
+From a7b278cce860638540538a213d49e2b94f46c2e2 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 21 Jul 2023 12:03:56 +0800
+Subject: team: reset team's flags when down link is P2P device
+
+From: Hangbin Liu <liuhangbin@gmail.com>
+
+[ Upstream commit fa532bee17d15acf8bba4bc8e2062b7a093ba801 ]
+
+When adding a point to point downlink to team device, we neglected to reset
+the team's flags, which were still using flags like BROADCAST and
+MULTICAST. Consequently, this would initiate ARP/DAD for P2P downlink
+interfaces, such as when adding a GRE device to team device. Fix this by
+remove multicast/broadcast flags and add p2p and noarp flags.
+
+After removing the none ethernet interface and adding an ethernet interface
+to team, we need to reset team interface flags. Unlike bonding interface,
+team do not need restore IFF_MASTER, IFF_SLAVE flags.
+
+Reported-by: Liang Li <liali@redhat.com>
+Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2221438
+Fixes: 1d76efe1577b ("team: add support for non-ethernet devices")
+Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/team/team.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
+index c7c1ff419d75d..b318464a4fcad 100644
+--- a/drivers/net/team/team.c
++++ b/drivers/net/team/team.c
+@@ -2095,6 +2095,15 @@ static void team_setup_by_port(struct net_device *dev,
+       dev->mtu = port_dev->mtu;
+       memcpy(dev->broadcast, port_dev->broadcast, port_dev->addr_len);
+       eth_hw_addr_inherit(dev, port_dev);
++
++      if (port_dev->flags & IFF_POINTOPOINT) {
++              dev->flags &= ~(IFF_BROADCAST | IFF_MULTICAST);
++              dev->flags |= (IFF_POINTOPOINT | IFF_NOARP);
++      } else if ((port_dev->flags & (IFF_BROADCAST | IFF_MULTICAST)) ==
++                  (IFF_BROADCAST | IFF_MULTICAST)) {
++              dev->flags |= (IFF_BROADCAST | IFF_MULTICAST);
++              dev->flags &= ~(IFF_POINTOPOINT | IFF_NOARP);
++      }
+ }
+ static int team_dev_type_check_change(struct net_device *dev,
+-- 
+2.39.2
+