icmp: Don't leak original dst into ip_route_input()
authorThomas Graf <tgraf@suug.ch>
Tue, 21 Jul 2015 08:43:55 +0000 (10:43 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Jul 2015 17:39:05 +0000 (10:39 -0700)
ip_route_input() unconditionally overwrites the dst. Hide the original
dst attached to the skb by calling skb_dst_set(skb, NULL) prior to
ip_route_input().

Reported-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/icmp.c

index f5203fba623638d94b03435db86ac4ed696adba8..c0556f1e4bf09233970c8d5c3fd68afa9a78489f 100644 (file)
@@ -496,6 +496,7 @@ static struct rtable *icmp_route_lookup(struct net *net,
                }
                /* Ugh! */
                orefdst = skb_in->_skb_refdst; /* save old refdst */
+               skb_dst_set(skb_in, NULL);
                err = ip_route_input(skb_in, fl4_dec.daddr, fl4_dec.saddr,
                                     RT_TOS(tos), rt2->dst.dev);