Skip to content

Commit

Permalink
xfrm: force a dst reference in __xfrm_route_forward()
Browse files Browse the repository at this point in the history
Packets going through __xfrm_route_forward() have a not refcounted dst
entry, since we enabled a noref forwarding path.

xfrm_lookup() might incorrectly release this dst entry.

It's a bit late to make invasive changes in xfrm_lookup(), so lets force
a refcount in this path.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Jun 2, 2010
1 parent b42d916 commit fafeeb6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/xfrm/xfrm_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -2153,6 +2153,7 @@ int __xfrm_route_forward(struct sk_buff *skb, unsigned short family)
return 0;
}

skb_dst_force(skb);
dst = skb_dst(skb);

res = xfrm_lookup(net, &dst, &fl, NULL, 0) == 0;
Expand Down

0 comments on commit fafeeb6

Please sign in to comment.