Skip to content

Commit

Permalink
tunnels: missing rcu_assign_pointer()
Browse files Browse the repository at this point in the history
xfrm4_tunnel_register() & xfrm6_tunnel_register() should
use rcu_assign_pointer() to make sure previous writes
(to handler->next) are committed to memory before chain
insertion.

deregister functions dont need a particular barrier.

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 Sep 9, 2010
1 parent f39234d commit 49d61e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion net/ipv4/tunnel4.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family)
}

handler->next = *pprev;
*pprev = handler;
rcu_assign_pointer(*pprev, handler);

ret = 0;

Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/tunnel6.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int xfrm6_tunnel_register(struct xfrm6_tunnel *handler, unsigned short family)
}

handler->next = *pprev;
*pprev = handler;
rcu_assign_pointer(*pprev, handler);

ret = 0;

Expand Down

0 comments on commit 49d61e2

Please sign in to comment.