]> git.baikalelectronics.ru Git - kernel.git/commit
l2tp: fix potential rcu race
authorEric Dumazet <eric.dumazet@gmail.com>
Wed, 11 May 2011 18:22:36 +0000 (18:22 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 May 2011 21:27:10 +0000 (17:27 -0400)
commitac3ded62fae0e966db5d3f8c2d4a1f5616e6463b
tree9764b821abc0ddc4fa22c239e00460636aa77203
parent6dc09b2f8717d61e9efb17ed9ffa42907f8103b5
l2tp: fix potential rcu race

While trying to remove useless synchronize_rcu() calls, I found l2tp is
indeed incorrectly using two of such calls, but also bumps tunnel
refcount after list insertion.

tunnel refcount must be incremented before being made publically visible
by rcu readers.

This fix can be applied to 2.6.35+ and might need a backport for older
kernels, since things were shuffled in commit b2079113577e9
(l2tp: Split pppol2tp patch into separate l2tp and ppp parts)

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
CC: James Chapman <jchapman@katalix.com>
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/l2tp/l2tp_core.c