diff options
author | Ido Schimmel <idosch@mellanox.com> | 2017-06-28 09:03:12 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-29 19:59:48 +0300 |
commit | 6b27c8adf27edf1dabe2cdcfaa101ef7e2712415 (patch) | |
tree | 26b90658eccc357a4fbf4e734f5a1e745b3e5722 /drivers/net/ethernet/rocker | |
parent | c1a4872ebfb83b1af7144f7b29ac8c4b344a12a8 (diff) | |
download | linux-6b27c8adf27edf1dabe2cdcfaa101ef7e2712415.tar.xz |
mlxsw: spectrum_router: Fix NULL pointer dereference
In case a VLAN device is enslaved to a bridge we shouldn't create a
router interface (RIF) for it when it's configured with an IP address.
This is already handled by the driver for other types of netdevs, such
as physical ports and LAG devices.
If this IP address is then removed and the interface is subsequently
unlinked from the bridge, a NULL pointer dereference can happen, as the
original 802.1d FID was replaced with an rFID which was then deleted.
To reproduce:
$ ip link set dev enp3s0np9 up
$ ip link add name enp3s0np9.111 link enp3s0np9 type vlan id 111
$ ip link set dev enp3s0np9.111 up
$ ip link add name br0 type bridge
$ ip link set dev br0 up
$ ip link set enp3s0np9.111 master br0
$ ip address add dev enp3s0np9.111 192.168.0.1/24
$ ip address del dev enp3s0np9.111 192.168.0.1/24
$ ip link set dev enp3s0np9.111 nomaster
Fixes: 99724c18fc66 ("mlxsw: spectrum: Introduce support for router interfaces")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reported-by: Petr Machata <petrm@mellanox.com>
Tested-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/rocker')
0 files changed, 0 insertions, 0 deletions