]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/commit
ipvs: Fix possible deadlock in estimator code
authorSven Wegener <sven.wegener@stealer.net>
Thu, 14 Aug 2008 03:55:22 +0000 (03:55 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 20 Aug 2008 18:05:03 +0000 (11:05 -0700)
commitdb6d9c1f9a1beb1b20b7b0bd5e12a16c68a6465b
tree862e8aa877b86d8457e653c07cc53fd5b49c4475
parent6191b1862fd159d8bf6eeb5014d6415782e482ea
ipvs: Fix possible deadlock in estimator code

commit 8ab19ea36c5c5340ff598e4d15fc084eb65671dc upstream

There is a slight chance for a deadlock in the estimator code. We can't call
del_timer_sync() while holding our lock, as the timer might be active and
spinning for the lock on another cpu. Work around this issue by using
try_to_del_timer_sync() and releasing the lock. We could actually delete the
timer outside of our lock, as the add and kill functions are only every called
from userspace via [gs]etsockopt() and are serialized by a mutex, but better
make this explicit.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/ipv4/ipvs/ip_vs_est.c