From: Greg Kroah-Hartman Date: Fri, 25 Feb 2022 15:39:00 +0000 (+0100) Subject: 4.14-stable patches X-Git-Tag: v4.9.304~50 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f5bc1623883aeebb1063f29c1a0cb955e4b9d1a2;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: drm-edid-always-set-rgb444.patch gso-do-not-skip-outer-ip-header-in-case-of-ipip-and-net_failover.patch net-__pskb_pull_tail-pskb_carve_frag_list-drop_monitor-friends.patch net-mlx5e-fix-wrong-return-value-on-ioctl-eeprom-query-failure.patch openvswitch-fix-setting-ipv6-fields-causing-hw-csum-failure.patch ping-remove-pr_err-from-ping_lookup.patch --- diff --git a/queue-4.14/drm-edid-always-set-rgb444.patch b/queue-4.14/drm-edid-always-set-rgb444.patch new file mode 100644 index 00000000000..d2919a295c5 --- /dev/null +++ b/queue-4.14/drm-edid-always-set-rgb444.patch @@ -0,0 +1,65 @@ +From ecbd4912a693b862e25cba0a6990a8c95b00721e Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Thu, 3 Feb 2022 12:54:16 +0100 +Subject: drm/edid: Always set RGB444 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Maxime Ripard + +commit ecbd4912a693b862e25cba0a6990a8c95b00721e upstream. + +In order to fill the drm_display_info structure each time an EDID is +read, the code currently will call drm_add_display_info with the parsed +EDID. + +drm_add_display_info will then call drm_reset_display_info to reset all +the fields to 0, and then set them to the proper value depending on the +EDID. + +In the color_formats case, we will thus report that we don't support any +color format, and then fill it back with RGB444 plus the additional +formats described in the EDID Feature Support byte. + +However, since that byte only contains format-related bits since the 1.4 +specification, this doesn't happen if the EDID is following an earlier +specification. In turn, it means that for one of these EDID, we end up +with color_formats set to 0. + +The EDID 1.3 specification never really specifies what it means by RGB +exactly, but since both HDMI and DVI will use RGB444, it's fairly safe +to assume it's supposed to be RGB444. + +Let's move the addition of RGB444 to color_formats earlier in +drm_add_display_info() so that it's always set for a digital display. + +Fixes: da05a5a71ad8 ("drm: parse color format support for digital displays") +Cc: Ville Syrjälä +Reported-by: Matthias Reichl +Signed-off-by: Maxime Ripard +Reviewed-by: Ville Syrjälä +Link: https://patchwork.freedesktop.org/patch/msgid/20220203115416.1137308-1-maxime@cerno.tech +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/drm_edid.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/drm_edid.c ++++ b/drivers/gpu/drm/drm_edid.c +@@ -4418,6 +4418,7 @@ static void drm_add_display_info(struct + if (!(edid->input & DRM_EDID_INPUT_DIGITAL)) + return; + ++ info->color_formats |= DRM_COLOR_FORMAT_RGB444; + drm_parse_cea_ext(connector, edid); + + /* +@@ -4466,7 +4467,6 @@ static void drm_add_display_info(struct + DRM_DEBUG("%s: Assigning EDID-1.4 digital sink color depth as %d bpc.\n", + connector->name, info->bpc); + +- info->color_formats |= DRM_COLOR_FORMAT_RGB444; + if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB444) + info->color_formats |= DRM_COLOR_FORMAT_YCRCB444; + if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB422) diff --git a/queue-4.14/gso-do-not-skip-outer-ip-header-in-case-of-ipip-and-net_failover.patch b/queue-4.14/gso-do-not-skip-outer-ip-header-in-case-of-ipip-and-net_failover.patch new file mode 100644 index 00000000000..8e2f2ee3ca9 --- /dev/null +++ b/queue-4.14/gso-do-not-skip-outer-ip-header-in-case-of-ipip-and-net_failover.patch @@ -0,0 +1,103 @@ +From cc20cced0598d9a5ff91ae4ab147b3b5e99ee819 Mon Sep 17 00:00:00 2001 +From: Tao Liu +Date: Fri, 18 Feb 2022 22:35:24 +0800 +Subject: gso: do not skip outer ip header in case of ipip and net_failover + +From: Tao Liu + +commit cc20cced0598d9a5ff91ae4ab147b3b5e99ee819 upstream. + +We encounter a tcp drop issue in our cloud environment. Packet GROed in +host forwards to a VM virtio_net nic with net_failover enabled. VM acts +as a IPVS LB with ipip encapsulation. The full path like: +host gro -> vm virtio_net rx -> net_failover rx -> ipvs fullnat + -> ipip encap -> net_failover tx -> virtio_net tx + +When net_failover transmits a ipip pkt (gso_type = 0x0103, which means +SKB_GSO_TCPV4, SKB_GSO_DODGY and SKB_GSO_IPXIP4), there is no gso +did because it supports TSO and GSO_IPXIP4. But network_header points to +inner ip header. + +Call Trace: + tcp4_gso_segment ------> return NULL + inet_gso_segment ------> inner iph, network_header points to + ipip_gso_segment + inet_gso_segment ------> outer iph + skb_mac_gso_segment + +Afterwards virtio_net transmits the pkt, only inner ip header is modified. +And the outer one just keeps unchanged. The pkt will be dropped in remote +host. + +Call Trace: + inet_gso_segment ------> inner iph, outer iph is skipped + skb_mac_gso_segment + __skb_gso_segment + validate_xmit_skb + validate_xmit_skb_list + sch_direct_xmit + __qdisc_run + __dev_queue_xmit ------> virtio_net + dev_hard_start_xmit + __dev_queue_xmit ------> net_failover + ip_finish_output2 + ip_output + iptunnel_xmit + ip_tunnel_xmit + ipip_tunnel_xmit ------> ipip + dev_hard_start_xmit + __dev_queue_xmit + ip_finish_output2 + ip_output + ip_forward + ip_rcv + __netif_receive_skb_one_core + netif_receive_skb_internal + napi_gro_receive + receive_buf + virtnet_poll + net_rx_action + +The root cause of this issue is specific with the rare combination of +SKB_GSO_DODGY and a tunnel device that adds an SKB_GSO_ tunnel option. +SKB_GSO_DODGY is set from external virtio_net. We need to reset network +header when callbacks.gso_segment() returns NULL. + +This patch also includes ipv6_gso_segment(), considering SIT, etc. + +Fixes: cb32f511a70b ("ipip: add GSO/TSO support") +Signed-off-by: Tao Liu +Reviewed-by: Willem de Bruijn +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv4/af_inet.c | 5 ++++- + net/ipv6/ip6_offload.c | 2 ++ + 2 files changed, 6 insertions(+), 1 deletion(-) + +--- a/net/ipv4/af_inet.c ++++ b/net/ipv4/af_inet.c +@@ -1268,8 +1268,11 @@ struct sk_buff *inet_gso_segment(struct + } + + ops = rcu_dereference(inet_offloads[proto]); +- if (likely(ops && ops->callbacks.gso_segment)) ++ if (likely(ops && ops->callbacks.gso_segment)) { + segs = ops->callbacks.gso_segment(skb, features); ++ if (!segs) ++ skb->network_header = skb_mac_header(skb) + nhoff - skb->head; ++ } + + if (IS_ERR_OR_NULL(segs)) + goto out; +--- a/net/ipv6/ip6_offload.c ++++ b/net/ipv6/ip6_offload.c +@@ -96,6 +96,8 @@ static struct sk_buff *ipv6_gso_segment( + if (likely(ops && ops->callbacks.gso_segment)) { + skb_reset_transport_header(skb); + segs = ops->callbacks.gso_segment(skb, features); ++ if (!segs) ++ skb->network_header = skb_mac_header(skb) + nhoff - skb->head; + } + + if (IS_ERR_OR_NULL(segs)) diff --git a/queue-4.14/net-__pskb_pull_tail-pskb_carve_frag_list-drop_monitor-friends.patch b/queue-4.14/net-__pskb_pull_tail-pskb_carve_frag_list-drop_monitor-friends.patch new file mode 100644 index 00000000000..e427250b1bc --- /dev/null +++ b/queue-4.14/net-__pskb_pull_tail-pskb_carve_frag_list-drop_monitor-friends.patch @@ -0,0 +1,42 @@ +From ef527f968ae05c6717c39f49c8709a7e2c19183a Mon Sep 17 00:00:00 2001 +From: Eric Dumazet +Date: Sun, 20 Feb 2022 07:40:52 -0800 +Subject: net: __pskb_pull_tail() & pskb_carve_frag_list() drop_monitor friends + +From: Eric Dumazet + +commit ef527f968ae05c6717c39f49c8709a7e2c19183a upstream. + +Whenever one of these functions pull all data from an skb in a frag_list, +use consume_skb() instead of kfree_skb() to avoid polluting drop +monitoring. + +Fixes: 6fa01ccd8830 ("skbuff: Add pskb_extract() helper function") +Signed-off-by: Eric Dumazet +Link: https://lore.kernel.org/r/20220220154052.1308469-1-eric.dumazet@gmail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/core/skbuff.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/net/core/skbuff.c ++++ b/net/core/skbuff.c +@@ -1974,7 +1974,7 @@ void *__pskb_pull_tail(struct sk_buff *s + /* Free pulled out fragments. */ + while ((list = skb_shinfo(skb)->frag_list) != insp) { + skb_shinfo(skb)->frag_list = list->next; +- kfree_skb(list); ++ consume_skb(list); + } + /* And insert new clone at head. */ + if (clone) { +@@ -5408,7 +5408,7 @@ static int pskb_carve_frag_list(struct s + /* Free pulled out fragments. */ + while ((list = shinfo->frag_list) != insp) { + shinfo->frag_list = list->next; +- kfree_skb(list); ++ consume_skb(list); + } + /* And insert new clone at head. */ + if (clone) { diff --git a/queue-4.14/net-mlx5e-fix-wrong-return-value-on-ioctl-eeprom-query-failure.patch b/queue-4.14/net-mlx5e-fix-wrong-return-value-on-ioctl-eeprom-query-failure.patch new file mode 100644 index 00000000000..90d032c3505 --- /dev/null +++ b/queue-4.14/net-mlx5e-fix-wrong-return-value-on-ioctl-eeprom-query-failure.patch @@ -0,0 +1,32 @@ +From 0b89429722353d112f8b8b29ca397e95fa994d27 Mon Sep 17 00:00:00 2001 +From: Gal Pressman +Date: Wed, 2 Feb 2022 16:07:21 +0200 +Subject: net/mlx5e: Fix wrong return value on ioctl EEPROM query failure + +From: Gal Pressman + +commit 0b89429722353d112f8b8b29ca397e95fa994d27 upstream. + +The ioctl EEPROM query wrongly returns success on read failures, fix +that by returning the appropriate error code. + +Fixes: bb64143eee8c ("net/mlx5e: Add ethtool support for dump module EEPROM") +Signed-off-by: Gal Pressman +Reviewed-by: Tariq Toukan +Signed-off-by: Saeed Mahameed +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c ++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +@@ -1662,7 +1662,7 @@ static int mlx5e_get_module_eeprom(struc + if (size_read < 0) { + netdev_err(priv->netdev, "%s: mlx5_query_eeprom failed:0x%x\n", + __func__, size_read); +- return 0; ++ return size_read; + } + + i += size_read; diff --git a/queue-4.14/openvswitch-fix-setting-ipv6-fields-causing-hw-csum-failure.patch b/queue-4.14/openvswitch-fix-setting-ipv6-fields-causing-hw-csum-failure.patch new file mode 100644 index 00000000000..11a12d4cb6d --- /dev/null +++ b/queue-4.14/openvswitch-fix-setting-ipv6-fields-causing-hw-csum-failure.patch @@ -0,0 +1,149 @@ +From d9b5ae5c1b241b91480aa30408be12fe91af834a Mon Sep 17 00:00:00 2001 +From: Paul Blakey +Date: Wed, 23 Feb 2022 18:34:16 +0200 +Subject: openvswitch: Fix setting ipv6 fields causing hw csum failure + +From: Paul Blakey + +commit d9b5ae5c1b241b91480aa30408be12fe91af834a upstream. + +Ipv6 ttl, label and tos fields are modified without first +pulling/pushing the ipv6 header, which would have updated +the hw csum (if available). This might cause csum validation +when sending the packet to the stack, as can be seen in +the trace below. + +Fix this by updating skb->csum if available. + +Trace resulted by ipv6 ttl dec and then sending packet +to conntrack [actions: set(ipv6(hlimit=63)),ct(zone=99)]: +[295241.900063] s_pf0vf2: hw csum failure +[295241.923191] Call Trace: +[295241.925728] +[295241.927836] dump_stack+0x5c/0x80 +[295241.931240] __skb_checksum_complete+0xac/0xc0 +[295241.935778] nf_conntrack_tcp_packet+0x398/0xba0 [nf_conntrack] +[295241.953030] nf_conntrack_in+0x498/0x5e0 [nf_conntrack] +[295241.958344] __ovs_ct_lookup+0xac/0x860 [openvswitch] +[295241.968532] ovs_ct_execute+0x4a7/0x7c0 [openvswitch] +[295241.979167] do_execute_actions+0x54a/0xaa0 [openvswitch] +[295242.001482] ovs_execute_actions+0x48/0x100 [openvswitch] +[295242.006966] ovs_dp_process_packet+0x96/0x1d0 [openvswitch] +[295242.012626] ovs_vport_receive+0x6c/0xc0 [openvswitch] +[295242.028763] netdev_frame_hook+0xc0/0x180 [openvswitch] +[295242.034074] __netif_receive_skb_core+0x2ca/0xcb0 +[295242.047498] netif_receive_skb_internal+0x3e/0xc0 +[295242.052291] napi_gro_receive+0xba/0xe0 +[295242.056231] mlx5e_handle_rx_cqe_mpwrq_rep+0x12b/0x250 [mlx5_core] +[295242.062513] mlx5e_poll_rx_cq+0xa0f/0xa30 [mlx5_core] +[295242.067669] mlx5e_napi_poll+0xe1/0x6b0 [mlx5_core] +[295242.077958] net_rx_action+0x149/0x3b0 +[295242.086762] __do_softirq+0xd7/0x2d6 +[295242.090427] irq_exit+0xf7/0x100 +[295242.093748] do_IRQ+0x7f/0xd0 +[295242.096806] common_interrupt+0xf/0xf +[295242.100559] +[295242.102750] RIP: 0033:0x7f9022e88cbd +[295242.125246] RSP: 002b:00007f9022282b20 EFLAGS: 00000246 ORIG_RAX: ffffffffffffffda +[295242.132900] RAX: 0000000000000005 RBX: 0000000000000010 RCX: 0000000000000000 +[295242.140120] RDX: 00007f9022282ba8 RSI: 00007f9022282a30 RDI: 00007f9014005c30 +[295242.147337] RBP: 00007f9014014d60 R08: 0000000000000020 R09: 00007f90254a8340 +[295242.154557] R10: 00007f9022282a28 R11: 0000000000000246 R12: 0000000000000000 +[295242.161775] R13: 00007f902308c000 R14: 000000000000002b R15: 00007f9022b71f40 + +Fixes: 3fdbd1ce11e5 ("openvswitch: add ipv6 'set' action") +Signed-off-by: Paul Blakey +Link: https://lore.kernel.org/r/20220223163416.24096-1-paulb@nvidia.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + include/net/checksum.h | 5 +++++ + net/openvswitch/actions.c | 46 ++++++++++++++++++++++++++++++++++++++-------- + 2 files changed, 43 insertions(+), 8 deletions(-) + +--- a/include/net/checksum.h ++++ b/include/net/checksum.h +@@ -143,6 +143,11 @@ static inline void csum_replace2(__sum16 + *sum = ~csum16_add(csum16_sub(~(*sum), old), new); + } + ++static inline void csum_replace(__wsum *csum, __wsum old, __wsum new) ++{ ++ *csum = csum_add(csum_sub(*csum, old), new); ++} ++ + struct sk_buff; + void inet_proto_csum_replace4(__sum16 *sum, struct sk_buff *skb, + __be32 from, __be32 to, bool pseudohdr); +--- a/net/openvswitch/actions.c ++++ b/net/openvswitch/actions.c +@@ -460,12 +460,43 @@ static void set_ipv6_addr(struct sk_buff + memcpy(addr, new_addr, sizeof(__be32[4])); + } + +-static void set_ipv6_fl(struct ipv6hdr *nh, u32 fl, u32 mask) ++static void set_ipv6_dsfield(struct sk_buff *skb, struct ipv6hdr *nh, u8 ipv6_tclass, u8 mask) + { ++ u8 old_ipv6_tclass = ipv6_get_dsfield(nh); ++ ++ ipv6_tclass = OVS_MASKED(old_ipv6_tclass, ipv6_tclass, mask); ++ ++ if (skb->ip_summed == CHECKSUM_COMPLETE) ++ csum_replace(&skb->csum, (__force __wsum)(old_ipv6_tclass << 12), ++ (__force __wsum)(ipv6_tclass << 12)); ++ ++ ipv6_change_dsfield(nh, ~mask, ipv6_tclass); ++} ++ ++static void set_ipv6_fl(struct sk_buff *skb, struct ipv6hdr *nh, u32 fl, u32 mask) ++{ ++ u32 ofl; ++ ++ ofl = nh->flow_lbl[0] << 16 | nh->flow_lbl[1] << 8 | nh->flow_lbl[2]; ++ fl = OVS_MASKED(ofl, fl, mask); ++ + /* Bits 21-24 are always unmasked, so this retains their values. */ +- OVS_SET_MASKED(nh->flow_lbl[0], (u8)(fl >> 16), (u8)(mask >> 16)); +- OVS_SET_MASKED(nh->flow_lbl[1], (u8)(fl >> 8), (u8)(mask >> 8)); +- OVS_SET_MASKED(nh->flow_lbl[2], (u8)fl, (u8)mask); ++ nh->flow_lbl[0] = (u8)(fl >> 16); ++ nh->flow_lbl[1] = (u8)(fl >> 8); ++ nh->flow_lbl[2] = (u8)fl; ++ ++ if (skb->ip_summed == CHECKSUM_COMPLETE) ++ csum_replace(&skb->csum, (__force __wsum)htonl(ofl), (__force __wsum)htonl(fl)); ++} ++ ++static void set_ipv6_ttl(struct sk_buff *skb, struct ipv6hdr *nh, u8 new_ttl, u8 mask) ++{ ++ new_ttl = OVS_MASKED(nh->hop_limit, new_ttl, mask); ++ ++ if (skb->ip_summed == CHECKSUM_COMPLETE) ++ csum_replace(&skb->csum, (__force __wsum)(nh->hop_limit << 8), ++ (__force __wsum)(new_ttl << 8)); ++ nh->hop_limit = new_ttl; + } + + static void set_ip_ttl(struct sk_buff *skb, struct iphdr *nh, u8 new_ttl, +@@ -583,18 +614,17 @@ static int set_ipv6(struct sk_buff *skb, + } + } + if (mask->ipv6_tclass) { +- ipv6_change_dsfield(nh, ~mask->ipv6_tclass, key->ipv6_tclass); ++ set_ipv6_dsfield(skb, nh, key->ipv6_tclass, mask->ipv6_tclass); + flow_key->ip.tos = ipv6_get_dsfield(nh); + } + if (mask->ipv6_label) { +- set_ipv6_fl(nh, ntohl(key->ipv6_label), ++ set_ipv6_fl(skb, nh, ntohl(key->ipv6_label), + ntohl(mask->ipv6_label)); + flow_key->ipv6.label = + *(__be32 *)nh & htonl(IPV6_FLOWINFO_FLOWLABEL); + } + if (mask->ipv6_hlimit) { +- OVS_SET_MASKED(nh->hop_limit, key->ipv6_hlimit, +- mask->ipv6_hlimit); ++ set_ipv6_ttl(skb, nh, key->ipv6_hlimit, mask->ipv6_hlimit); + flow_key->ip.ttl = nh->hop_limit; + } + return 0; diff --git a/queue-4.14/ping-remove-pr_err-from-ping_lookup.patch b/queue-4.14/ping-remove-pr_err-from-ping_lookup.patch new file mode 100644 index 00000000000..e0e577077be --- /dev/null +++ b/queue-4.14/ping-remove-pr_err-from-ping_lookup.patch @@ -0,0 +1,33 @@ +From cd33bdcbead882c2e58fdb4a54a7bd75b610a452 Mon Sep 17 00:00:00 2001 +From: Xin Long +Date: Wed, 23 Feb 2022 22:41:08 -0500 +Subject: ping: remove pr_err from ping_lookup + +From: Xin Long + +commit cd33bdcbead882c2e58fdb4a54a7bd75b610a452 upstream. + +As Jakub noticed, prints should be avoided on the datapath. +Also, as packets would never come to the else branch in +ping_lookup(), remove pr_err() from ping_lookup(). + +Fixes: 35a79e64de29 ("ping: fix the dif and sdif check in ping_lookup") +Reported-by: Jakub Kicinski +Signed-off-by: Xin Long +Link: https://lore.kernel.org/r/1ef3f2fcd31bd681a193b1fcf235eee1603819bd.1645674068.git.lucien.xin@gmail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv4/ping.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/net/ipv4/ping.c ++++ b/net/ipv4/ping.c +@@ -192,7 +192,6 @@ static struct sock *ping_lookup(struct n + (int)ident, &ipv6_hdr(skb)->daddr, dif); + #endif + } else { +- pr_err("ping: protocol(%x) is not supported\n", ntohs(skb->protocol)); + return NULL; + } + diff --git a/queue-4.14/series b/queue-4.14/series index f28a52f17e6..090b6255067 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -5,4 +5,10 @@ parisc-unaligned-fix-ldw-and-stw-unalignment-handlers.patch sr9700-sanity-check-for-packet-length.patch usb-zaurus-support-another-broken-zaurus.patch serial-8250-of-fix-mapped-region-size-when-using-reg-offset-property.patch +ping-remove-pr_err-from-ping_lookup.patch +net-__pskb_pull_tail-pskb_carve_frag_list-drop_monitor-friends.patch +gso-do-not-skip-outer-ip-header-in-case-of-ipip-and-net_failover.patch +openvswitch-fix-setting-ipv6-fields-causing-hw-csum-failure.patch +drm-edid-always-set-rgb444.patch +net-mlx5e-fix-wrong-return-value-on-ioctl-eeprom-query-failure.patch x86-fpu-correct-pkru-xstate-inconsistency.patch