linux/net/netfilter/ipvs
Julian Anastasov 26c15cfd29 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>
2010-09-21 18:12:30 +02:00
..
Kconfig ipvs: netfilter connection tracking changes 2010-09-21 17:35:41 +02:00
Makefile ipvs: netfilter connection tracking changes 2010-09-21 17:35:41 +02:00
ip_vs_app.c ipvs: changes related to service usecnt 2010-09-21 18:12:30 +02:00
ip_vs_conn.c ipvs: netfilter connection tracking changes 2010-09-21 17:35:41 +02:00
ip_vs_core.c ipvs: make rerouting optional with snat_reroute 2010-09-21 17:38:57 +02:00
ip_vs_ctl.c ipvs: changes related to service usecnt 2010-09-21 18:12:30 +02:00
ip_vs_dh.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ip_vs_est.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ip_vs_ftp.c ipvs: netfilter connection tracking changes 2010-09-21 17:35:41 +02:00
ip_vs_lblc.c fix typos concerning "initiali[zs]e" 2010-06-16 18:05:05 +02:00
ip_vs_lblcr.c fix typos concerning "initiali[zs]e" 2010-06-16 18:05:05 +02:00
ip_vs_lc.c IPVS: use pr_err and friends instead of IP_VS_ERR and friends 2009-08-02 18:29:30 -07:00
ip_vs_nfct.c ipvs: netfilter connection tracking changes 2010-09-21 17:35:41 +02:00
ip_vs_nq.c IPVS: use pr_err and friends instead of IP_VS_ERR and friends 2009-08-02 18:29:30 -07:00
ip_vs_proto.c netfilter: xt_ipvs (netfilter matcher for IPVS) 2010-07-23 12:42:58 +02:00
ip_vs_proto_ah_esp.c IPVS: fix potential stack overflow with overly long protocol names 2010-04-08 13:35:47 +02:00
ip_vs_proto_sctp.c ipvs: provide default ip_vs_conn_{in,out}_get_proto 2010-08-02 17:12:44 +02:00
ip_vs_proto_tcp.c ipvs: provide default ip_vs_conn_{in,out}_get_proto 2010-08-02 17:12:44 +02:00
ip_vs_proto_udp.c ipvs: provide default ip_vs_conn_{in,out}_get_proto 2010-08-02 17:12:44 +02:00
ip_vs_rr.c IPVS: use pr_err and friends instead of IP_VS_ERR and friends 2009-08-02 18:29:30 -07:00
ip_vs_sched.c IPVS: convert __ip_vs_sched_lock to a spinlock 2010-08-26 13:21:28 -07:00
ip_vs_sed.c IPVS: use pr_err and friends instead of IP_VS_ERR and friends 2009-08-02 18:29:30 -07:00
ip_vs_sh.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ip_vs_sync.c net: sk_sleep() helper 2010-04-20 16:37:13 -07:00
ip_vs_wlc.c IPVS: use pr_fmt 2009-07-30 14:29:44 -07:00
ip_vs_wrr.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ip_vs_xmit.c ipvs: netfilter connection tracking changes 2010-09-21 17:35:41 +02:00