Files
linux/net/ipv4
David Ahern 5db05a6c73 net/tcp: Fix socket lookups with SO_BINDTODEVICE
[ Upstream commit 8c43bd1706 ]

Similar to 69678bcd4d ("udp: fix SO_BINDTODEVICE"), TCP socket lookups
need to fail if dev_match is not true. Currently, a packet to a given port
can match a socket bound to device when it should not. In the VRF case,
this causes the lookup to hit a VRF socket and not a global socket
resulting in a response trying to go through the VRF when it should not.

Fixes: 3fa6f616a7 ("net: ipv4: add second dif to inet socket lookups")
Fixes: 4297a0ef08 ("net: ipv6: add second dif to inet6 socket lookups")
Reported-by: Lou Berger <lberger@labn.net>
Diagnosed-by: Renato Westphal <renato@opensourcerouting.org>
Tested-by: Renato Westphal <renato@opensourcerouting.org>
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-22 15:16:01 +02:00
..
2018-04-05 22:05:03 -04:00
2017-10-21 01:33:19 +01:00
2018-03-27 13:18:09 -04:00
2018-07-22 15:15:59 +02:00
2018-03-27 13:18:09 -04:00
2018-03-27 13:18:09 -04:00
2018-05-17 15:48:49 -04:00
2018-03-27 13:18:09 -04:00
2018-03-27 13:18:09 -04:00
2018-03-27 13:18:09 -04:00
2018-03-27 13:18:09 -04:00
2017-10-16 21:24:25 +01:00
2018-05-03 11:28:50 -04:00
2018-02-28 11:43:28 -05:00
2018-03-27 13:18:09 -04:00