]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Sep 2020 15:24:47 +0000 (17:24 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Sep 2020 15:24:47 +0000 (17:24 +0200)
added patches:
hv_netvsc-remove-unlikely-from-netvsc_select_queue.patch
net-handle-the-return-value-of-pskb_carve_frag_list-correctly.patch

queue-4.14/hv_netvsc-remove-unlikely-from-netvsc_select_queue.patch [new file with mode: 0644]
queue-4.14/net-handle-the-return-value-of-pskb_carve_frag_list-correctly.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/hv_netvsc-remove-unlikely-from-netvsc_select_queue.patch b/queue-4.14/hv_netvsc-remove-unlikely-from-netvsc_select_queue.patch
new file mode 100644 (file)
index 0000000..09224e5
--- /dev/null
@@ -0,0 +1,34 @@
+From 4d820543c54c47a2bd3c95ddbf52f83c89a219a0 Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Thu, 20 Aug 2020 14:53:14 -0700
+Subject: hv_netvsc: Remove "unlikely" from netvsc_select_queue
+
+From: Haiyang Zhang <haiyangz@microsoft.com>
+
+commit 4d820543c54c47a2bd3c95ddbf52f83c89a219a0 upstream.
+
+When using vf_ops->ndo_select_queue, the number of queues of VF is
+usually bigger than the synthetic NIC. This condition may happen
+often.
+Remove "unlikely" from the comparison of ndev->real_num_tx_queues.
+
+Fixes: b3bf5666a510 ("hv_netvsc: defer queue selection to VF")
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/hyperv/netvsc_drv.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -365,7 +365,7 @@ static u16 netvsc_select_queue(struct ne
+       }
+       rcu_read_unlock();
+-      while (unlikely(txq >= ndev->real_num_tx_queues))
++      while (txq >= ndev->real_num_tx_queues)
+               txq -= ndev->real_num_tx_queues;
+       return txq;
diff --git a/queue-4.14/net-handle-the-return-value-of-pskb_carve_frag_list-correctly.patch b/queue-4.14/net-handle-the-return-value-of-pskb_carve_frag_list-correctly.patch
new file mode 100644 (file)
index 0000000..7c8216e
--- /dev/null
@@ -0,0 +1,40 @@
+From eabe861881a733fc84f286f4d5a1ffaddd4f526f Mon Sep 17 00:00:00 2001
+From: Miaohe Lin <linmiaohe@huawei.com>
+Date: Sat, 15 Aug 2020 04:46:41 -0400
+Subject: net: handle the return value of pskb_carve_frag_list() correctly
+
+From: Miaohe Lin <linmiaohe@huawei.com>
+
+commit eabe861881a733fc84f286f4d5a1ffaddd4f526f upstream.
+
+pskb_carve_frag_list() may return -ENOMEM in pskb_carve_inside_nonlinear().
+we should handle this correctly or we would get wrong sk_buff.
+
+Fixes: 6fa01ccd8830 ("skbuff: Add pskb_extract() helper function")
+Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/core/skbuff.c |   10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+--- a/net/core/skbuff.c
++++ b/net/core/skbuff.c
+@@ -5447,9 +5447,13 @@ static int pskb_carve_inside_nonlinear(s
+       if (skb_has_frag_list(skb))
+               skb_clone_fraglist(skb);
+-      if (k == 0) {
+-              /* split line is in frag list */
+-              pskb_carve_frag_list(skb, shinfo, off - pos, gfp_mask);
++      /* split line is in frag list */
++      if (k == 0 && pskb_carve_frag_list(skb, shinfo, off - pos, gfp_mask)) {
++              /* skb_frag_unref() is not needed here as shinfo->nr_frags = 0. */
++              if (skb_has_frag_list(skb))
++                      kfree_skb_list(skb_shinfo(skb)->frag_list);
++              kfree(data);
++              return -ENOMEM;
+       }
+       skb_release_data(skb);
index 93f408c95f38cf07d3ea2d15547348bb2eb7aba2..e94033c9b66d46f905cecf92678120ff17ba0e53 100644 (file)
@@ -59,3 +59,5 @@ usb-fix-out-of-sync-data-toggle-if-a-configured-device-is-reconfigured.patch
 usb-typec-ucsi-acpi-check-the-_dep-dependencies.patch
 gcov-add-support-for-gcc-10.1.patch
 gfs2-initialize-transaction-tr_ailx_lists-earlier.patch
+net-handle-the-return-value-of-pskb_carve_frag_list-correctly.patch
+hv_netvsc-remove-unlikely-from-netvsc_select_queue.patch