Commit a57c541f authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[IPV4]: Do not leak dst entries in ip_copy_metadata().

Netfilter conntrack can defragment locally generated
packets before they hit ip_fragment().  In this case
the fragments have skb->dst set already, so we have to
release that existing reference before overwriting
skb->dst.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e3b4ac5d
......@@ -389,6 +389,7 @@ static void ip_copy_metadata(struct sk_buff *to, struct sk_buff *from)
to->priority = from->priority;
to->protocol = from->protocol;
to->security = from->security;
dst_release(to->dst);
to->dst = dst_clone(from->dst);
to->dev = from->dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment