]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 31 May 2021 08:17:50 +0000 (10:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 31 May 2021 08:17:50 +0000 (10:17 +0200)
added patches:
net-hns3-check-the-return-of-skb_checksum_help.patch

queue-4.19/net-hns3-check-the-return-of-skb_checksum_help.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/net-hns3-check-the-return-of-skb_checksum_help.patch b/queue-4.19/net-hns3-check-the-return-of-skb_checksum_help.patch
new file mode 100644 (file)
index 0000000..abe6bcf
--- /dev/null
@@ -0,0 +1,64 @@
+From 9bb5a495424fd4bfa672eb1f31481248562fa156 Mon Sep 17 00:00:00 2001
+From: Yunsheng Lin <linyunsheng@huawei.com>
+Date: Tue, 18 May 2021 19:36:03 +0800
+Subject: net: hns3: check the return of skb_checksum_help()
+
+From: Yunsheng Lin <linyunsheng@huawei.com>
+
+commit 9bb5a495424fd4bfa672eb1f31481248562fa156 upstream.
+
+Currently skb_checksum_help()'s return is ignored, but it may
+return error when it fails to allocate memory when linearizing.
+
+So adds checking for the return of skb_checksum_help().
+
+Fixes: 76ad4f0ee747("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
+Fixes: 3db084d28dc0("net: hns3: Fix for vxlan tx checksum bug")
+Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
+Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/hisilicon/hns3/hns3_enet.c |   10 +++-------
+ 1 file changed, 3 insertions(+), 7 deletions(-)
+
+--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
++++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+@@ -702,8 +702,6 @@ static bool hns3_tunnel_csum_bug(struct
+       if (!(!skb->encapsulation && l4.udp->dest == htons(IANA_VXLAN_PORT)))
+               return false;
+-      skb_checksum_help(skb);
+-
+       return true;
+ }
+@@ -764,8 +762,7 @@ static int hns3_set_l3l4_type_csum(struc
+                       /* the stack computes the IP header already,
+                        * driver calculate l4 checksum when not TSO.
+                        */
+-                      skb_checksum_help(skb);
+-                      return 0;
++                      return skb_checksum_help(skb);
+               }
+               l3.hdr = skb_inner_network_header(skb);
+@@ -796,7 +793,7 @@ static int hns3_set_l3l4_type_csum(struc
+               break;
+       case IPPROTO_UDP:
+               if (hns3_tunnel_csum_bug(skb))
+-                      break;
++                      return skb_checksum_help(skb);
+               hnae3_set_bit(*type_cs_vlan_tso, HNS3_TXD_L4CS_B, 1);
+               hnae3_set_field(*type_cs_vlan_tso,
+@@ -821,8 +818,7 @@ static int hns3_set_l3l4_type_csum(struc
+               /* the stack computes the IP header already,
+                * driver calculate l4 checksum when not TSO.
+                */
+-              skb_checksum_help(skb);
+-              return 0;
++              return skb_checksum_help(skb);
+       }
+       return 0;
index 4cf1763e1ca120d9c1b8a7dc05d447a5ac1c366a..d8d64340eb8fa44fb75b3b5abfe35eb09efbe44f 100644 (file)
@@ -114,3 +114,4 @@ mips-alchemy-xxs1500-add-gpio-au1000.h-header-file.patch
 mips-ralink-export-rt_sysc_membase-for-rt2880_wdt.c.patch
 hugetlbfs-hugetlb_fault_mutex_hash-cleanup.patch
 drivers-net-ethernet-clean-up-unused-assignments.patch
+net-hns3-check-the-return-of-skb_checksum_help.patch