]> git.baikalelectronics.ru Git - kernel.git/commit
ipvs: do not use dest after ip_vs_dest_put in LBLCR
authorJulian Anastasov <ja@ssi.bg>
Thu, 12 Sep 2013 08:21:09 +0000 (11:21 +0300)
committerSimon Horman <horms@verge.net.au>
Wed, 18 Sep 2013 19:39:39 +0000 (14:39 -0500)
commit3becc5a14d9d4546c3a68272f2614ea4c19ab2e6
tree50889a950b87f84ec85e485d4d95409c9c356da7
parent35459b7d9820707f3a39698bb36ddc6eb8937d85
ipvs: do not use dest after ip_vs_dest_put in LBLCR

commit 265fb517659327 ("ipvs: convert lblcr scheduler to rcu")
allows RCU readers to use dest after calling ip_vs_dest_put().
In the corner case it can race with ip_vs_dest_trash_expire()
which can release the dest while it is being returned to the
RCU readers as scheduling result.

To fix the problem do not allow e->dest to be replaced and
defer the ip_vs_dest_put() call by using RCU callback. Now
e->dest does not need to be RCU pointer.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
net/netfilter/ipvs/ip_vs_lblcr.c