linux-stable/net/openvswitch
Dumitru Ceara 4928ce41c8 openvswitch: handle DNAT tuple collision
commit 8aa7b526dc upstream.

With multiple DNAT rules it's possible that after destination
translation the resulting tuples collide.

For example, two openvswitch flows:
nw_dst=10.0.0.10,tp_dst=10, actions=ct(commit,table=2,nat(dst=20.0.0.1:20))
nw_dst=10.0.0.20,tp_dst=10, actions=ct(commit,table=2,nat(dst=20.0.0.1:20))

Assuming two TCP clients initiating the following connections:
10.0.0.10:5000->10.0.0.10:10
10.0.0.10:5000->10.0.0.20:10

Both tuples would translate to 10.0.0.10:5000->20.0.0.1:20 causing
nf_conntrack_confirm() to fail because of tuple collision.

Netfilter handles this case by allocating a null binding for SNAT at
egress by default.  Perform the same operation in openvswitch for DNAT
if no explicit SNAT is requested by the user and allocate a null binding
for SNAT for packets in the "original" direction.

Reported-at: https://bugzilla.redhat.com/1877128
Suggested-by: Florian Westphal <fw@strlen.de>
Fixes: 05752523e5 ("openvswitch: Interface with NAT.")
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-14 09:51:12 +02:00
..
actions.c net: openvswitch: fix csum updates for MPLS actions 2019-07-31 07:28:45 +02:00
conntrack.c openvswitch: handle DNAT tuple collision 2020-10-14 09:51:12 +02:00
conntrack.h openvswitch: Pack struct sw_flow_key. 2017-02-09 22:59:34 -05:00
datapath.c openvswitch: remove another BUG_ON() 2019-12-05 15:38:17 +01:00
datapath.h openvswitch: fix skb_panic due to the incorrect actions attrlen 2017-08-16 14:12:37 -07:00
dp_notify.c
flow.c openvswitch: Fix pop_vlan action for double tagged frames 2018-01-02 20:31:10 +01:00
flow.h openvswitch: Optimize operations for OvS flow_stats. 2017-07-19 13:49:39 -07:00
flow_netlink.c openvswitch: fix flow actions reallocation 2019-04-17 08:37:47 +02:00
flow_netlink.h openvswitch: Add original direction conntrack tuple to sw_flow_key. 2017-02-09 22:59:34 -05:00
flow_table.c openvswitch: Optimize operations for OvS flow_stats. 2017-07-19 13:49:39 -07:00
flow_table.h
Kconfig openvswitch: call only into reachable nf-nat code 2016-03-28 17:58:59 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vport-geneve.c openvswitch: do not ignore netdev errors when creating tunnel vports 2016-08-10 23:13:23 -07:00
vport-gre.c openvswitch: do not ignore netdev errors when creating tunnel vports 2016-08-10 23:13:23 -07:00
vport-internal_dev.c net: ovs: fix return type of ndo_start_xmit function 2019-11-24 08:22:48 +01:00
vport-internal_dev.h
vport-netdev.c openvswitch: allow L3 netdev ports 2016-11-13 00:51:02 -05:00
vport-netdev.h
vport-vxlan.c vxlan: get rid of redundant vxlan_dev.flags 2017-06-20 13:37:02 -04:00
vport.c openvswitch: add processing of L3 packets 2016-11-13 00:51:02 -05:00
vport.h openvswitch: pass mac_proto to ovs_vport_send 2016-11-13 00:51:02 -05:00