Thread (22 messages) flat view 22 messages, 4 authors, 2012-05-23

Re: [PATCH] ipv4: fix the rcu race between free_fib_info and ip_route_output_slow

From: Eric Dumazet <hidden>
Date: 2012-05-23 06:43:42
Also in: lkml

On Wed, 2012-05-23 at 08:37 +0200, Eric Dumazet wrote:
From: Eric Dumazet <edumazet@google.com>
quoted hunk ↗ jump to hunk
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index ffcb3b0..b56b91e 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2127,7 +2127,7 @@ static int __mkroute_input(struct sk_buff *skb,
 	u32 itag;
 
 	/* get a working reference to the output device */
-	out_dev = __in_dev_get_rcu(FIB_RES_DEV(*res));
+	out_dev = __in_dev_get_rcu(rcu_dereference(FIB_RES_DEV(*res)));
This part might need additional fix (if FIB_RES_DEV(*res) is NULL),
because __in_dev_get_rcu() could crash dereferencing NULL pointer.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help