diff options
author | Julian Anastasov <ja@ssi.bg> | 2010-09-21 18:12:30 +0200 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2010-09-21 18:12:30 +0200 |
commit | 26c15cfd291f8b4ee40b4bbdf5e3772adfd704f5 (patch) | |
tree | 7ac3dc5c55b30ab85d599e945abd5f718a97c3c3 /net/ipv4 | |
parent | 99f07e91bef34db0fc8b1a224096e97f02dc0d56 (diff) | |
download | kernel_replicant_linux-26c15cfd291f8b4ee40b4bbdf5e3772adfd704f5.tar.gz kernel_replicant_linux-26c15cfd291f8b4ee40b4bbdf5e3772adfd704f5.tar.bz2 kernel_replicant_linux-26c15cfd291f8b4ee40b4bbdf5e3772adfd704f5.zip |
ipvs: changes related to service usecnt
Change the usage of svc usecnt during command execution:
- we check if svc is registered but we do not need to hold usecnt
reference while under __ip_vs_mutex, only the packet handling needs
it during scheduling
- change __ip_vs_service_get to __ip_vs_service_find and
__ip_vs_svc_fwm_get to __ip_vs_svc_fwm_find because now caller
will increase svc->usecnt
- put common code that calls update_service in __ip_vs_update_dest
- put common code in ip_vs_unlink_service() and use it to unregister
the service
- add comment that svc should not be accessed after ip_vs_del_service
anymore
- all IP_VS_WAIT_WHILE calls are now unified: usecnt > 0
- Properly log the app ports
As result, some problems are fixed:
- possible use-after-free of svc in ip_vs_genl_set_cmd after
ip_vs_del_service because our usecnt reference does not guarantee that
svc is not freed on refcnt==0, eg. when no dests are moved to trash
- possible usecnt leak in do_ip_vs_set_ctl after ip_vs_del_service
when the service is not freed now, for example, when some
destionations are moved into trash and svc->refcnt remains above 0.
It is harmless because svc is not in hash anymore.
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/ipv4')
0 files changed, 0 insertions, 0 deletions