From: Greg Kroah-Hartman Date: Thu, 17 Sep 2020 15:24:47 +0000 (+0200) Subject: 4.14-stable patches X-Git-Tag: v4.4.237~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1cb7c6714ececd1c5d5f1b8a856bcbb3a9aeb1e3;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: hv_netvsc-remove-unlikely-from-netvsc_select_queue.patch net-handle-the-return-value-of-pskb_carve_frag_list-correctly.patch --- 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 index 00000000000..09224e55293 --- /dev/null +++ b/queue-4.14/hv_netvsc-remove-unlikely-from-netvsc_select_queue.patch @@ -0,0 +1,34 @@ +From 4d820543c54c47a2bd3c95ddbf52f83c89a219a0 Mon Sep 17 00:00:00 2001 +From: Haiyang Zhang +Date: Thu, 20 Aug 2020 14:53:14 -0700 +Subject: hv_netvsc: Remove "unlikely" from netvsc_select_queue + +From: Haiyang Zhang + +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 +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..7c8216ef94b --- /dev/null +++ b/queue-4.14/net-handle-the-return-value-of-pskb_carve_frag_list-correctly.patch @@ -0,0 +1,40 @@ +From eabe861881a733fc84f286f4d5a1ffaddd4f526f Mon Sep 17 00:00:00 2001 +From: Miaohe Lin +Date: Sat, 15 Aug 2020 04:46:41 -0400 +Subject: net: handle the return value of pskb_carve_frag_list() correctly + +From: Miaohe Lin + +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 +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + 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); + diff --git a/queue-4.14/series b/queue-4.14/series index 93f408c95f3..e94033c9b66 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -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