From: Greg Kroah-Hartman Date: Mon, 31 May 2021 08:18:13 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v4.4.271~31 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ea38df95a22e849fdf6054af602a86ab7e06ab72;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: net-hns3-check-the-return-of-skb_checksum_help.patch --- diff --git a/queue-5.4/net-hns3-check-the-return-of-skb_checksum_help.patch b/queue-5.4/net-hns3-check-the-return-of-skb_checksum_help.patch new file mode 100644 index 00000000000..667c951e169 --- /dev/null +++ b/queue-5.4/net-hns3-check-the-return-of-skb_checksum_help.patch @@ -0,0 +1,64 @@ +From 9bb5a495424fd4bfa672eb1f31481248562fa156 Mon Sep 17 00:00:00 2001 +From: Yunsheng Lin +Date: Tue, 18 May 2021 19:36:03 +0800 +Subject: net: hns3: check the return of skb_checksum_help() + +From: Yunsheng Lin + +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 +Signed-off-by: Huazhong Tan +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + 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 +@@ -810,8 +810,6 @@ static bool hns3_tunnel_csum_bug(struct + l4.udp->dest == htons(4790)))) + return false; + +- skb_checksum_help(skb); +- + return true; + } + +@@ -889,8 +887,7 @@ static int hns3_set_l2l3l4(struct sk_buf + /* 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); + } + + hns3_set_outer_l2l3l4(skb, ol4_proto, ol_type_vlan_len_msec); +@@ -935,7 +932,7 @@ static int hns3_set_l2l3l4(struct sk_buf + break; + case IPPROTO_UDP: + if (hns3_tunnel_csum_bug(skb)) +- break; ++ return skb_checksum_help(skb); + + hns3_set_field(*type_cs_vlan_tso, HNS3_TXD_L4CS_B, 1); + hns3_set_field(*type_cs_vlan_tso, HNS3_TXD_L4T_S, +@@ -960,8 +957,7 @@ static int hns3_set_l2l3l4(struct sk_buf + /* 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; diff --git a/queue-5.4/series b/queue-5.4/series index 7318873b594..420dba29761 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -170,3 +170,4 @@ mips-ralink-export-rt_sysc_membase-for-rt2880_wdt.c.patch drm-i915-display-fix-compiler-warning-about-array-overrun.patch i915-fix-build-warning-in-intel_dp_get_link_status.patch drivers-net-ethernet-clean-up-unused-assignments.patch +net-hns3-check-the-return-of-skb_checksum_help.patch