Skip to content

Commit f1925ca

Browse files
Haishuang Yandavem330
authored andcommitted
ip6_tunnel: fix potential issue in __ip6_tnl_rcv
When __ip6_tnl_rcv fails, the tun_dst won't be freed, so call dst_release to free it in error code path. Fixes: 8d79266 ("ip6_tunnel: add collect_md mode to IPv6 tunnels") CC: Alexei Starovoitov <[email protected]> Tested-by: Zhang Shengju <[email protected]> Signed-off-by: Haishuang Yan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 469f87e commit f1925ca

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/ipv6/ip6_tunnel.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,8 @@ static int __ip6_tnl_rcv(struct ip6_tnl *tunnel, struct sk_buff *skb,
858858
return 0;
859859

860860
drop:
861+
if (tun_dst)
862+
dst_release((struct dst_entry *)tun_dst);
861863
kfree_skb(skb);
862864
return 0;
863865
}

0 commit comments

Comments
 (0)