]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.14
authorSasha Levin <sashal@kernel.org>
Sat, 25 Dec 2021 21:31:50 +0000 (16:31 -0500)
committerSasha Levin <sashal@kernel.org>
Sat, 25 Dec 2021 21:31:50 +0000 (16:31 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.14/bonding-fix-ad_actor_system-option-setting-to-defaul.patch [new file with mode: 0644]
queue-4.14/drivers-net-smc911x-check-for-error-irq.patch [new file with mode: 0644]
queue-4.14/fjes-check-for-error-irq.patch [new file with mode: 0644]
queue-4.14/ib-qib-fix-memory-leak-in-qib_user_sdma_queue_pkts.patch [new file with mode: 0644]
queue-4.14/net-accept-ufov6-packages-in-virtio_net_hdr_to_skb.patch [new file with mode: 0644]
queue-4.14/net-skip-virtio_net_hdr_set_proto-if-protocol-alread.patch [new file with mode: 0644]
queue-4.14/netfilter-fix-regression-in-looped-broad-multi-cast-.patch [new file with mode: 0644]
queue-4.14/qlcnic-potential-dereference-null-pointer-of-rx_queu.patch [new file with mode: 0644]
queue-4.14/series
queue-4.14/sfc-falcon-check-null-pointer-of-rx_queue-page_ring.patch [new file with mode: 0644]
queue-4.14/spi-change-clk_disable_unprepare-to-clk_unprepare.patch [new file with mode: 0644]

diff --git a/queue-4.14/bonding-fix-ad_actor_system-option-setting-to-defaul.patch b/queue-4.14/bonding-fix-ad_actor_system-option-setting-to-defaul.patch
new file mode 100644 (file)
index 0000000..e20686d
--- /dev/null
@@ -0,0 +1,65 @@
+From 8d122b4ebd82c5064a64b5ce2a71eb63df8aefa1 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 21 Dec 2021 12:13:45 +0100
+Subject: bonding: fix ad_actor_system option setting to default
+
+From: Fernando Fernandez Mancera <ffmancera@riseup.net>
+
+[ Upstream commit 1c15b05baea71a5ff98235783e3e4ad227760876 ]
+
+When 802.3ad bond mode is configured the ad_actor_system option is set to
+"00:00:00:00:00:00". But when trying to set the all-zeroes MAC as actors'
+system address it was failing with EINVAL.
+
+An all-zeroes ethernet address is valid, only multicast addresses are not
+valid values.
+
+Fixes: 171a42c38c6e ("bonding: add netlink support for sys prio, actor sys mac, and port key")
+Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
+Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com>
+Link: https://lore.kernel.org/r/20211221111345.2462-1-ffmancera@riseup.net
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ Documentation/networking/bonding.txt | 11 ++++++-----
+ drivers/net/bonding/bond_options.c   |  2 +-
+ 2 files changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt
+index 9ba04c0bab8db..f5d78c8005341 100644
+--- a/Documentation/networking/bonding.txt
++++ b/Documentation/networking/bonding.txt
+@@ -191,11 +191,12 @@ ad_actor_sys_prio
+ ad_actor_system
+       In an AD system, this specifies the mac-address for the actor in
+-      protocol packet exchanges (LACPDUs). The value cannot be NULL or
+-      multicast. It is preferred to have the local-admin bit set for this
+-      mac but driver does not enforce it. If the value is not given then
+-      system defaults to using the masters' mac address as actors' system
+-      address.
++      protocol packet exchanges (LACPDUs). The value cannot be a multicast
++      address. If the all-zeroes MAC is specified, bonding will internally
++      use the MAC of the bond itself. It is preferred to have the
++      local-admin bit set for this mac but driver does not enforce it. If
++      the value is not given then system defaults to using the masters'
++      mac address as actors' system address.
+       This parameter has effect only in 802.3ad mode and is available through
+       SysFs interface.
+diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
+index f24df859f0a7e..1e81b1cafae35 100644
+--- a/drivers/net/bonding/bond_options.c
++++ b/drivers/net/bonding/bond_options.c
+@@ -1443,7 +1443,7 @@ static int bond_option_ad_actor_system_set(struct bonding *bond,
+               mac = (u8 *)&newval->value;
+       }
+-      if (!is_valid_ether_addr(mac))
++      if (is_multicast_ether_addr(mac))
+               goto err;
+       netdev_dbg(bond->dev, "Setting ad_actor_system to %pM\n", mac);
+-- 
+2.34.1
+
diff --git a/queue-4.14/drivers-net-smc911x-check-for-error-irq.patch b/queue-4.14/drivers-net-smc911x-check-for-error-irq.patch
new file mode 100644 (file)
index 0000000..8ec7687
--- /dev/null
@@ -0,0 +1,40 @@
+From 44f55006765083c7b779d1f630896bc840279804 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 22 Dec 2021 15:41:12 +0800
+Subject: drivers: net: smc911x: Check for error irq
+
+From: Jiasheng Jiang <jiasheng@iscas.ac.cn>
+
+[ Upstream commit cb93b3e11d405f20a405a07482d01147ef4934a3 ]
+
+Because platform_get_irq() could fail and return error irq.
+Therefore, it might be better to check it if order to avoid the use of
+error irq.
+
+Fixes: ae150435b59e ("smsc: Move the SMC (SMSC) drivers")
+Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/smsc/smc911x.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/drivers/net/ethernet/smsc/smc911x.c b/drivers/net/ethernet/smsc/smc911x.c
+index f4f52a64f450a..56865ddd32502 100644
+--- a/drivers/net/ethernet/smsc/smc911x.c
++++ b/drivers/net/ethernet/smsc/smc911x.c
+@@ -2089,6 +2089,11 @@ static int smc911x_drv_probe(struct platform_device *pdev)
+       ndev->dma = (unsigned char)-1;
+       ndev->irq = platform_get_irq(pdev, 0);
++      if (ndev->irq < 0) {
++              ret = ndev->irq;
++              goto release_both;
++      }
++
+       lp = netdev_priv(ndev);
+       lp->netdev = ndev;
+ #ifdef SMC_DYNAMIC_BUS_CONFIG
+-- 
+2.34.1
+
diff --git a/queue-4.14/fjes-check-for-error-irq.patch b/queue-4.14/fjes-check-for-error-irq.patch
new file mode 100644 (file)
index 0000000..4ea26ba
--- /dev/null
@@ -0,0 +1,41 @@
+From b1ca7873df82ee53e873b179591c6c19cd9f1830 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 22 Dec 2021 15:12:07 +0800
+Subject: fjes: Check for error irq
+
+From: Jiasheng Jiang <jiasheng@iscas.ac.cn>
+
+[ Upstream commit db6d6afe382de5a65d6ccf51253ab48b8e8336c3 ]
+
+I find that platform_get_irq() will not always succeed.
+It will return error irq in case of the failure.
+Therefore, it might be better to check it if order to avoid the use of
+error irq.
+
+Fixes: 658d439b2292 ("fjes: Introduce FUJITSU Extended Socket Network Device driver")
+Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/fjes/fjes_main.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/drivers/net/fjes/fjes_main.c b/drivers/net/fjes/fjes_main.c
+index 26d3051591dac..9e8add3d93adc 100644
+--- a/drivers/net/fjes/fjes_main.c
++++ b/drivers/net/fjes/fjes_main.c
+@@ -1284,6 +1284,11 @@ static int fjes_probe(struct platform_device *plat_dev)
+       hw->hw_res.start = res->start;
+       hw->hw_res.size = resource_size(res);
+       hw->hw_res.irq = platform_get_irq(plat_dev, 0);
++      if (hw->hw_res.irq < 0) {
++              err = hw->hw_res.irq;
++              goto err_free_control_wq;
++      }
++
+       err = fjes_hw_init(&adapter->hw);
+       if (err)
+               goto err_free_control_wq;
+-- 
+2.34.1
+
diff --git a/queue-4.14/ib-qib-fix-memory-leak-in-qib_user_sdma_queue_pkts.patch b/queue-4.14/ib-qib-fix-memory-leak-in-qib_user_sdma_queue_pkts.patch
new file mode 100644 (file)
index 0000000..3741d43
--- /dev/null
@@ -0,0 +1,42 @@
+From 84170235c8a950b73a2b87b04c2e5d459c3c24d0 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 8 Dec 2021 18:52:38 +0100
+Subject: IB/qib: Fix memory leak in qib_user_sdma_queue_pkts()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: José Expósito <jose.exposito89@gmail.com>
+
+[ Upstream commit bee90911e0138c76ee67458ac0d58b38a3190f65 ]
+
+The wrong goto label was used for the error case and missed cleanup of the
+pkt allocation.
+
+Fixes: d39bf40e55e6 ("IB/qib: Protect from buffer overflow in struct qib_user_sdma_pkt fields")
+Link: https://lore.kernel.org/r/20211208175238.29983-1-jose.exposito89@gmail.com
+Addresses-Coverity-ID: 1493352 ("Resource leak")
+Signed-off-by: José Expósito <jose.exposito89@gmail.com>
+Acked-by: Mike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>
+Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/infiniband/hw/qib/qib_user_sdma.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/infiniband/hw/qib/qib_user_sdma.c b/drivers/infiniband/hw/qib/qib_user_sdma.c
+index 42329bbe4055f..0b6379bf76696 100644
+--- a/drivers/infiniband/hw/qib/qib_user_sdma.c
++++ b/drivers/infiniband/hw/qib/qib_user_sdma.c
+@@ -946,7 +946,7 @@ static int qib_user_sdma_queue_pkts(const struct qib_devdata *dd,
+                                              &addrlimit) ||
+                           addrlimit > type_max(typeof(pkt->addrlimit))) {
+                               ret = -EINVAL;
+-                              goto free_pbc;
++                              goto free_pkt;
+                       }
+                       pkt->addrlimit = addrlimit;
+-- 
+2.34.1
+
diff --git a/queue-4.14/net-accept-ufov6-packages-in-virtio_net_hdr_to_skb.patch b/queue-4.14/net-accept-ufov6-packages-in-virtio_net_hdr_to_skb.patch
new file mode 100644 (file)
index 0000000..067b3f8
--- /dev/null
@@ -0,0 +1,75 @@
+From 47bb12cf19b4f68450668c5c8ee7f2138cb3fdb4 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 20 Dec 2021 09:49:01 -0500
+Subject: net: accept UFOv6 packages in virtio_net_hdr_to_skb
+
+From: Willem de Bruijn <willemb@google.com>
+
+[ Upstream commit 7e5cced9ca84df52d874aca6b632f930b3dc5bc6 ]
+
+Skb with skb->protocol 0 at the time of virtio_net_hdr_to_skb may have
+a protocol inferred from virtio_net_hdr with virtio_net_hdr_set_proto.
+
+Unlike TCP, UDP does not have separate types for IPv4 and IPv6. Type
+VIRTIO_NET_HDR_GSO_UDP is guessed to be IPv4/UDP. As of the below
+commit, UFOv6 packets are dropped due to not matching the protocol as
+obtained from dev_parse_header_protocol.
+
+Invert the test to take that L2 protocol field as starting point and
+pass both UFOv4 and UFOv6 for VIRTIO_NET_HDR_GSO_UDP.
+
+Fixes: 924a9bc362a5 ("net: check if protocol extracted by virtio_net_hdr_set_proto is correct")
+Link: https://lore.kernel.org/netdev/CABcq3pG9GRCYqFDBAJ48H1vpnnX=41u+MhQnayF1ztLH4WX0Fw@mail.gmail.com/
+Reported-by: Andrew Melnichenko <andrew@daynix.com>
+Signed-off-by: Willem de Bruijn <willemb@google.com>
+Link: https://lore.kernel.org/r/20211220144901.2784030-1-willemdebruijn.kernel@gmail.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ include/linux/virtio_net.h | 22 ++++++++++++++++++++--
+ 1 file changed, 20 insertions(+), 2 deletions(-)
+
+diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
+index 162761f72c142..f5876f7a2ab24 100644
+--- a/include/linux/virtio_net.h
++++ b/include/linux/virtio_net.h
+@@ -7,6 +7,21 @@
+ #include <uapi/linux/udp.h>
+ #include <uapi/linux/virtio_net.h>
++static inline bool virtio_net_hdr_match_proto(__be16 protocol, __u8 gso_type)
++{
++      switch (gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
++      case VIRTIO_NET_HDR_GSO_TCPV4:
++              return protocol == cpu_to_be16(ETH_P_IP);
++      case VIRTIO_NET_HDR_GSO_TCPV6:
++              return protocol == cpu_to_be16(ETH_P_IPV6);
++      case VIRTIO_NET_HDR_GSO_UDP:
++              return protocol == cpu_to_be16(ETH_P_IP) ||
++                     protocol == cpu_to_be16(ETH_P_IPV6);
++      default:
++              return false;
++      }
++}
++
+ static inline int virtio_net_hdr_set_proto(struct sk_buff *skb,
+                                          const struct virtio_net_hdr *hdr)
+ {
+@@ -88,9 +103,12 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb,
+                       if (!skb->protocol) {
+                               __be16 protocol = dev_parse_header_protocol(skb);
+-                              virtio_net_hdr_set_proto(skb, hdr);
+-                              if (protocol && protocol != skb->protocol)
++                              if (!protocol)
++                                      virtio_net_hdr_set_proto(skb, hdr);
++                              else if (!virtio_net_hdr_match_proto(protocol, hdr->gso_type))
+                                       return -EINVAL;
++                              else
++                                      skb->protocol = protocol;
+                       }
+ retry:
+                       if (!skb_flow_dissect_flow_keys(skb, &keys, 0)) {
+-- 
+2.34.1
+
diff --git a/queue-4.14/net-skip-virtio_net_hdr_set_proto-if-protocol-alread.patch b/queue-4.14/net-skip-virtio_net_hdr_set_proto-if-protocol-alread.patch
new file mode 100644 (file)
index 0000000..a1a7fa7
--- /dev/null
@@ -0,0 +1,46 @@
+From 9388f30df3e76ab40127efe9050387d42e95d571 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 20 Dec 2021 09:50:27 -0500
+Subject: net: skip virtio_net_hdr_set_proto if protocol already set
+
+From: Willem de Bruijn <willemb@google.com>
+
+[ Upstream commit 1ed1d592113959f00cc552c3b9f47ca2d157768f ]
+
+virtio_net_hdr_set_proto infers skb->protocol from the virtio_net_hdr
+gso_type, to avoid packets getting dropped for lack of a proto type.
+
+Its protocol choice is a guess, especially in the case of UFO, where
+the single VIRTIO_NET_HDR_GSO_UDP label covers both UFOv4 and UFOv6.
+
+Skip this best effort if the field is already initialized. Whether
+explicitly from userspace, or implicitly based on an earlier call to
+dev_parse_header_protocol (which is more robust, but was introduced
+after this patch).
+
+Fixes: 9d2f67e43b73 ("net/packet: fix packet drop as of virtio gso")
+Signed-off-by: Willem de Bruijn <willemb@google.com>
+Link: https://lore.kernel.org/r/20211220145027.2784293-1-willemdebruijn.kernel@gmail.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ include/linux/virtio_net.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
+index f5876f7a2ab24..db8ab0fac81a2 100644
+--- a/include/linux/virtio_net.h
++++ b/include/linux/virtio_net.h
+@@ -25,6 +25,9 @@ static inline bool virtio_net_hdr_match_proto(__be16 protocol, __u8 gso_type)
+ static inline int virtio_net_hdr_set_proto(struct sk_buff *skb,
+                                          const struct virtio_net_hdr *hdr)
+ {
++      if (skb->protocol)
++              return 0;
++
+       switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
+       case VIRTIO_NET_HDR_GSO_TCPV4:
+       case VIRTIO_NET_HDR_GSO_UDP:
+-- 
+2.34.1
+
diff --git a/queue-4.14/netfilter-fix-regression-in-looped-broad-multi-cast-.patch b/queue-4.14/netfilter-fix-regression-in-looped-broad-multi-cast-.patch
new file mode 100644 (file)
index 0000000..88f1a98
--- /dev/null
@@ -0,0 +1,69 @@
+From 912e62aca31c0281aabec34d7a1b9bb68bfda22e Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 10 Dec 2021 16:31:27 +0100
+Subject: netfilter: fix regression in looped (broad|multi)cast's MAC handling
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Ignacy Gawędzki <ignacy.gawedzki@green-communications.fr>
+
+[ Upstream commit ebb966d3bdfed581ecccbb4a7432341baf7619b4 ]
+
+In commit 5648b5e1169f ("netfilter: nfnetlink_queue: fix OOB when mac
+header was cleared"), the test for non-empty MAC header introduced in
+commit 2c38de4c1f8da7 ("netfilter: fix looped (broad|multi)cast's MAC
+handling") has been replaced with a test for a set MAC header.
+
+This breaks the case when the MAC header has been reset (using
+skb_reset_mac_header), as is the case with looped-back multicast
+packets.  As a result, the packets ending up in NFQUEUE get a bogus
+hwaddr interpreted from the first bytes of the IP header.
+
+This patch adds a test for a non-empty MAC header in addition to the
+test for a set MAC header.  The same two tests are also implemented in
+nfnetlink_log.c, where the initial code of commit 2c38de4c1f8da7
+("netfilter: fix looped (broad|multi)cast's MAC handling") has not been
+touched, but where supposedly the same situation may happen.
+
+Fixes: 5648b5e1169f ("netfilter: nfnetlink_queue: fix OOB when mac header was cleared")
+Signed-off-by: Ignacy Gawędzki <ignacy.gawedzki@green-communications.fr>
+Reviewed-by: Florian Westphal <fw@strlen.de>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/netfilter/nfnetlink_log.c   | 3 ++-
+ net/netfilter/nfnetlink_queue.c | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
+index cad6498f10b03..0ccc7c851a788 100644
+--- a/net/netfilter/nfnetlink_log.c
++++ b/net/netfilter/nfnetlink_log.c
+@@ -510,7 +510,8 @@ __build_packet_message(struct nfnl_log_net *log,
+               goto nla_put_failure;
+       if (indev && skb->dev &&
+-          skb->mac_header != skb->network_header) {
++          skb_mac_header_was_set(skb) &&
++          skb_mac_header_len(skb) != 0) {
+               struct nfulnl_msg_packet_hw phw;
+               int len;
+diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
+index 13e67eb75d841..26f563bbb58de 100644
+--- a/net/netfilter/nfnetlink_queue.c
++++ b/net/netfilter/nfnetlink_queue.c
+@@ -543,7 +543,8 @@ nfqnl_build_packet_message(struct net *net, struct nfqnl_instance *queue,
+               goto nla_put_failure;
+       if (indev && entskb->dev &&
+-          skb_mac_header_was_set(entskb)) {
++          skb_mac_header_was_set(entskb) &&
++          skb_mac_header_len(entskb) != 0) {
+               struct nfqnl_msg_packet_hw phw;
+               int len;
+-- 
+2.34.1
+
diff --git a/queue-4.14/qlcnic-potential-dereference-null-pointer-of-rx_queu.patch b/queue-4.14/qlcnic-potential-dereference-null-pointer-of-rx_queu.patch
new file mode 100644 (file)
index 0000000..048a36e
--- /dev/null
@@ -0,0 +1,103 @@
+From ee282c4bbfa04e724b7b5d3aeaa233ff0a8692d2 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 17 Dec 2021 17:39:11 +0800
+Subject: qlcnic: potential dereference null pointer of rx_queue->page_ring
+
+From: Jiasheng Jiang <jiasheng@iscas.ac.cn>
+
+[ Upstream commit 60ec7fcfe76892a1479afab51ff17a4281923156 ]
+
+The return value of kcalloc() needs to be checked.
+To avoid dereference of null pointer in case of the failure of alloc.
+Therefore, it might be better to change the return type of
+qlcnic_sriov_alloc_vlans() and return -ENOMEM when alloc fails and
+return 0 the others.
+Also, qlcnic_sriov_set_guest_vlan_mode() and __qlcnic_pci_sriov_enable()
+should deal with the return value of qlcnic_sriov_alloc_vlans().
+
+Fixes: 154d0c810c53 ("qlcnic: VLAN enhancement for 84XX adapters")
+Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h    |  2 +-
+ .../net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c | 12 +++++++++---
+ drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c |  4 +++-
+ 3 files changed, 13 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h
+index 5f327659efa7a..85b688f60b876 100644
+--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h
++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h
+@@ -202,7 +202,7 @@ int qlcnic_sriov_get_vf_vport_info(struct qlcnic_adapter *,
+                                  struct qlcnic_info *, u16);
+ int qlcnic_sriov_cfg_vf_guest_vlan(struct qlcnic_adapter *, u16, u8);
+ void qlcnic_sriov_free_vlans(struct qlcnic_adapter *);
+-void qlcnic_sriov_alloc_vlans(struct qlcnic_adapter *);
++int qlcnic_sriov_alloc_vlans(struct qlcnic_adapter *);
+ bool qlcnic_sriov_check_any_vlan(struct qlcnic_vf_info *);
+ void qlcnic_sriov_del_vlan_id(struct qlcnic_sriov *,
+                             struct qlcnic_vf_info *, u16);
+diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
+index c58180f408448..44caa7c2077ec 100644
+--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
+@@ -433,7 +433,7 @@ static int qlcnic_sriov_set_guest_vlan_mode(struct qlcnic_adapter *adapter,
+                                           struct qlcnic_cmd_args *cmd)
+ {
+       struct qlcnic_sriov *sriov = adapter->ahw->sriov;
+-      int i, num_vlans;
++      int i, num_vlans, ret;
+       u16 *vlans;
+       if (sriov->allowed_vlans)
+@@ -444,7 +444,9 @@ static int qlcnic_sriov_set_guest_vlan_mode(struct qlcnic_adapter *adapter,
+       dev_info(&adapter->pdev->dev, "Number of allowed Guest VLANs = %d\n",
+                sriov->num_allowed_vlans);
+-      qlcnic_sriov_alloc_vlans(adapter);
++      ret = qlcnic_sriov_alloc_vlans(adapter);
++      if (ret)
++              return ret;
+       if (!sriov->any_vlan)
+               return 0;
+@@ -2164,7 +2166,7 @@ static int qlcnic_sriov_vf_resume(struct qlcnic_adapter *adapter)
+       return err;
+ }
+-void qlcnic_sriov_alloc_vlans(struct qlcnic_adapter *adapter)
++int qlcnic_sriov_alloc_vlans(struct qlcnic_adapter *adapter)
+ {
+       struct qlcnic_sriov *sriov = adapter->ahw->sriov;
+       struct qlcnic_vf_info *vf;
+@@ -2174,7 +2176,11 @@ void qlcnic_sriov_alloc_vlans(struct qlcnic_adapter *adapter)
+               vf = &sriov->vf_info[i];
+               vf->sriov_vlans = kcalloc(sriov->num_allowed_vlans,
+                                         sizeof(*vf->sriov_vlans), GFP_KERNEL);
++              if (!vf->sriov_vlans)
++                      return -ENOMEM;
+       }
++
++      return 0;
+ }
+ void qlcnic_sriov_free_vlans(struct qlcnic_adapter *adapter)
+diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
+index 50eaafa3eaba3..c9f2cd2462230 100644
+--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
+@@ -598,7 +598,9 @@ static int __qlcnic_pci_sriov_enable(struct qlcnic_adapter *adapter,
+       if (err)
+               goto del_flr_queue;
+-      qlcnic_sriov_alloc_vlans(adapter);
++      err = qlcnic_sriov_alloc_vlans(adapter);
++      if (err)
++              goto del_flr_queue;
+       return err;
+-- 
+2.34.1
+
index 9f87a9b2c38a6e4022ecdc6a0cf097d5e2abfc35..f01550a1d41fd973cd8e9bab8a3e70c18f72d892 100644 (file)
@@ -1,3 +1,13 @@
 net-usb-lan78xx-add-allied-telesis-at29m2-af.patch
 can-kvaser_usb-get-can-clock-frequency-from-device.patch
 hid-holtek-fix-mouse-probing.patch
+spi-change-clk_disable_unprepare-to-clk_unprepare.patch
+ib-qib-fix-memory-leak-in-qib_user_sdma_queue_pkts.patch
+netfilter-fix-regression-in-looped-broad-multi-cast-.patch
+qlcnic-potential-dereference-null-pointer-of-rx_queu.patch
+net-accept-ufov6-packages-in-virtio_net_hdr_to_skb.patch
+net-skip-virtio_net_hdr_set_proto-if-protocol-alread.patch
+bonding-fix-ad_actor_system-option-setting-to-defaul.patch
+fjes-check-for-error-irq.patch
+drivers-net-smc911x-check-for-error-irq.patch
+sfc-falcon-check-null-pointer-of-rx_queue-page_ring.patch
diff --git a/queue-4.14/sfc-falcon-check-null-pointer-of-rx_queue-page_ring.patch b/queue-4.14/sfc-falcon-check-null-pointer-of-rx_queue-page_ring.patch
new file mode 100644 (file)
index 0000000..9d60af8
--- /dev/null
@@ -0,0 +1,42 @@
+From 4171820f69a52453e23bc1678cf391e4a29a300d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 20 Dec 2021 22:03:44 +0800
+Subject: sfc: falcon: Check null pointer of rx_queue->page_ring
+
+From: Jiasheng Jiang <jiasheng@iscas.ac.cn>
+
+[ Upstream commit 9b8bdd1eb5890aeeab7391dddcf8bd51f7b07216 ]
+
+Because of the possible failure of the kcalloc, it should be better to
+set rx_queue->page_ptr_mask to 0 when it happens in order to maintain
+the consistency.
+
+Fixes: 5a6681e22c14 ("sfc: separate out SFC4000 ("Falcon") support into new sfc-falcon driver")
+Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
+Acked-by: Martin Habets <habetsm.xilinx@gmail.com>
+Link: https://lore.kernel.org/r/20211220140344.978408-1-jiasheng@iscas.ac.cn
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/sfc/falcon/rx.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/net/ethernet/sfc/falcon/rx.c b/drivers/net/ethernet/sfc/falcon/rx.c
+index 6a8406dc0c2b4..06f556d373949 100644
+--- a/drivers/net/ethernet/sfc/falcon/rx.c
++++ b/drivers/net/ethernet/sfc/falcon/rx.c
+@@ -732,7 +732,10 @@ static void ef4_init_rx_recycle_ring(struct ef4_nic *efx,
+                                           efx->rx_bufs_per_page);
+       rx_queue->page_ring = kcalloc(page_ring_size,
+                                     sizeof(*rx_queue->page_ring), GFP_KERNEL);
+-      rx_queue->page_ptr_mask = page_ring_size - 1;
++      if (!rx_queue->page_ring)
++              rx_queue->page_ptr_mask = 0;
++      else
++              rx_queue->page_ptr_mask = page_ring_size - 1;
+ }
+ void ef4_init_rx_queue(struct ef4_rx_queue *rx_queue)
+-- 
+2.34.1
+
diff --git a/queue-4.14/spi-change-clk_disable_unprepare-to-clk_unprepare.patch b/queue-4.14/spi-change-clk_disable_unprepare-to-clk_unprepare.patch
new file mode 100644 (file)
index 0000000..da7db10
--- /dev/null
@@ -0,0 +1,39 @@
+From f18196677d3d1db1faa8f4cbc93f718245850b66 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 6 Dec 2021 18:19:31 +0800
+Subject: spi: change clk_disable_unprepare to clk_unprepare
+
+From: Dongliang Mu <mudongliangabcd@gmail.com>
+
+[ Upstream commit db6689b643d8653092f5853751ea2cdbc299f8d3 ]
+
+The corresponding API for clk_prepare is clk_unprepare, other than
+clk_disable_unprepare.
+
+Fix this by changing clk_disable_unprepare to clk_unprepare.
+
+Fixes: 5762ab71eb24 ("spi: Add support for Armada 3700 SPI Controller")
+Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
+Link: https://lore.kernel.org/r/20211206101931.2816597-1-mudongliangabcd@gmail.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/spi/spi-armada-3700.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/spi/spi-armada-3700.c b/drivers/spi/spi-armada-3700.c
+index 4903f15177cfd..8fedf83585d41 100644
+--- a/drivers/spi/spi-armada-3700.c
++++ b/drivers/spi/spi-armada-3700.c
+@@ -852,7 +852,7 @@ static int a3700_spi_probe(struct platform_device *pdev)
+       return 0;
+ error_clk:
+-      clk_disable_unprepare(spi->clk);
++      clk_unprepare(spi->clk);
+ error:
+       spi_master_put(master);
+ out:
+-- 
+2.34.1
+