linux/net/netfilter/ipvs
Julian Anastasov 3c5ab3f395 ipvs: SNAT packet replies only for NATed connections
We do not check if packet from real server is for NAT
connection before performing SNAT. This causes problems
for setups that use DR/TUN and allow local clients to
access the real server directly, for example:

- local client in director creates IPVS-DR/TUN connection
CIP->VIP and the request packets are routed to RIP.
Talks are finished but IPVS connection is not expired yet.

- second local client creates non-IPVS connection CIP->RIP
with same reply tuple RIP->CIP and when replies are received
on LOCAL_IN we wrongly assign them for the first client
connection because RIP->CIP matches the reply direction.
As result, IPVS SNATs replies for non-IPVS connections.

The problem is more visible to local UDP clients but in rare
cases it can happen also for TCP or remote clients when the
real server sends the reply traffic via the director.

So, better to be more precise for the reply traffic.
As replies are not expected for DR/TUN connections, better
to not touch them.

Reported-by: Nick Moriarty <nick.moriarty@york.ac.uk>
Tested-by: Nick Moriarty <nick.moriarty@york.ac.uk>
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
2017-05-08 11:38:35 +02:00
..
ip_vs_app.c
ip_vs_conn.c netfilter: refcounter conversions 2017-03-17 12:49:43 +01:00
ip_vs_core.c ipvs: SNAT packet replies only for NATed connections 2017-05-08 11:38:35 +02:00
ip_vs_ctl.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf 2017-05-03 10:11:26 -04:00
ip_vs_dh.c lib/vsprintf.c: remove %Z support 2017-02-27 18:43:47 -08:00
ip_vs_est.c
ip_vs_fo.c
ip_vs_ftp.c netfilter: ipvs: fix incorrect conflict resolution 2017-04-19 17:55:17 +02:00
ip_vs_lblc.c netfilter: refcounter conversions 2017-03-17 12:49:43 +01:00
ip_vs_lblcr.c netfilter: refcounter conversions 2017-03-17 12:49:43 +01:00
ip_vs_lc.c
ip_vs_nfct.c netfilter: remove nf_ct_is_untracked 2017-04-15 11:51:33 +02:00
ip_vs_nq.c netfilter: refcounter conversions 2017-03-17 12:49:43 +01:00
ip_vs_ovf.c
ip_vs_pe_sip.c
ip_vs_pe.c
ip_vs_proto_ah_esp.c
ip_vs_proto_sctp.c netfilter: refcounter conversions 2017-03-17 12:49:43 +01:00
ip_vs_proto_tcp.c netfilter: refcounter conversions 2017-03-17 12:49:43 +01:00
ip_vs_proto_udp.c
ip_vs_proto.c ipvs: remove unused function ip_vs_set_state_timeout 2017-04-28 12:00:10 +02:00
ip_vs_rr.c netfilter: refcounter conversions 2017-03-17 12:49:43 +01:00
ip_vs_sched.c
ip_vs_sed.c netfilter: refcounter conversions 2017-03-17 12:49:43 +01:00
ip_vs_sh.c lib/vsprintf.c: remove %Z support 2017-02-27 18:43:47 -08:00
ip_vs_sync.c ipvs: change comparison on sync_refresh_period 2017-04-28 12:00:10 +02:00
ip_vs_wlc.c netfilter: refcounter conversions 2017-03-17 12:49:43 +01:00
ip_vs_wrr.c netfilter: refcounter conversions 2017-03-17 12:49:43 +01:00
ip_vs_xmit.c netfilter: remove nf_ct_is_untracked 2017-04-15 11:51:33 +02:00
Kconfig
Makefile