Skip to content

Commit 773a69d

Browse files
tgrafdavem330
authored andcommitted
icmp: Don't leak original dst into ip_route_input()
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 <[email protected]> Signed-off-by: Thomas Graf <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1d8fff9 commit 773a69d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/ipv4/icmp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,7 @@ static struct rtable *icmp_route_lookup(struct net *net,
496496
}
497497
/* Ugh! */
498498
orefdst = skb_in->_skb_refdst; /* save old refdst */
499+
skb_dst_set(skb_in, NULL);
499500
err = ip_route_input(skb_in, fl4_dec.daddr, fl4_dec.saddr,
500501
RT_TOS(tos), rt2->dst.dev);
501502

0 commit comments

Comments
 (0)