Mike Manning 944fd1aeac net: allow unbound socket for packets in VRF when tcp_l3mdev_accept set
The commit 3c82a21f4320 ("net: allow binding socket in a VRF when
there's an unbound socket") changed the inet socket lookup to avoid
packets in a VRF from matching an unbound socket. This is to ensure the
necessary isolation between the default and other VRFs for routing and
forwarding. VRF-unaware processes running in the default VRF cannot
access another VRF and have to be run with 'ip vrf exec <vrf>'. This is
to be expected with tcp_l3mdev_accept disabled, but could be reallowed
when this sysctl option is enabled. So instead of directly checking dif
and sdif in inet[6]_match, here call inet_sk_bound_dev_eq(). This
allows a match on unbound socket for non-zero sdif i.e. for packets in
a VRF, if tcp_l3mdev_accept is enabled.

Fixes: 3c82a21f4320 ("net: allow binding socket in a VRF when there's an unbound socket")
Signed-off-by: Mike Manning <mvrmanning@gmail.com>
Link: https://lore.kernel.org/netdev/a54c149aed38fded2d3b5fdb1a6c89e36a083b74.camel@lasnet.de/
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-07-29 11:58:54 +01:00
..
2022-01-10 10:00:09 +09:00
2021-07-01 13:19:48 -07:00
2022-07-28 22:06:15 -07:00
2021-10-13 09:40:46 -07:00
2021-10-13 09:40:46 -07:00
2020-05-05 13:23:29 -07:00
2021-12-16 07:18:35 -08:00
2019-12-09 10:36:44 -08:00
2020-06-22 21:12:44 -07:00
2021-10-15 11:33:08 +01:00
2021-11-19 20:09:55 -08:00
2021-10-13 09:40:46 -07:00
2021-07-27 13:05:56 +01:00
2019-12-09 10:36:44 -08:00
2022-05-11 12:43:10 +01:00
2020-03-04 13:25:55 -08:00
2021-10-13 09:40:45 -07:00
2019-04-22 21:47:25 -07:00
2019-10-05 16:29:00 -07:00
2021-08-03 13:05:26 +01:00
2020-06-18 20:46:23 -07:00
2019-12-09 10:28:43 -08:00