aboutsummaryrefslogtreecommitdiff
path: root/datapath/vport-gre.c
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2013-02-01 15:34:10 -0800
committerJesse Gross <jesse@nicira.com>2013-02-01 17:07:10 -0800
commit498e12855516a9009fcfff3d1a2d475ead1822ca (patch)
tree20c71aeb1bffd18ba181d068db0fad9f26a9e14d /datapath/vport-gre.c
parentcc2862a93261e9fc9c3880982a9f45e10061733f (diff)
tunneling: Don't send ICMP messages if no tunnel port is found.
Some tunnel code in OVS (for example, CAPWAP) uses the skb->cb to store information while processing packets. However, if we don't find an appropriate tunnel port on receive, then we send an ICMP port unreachable message, which calls back into the IP stack. The stack assumes that skb->cb will still contain valid information about from the IP layer, including any IP options. As a result, icmp_echo_options() can read the garbage values from OVS and overwrite data on the stack, panicing the machine. This simply stops sending ICMP messages when ports are not found. Many people find them confusing and flow based tunneling will never send them (since it always finds a port) so it solves both problems at once. Bug #14880 Reported-by: Deepesh Govindan <dgovindan@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Kyle Mestery <kmestery@cisco.com>
Diffstat (limited to 'datapath/vport-gre.c')
-rw-r--r--datapath/vport-gre.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/datapath/vport-gre.c b/datapath/vport-gre.c
index 14c5ba34..680e7b34 100644
--- a/datapath/vport-gre.c
+++ b/datapath/vport-gre.c
@@ -274,10 +274,8 @@ static int gre_rcv(struct sk_buff *skb)
iph = ip_hdr(skb);
vport = ovs_tnl_find_port(dev_net(skb->dev), iph->daddr, iph->saddr, key,
tunnel_type, &mutable);
- if (unlikely(!vport)) {
- icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0);
+ if (unlikely(!vport))
goto error;
- }
tnl_flags = gre_flags_to_tunnel_flags(mutable, gre_flags, &key);
tnl_tun_key_init(&tun_key, iph, key, tnl_flags);