netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfrm: force a dst reference in __xfrm_route_forward()
@ 2010-06-01 20:04 Eric Dumazet
  2010-06-02  9:27 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2010-06-01 20:04 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

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>
---
 net/xfrm/xfrm_policy.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index d965a2b..4bf27d9 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -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;



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xfrm: force a dst reference in __xfrm_route_forward()
  2010-06-01 20:04 [PATCH] xfrm: force a dst reference in __xfrm_route_forward() Eric Dumazet
@ 2010-06-02  9:27 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-06-02  9:27 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 01 Jun 2010 22:04:49 +0200

> 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>

Applied, thanks for fixing this bug Eric.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-02  9:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-01 20:04 [PATCH] xfrm: force a dst reference in __xfrm_route_forward() Eric Dumazet
2010-06-02  9:27 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).