aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2020-12-09 14:39:56 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-12-11 13:23:33 +0100
commit66a08d1d3bd8349dded69ce759b14ccdb39aa600 (patch)
tree0b0f6591fd91db319a44a95ee9dd693593a2a604
parented58971beb47d600eba1a0073b5e6f6fc5385e5d (diff)
downloadlinux-yocto-66a08d1d3bd8349dded69ce759b14ccdb39aa600.tar.gz
linux-yocto-66a08d1d3bd8349dded69ce759b14ccdb39aa600.tar.bz2
linux-yocto-66a08d1d3bd8349dded69ce759b14ccdb39aa600.zip
Revert "geneve: pull IP header before ECN decapsulation"
commit c02bd115b1d25931159f89c7d9bf47a30f5d4b41 upstream. This reverts commit 4179b00c04d1 ("geneve: pull IP header before ECN decapsulation"). Eric says: "network header should have been pulled already before hitting geneve_rx()". Let's revert the syzbot fix since it's causing more harm than good, and revisit. Suggested-by: Eric Dumazet <edumazet@google.com> Reported-by: Jianlin Shi <jishi@redhat.com> Fixes: 4179b00c04d1 ("geneve: pull IP header before ECN decapsulation") Link: https://bugzilla.kernel.org/show_bug.cgi?id=210569 Link: https://lore.kernel.org/netdev/CANn89iJVWfb=2i7oU1=D55rOyQnBbbikf+Mc6XHMkY7YX-yGEw@mail.gmail.com/ Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/geneve.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index 496ae07aca5e..c7ec3d24eabc 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -254,21 +254,11 @@ static void geneve_rx(struct geneve_dev *geneve, struct geneve_sock *gs,
skb_dst_set(skb, &tun_dst->dst);
/* Ignore packet loops (and multicast echo) */
- if (ether_addr_equal(eth_hdr(skb)->h_source, geneve->dev->dev_addr))
- goto rx_error;
-
- switch (skb_protocol(skb, true)) {
- case htons(ETH_P_IP):
- if (pskb_may_pull(skb, sizeof(struct iphdr)))
- goto rx_error;
- break;
- case htons(ETH_P_IPV6):
- if (pskb_may_pull(skb, sizeof(struct ipv6hdr)))
- goto rx_error;
- break;
- default:
- goto rx_error;
+ if (ether_addr_equal(eth_hdr(skb)->h_source, geneve->dev->dev_addr)) {
+ geneve->dev->stats.rx_errors++;
+ goto drop;
}
+
oiph = skb_network_header(skb);
skb_reset_network_header(skb);
@@ -309,8 +299,6 @@ static void geneve_rx(struct geneve_dev *geneve, struct geneve_sock *gs,
u64_stats_update_end(&stats->syncp);
}
return;
-rx_error:
- geneve->dev->stats.rx_errors++;
drop:
/* Consume bad packet */
kfree_skb(skb);