From: Jarek Poplawski Date: Mon, 15 Jun 2009 09:31:29 +0000 (-0700) Subject: ipv4: Fix fib_trie rebalancing X-Git-Tag: v2.6.31-rc1~330^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0f7cb8c8cc6cccce28d2ce39ad8c60d23c3799f;p=pandora-kernel.git ipv4: Fix fib_trie rebalancing While doing trie_rebalance(): resize(), inflate(), halve() RCU free tnodes before updating their parents. It depends on RCU delaying the real destruction, but if RCU readers start after call_rcu() and before parent update they could access freed memory. It is currently prevented with preempt_disable() on the update side, but it's not safe, except maybe classic RCU, plus it conflicts with memory allocations with GFP_KERNEL flag used from these functions. This patch explicitly delays freeing of tnodes by adding them to the list, which is flushed after the update is finished. Reported-by: Yan Zheng Signed-off-by: Jarek Poplawski Signed-off-by: David S. Miller --- Reading git-diff-tree failed