Revert "geneve: pull IP header before ECN decapsulation"

commit c02bd115b1 upstream.

This reverts commit 4179b00c04 ("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: 4179b00c04 ("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>
This commit is contained in:
Jakub Kicinski 2020-12-09 14:39:56 -08:00 committed by Greg Kroah-Hartman
parent ed58971beb
commit 66a08d1d3b
1 changed files with 4 additions and 16 deletions

View File

@ -254,21 +254,11 @@ static void geneve_rx(struct geneve_dev *geneve, struct geneve_sock *gs,
skb_dst_set(skb, &tun_dst->dst); skb_dst_set(skb, &tun_dst->dst);
/* Ignore packet loops (and multicast echo) */ /* Ignore packet loops (and multicast echo) */
if (ether_addr_equal(eth_hdr(skb)->h_source, geneve->dev->dev_addr)) if (ether_addr_equal(eth_hdr(skb)->h_source, geneve->dev->dev_addr)) {
goto rx_error; geneve->dev->stats.rx_errors++;
goto drop;
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;
} }
oiph = skb_network_header(skb); oiph = skb_network_header(skb);
skb_reset_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); u64_stats_update_end(&stats->syncp);
} }
return; return;
rx_error:
geneve->dev->stats.rx_errors++;
drop: drop:
/* Consume bad packet */ /* Consume bad packet */
kfree_skb(skb); kfree_skb(skb);