linux/drivers/net/ethernet/mellanox/mlxsw
Ido Schimmel 993107fea5 mlxsw: spectrum_switchdev: Fix VLAN device deletion via ioctl
When deleting a VLAN device using an ioctl the netdev is unregistered
before the VLAN filter is updated via ndo_vlan_rx_kill_vid(). It can
lead to a use-after-free in mlxsw in case the VLAN device is deleted
while being enslaved to a bridge.

The reason for the above is that when mlxsw receives the CHANGEUPPER
event, it wrongly assumes that the VLAN device is no longer its upper
and thus destroys the internal representation of the bridge port despite
the reference count being non-zero.

Fix this by checking if the VLAN device is our upper using its real
device. In net-next I'm going to remove this trick and instead make
mlxsw completely agnostic to the order of the events.

Fixes: c57529e1d5 ("mlxsw: spectrum: Replace vPorts with Port-VLAN")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-12-06 13:31:09 -08:00
..
Kconfig mlxsw: spectrum_acl: Implement common eRP core 2018-07-25 16:46:01 -07:00
Makefile mlxsw: spectrum_nve: Implement common NVE core 2018-10-17 17:45:07 -07:00
cmd.h mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
core.c mlxsw: core: Fix devlink unregister flow 2018-10-29 20:48:00 -07:00
core.h mlxsw: core: Fix use-after-free when flashing firmware during init 2018-10-17 22:25:45 -07:00
core_acl_flex_actions.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
core_acl_flex_actions.h mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
core_acl_flex_keys.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
core_acl_flex_keys.h mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
core_hwmon.c mlxsw: core: Fix use-after-free when flashing firmware during init 2018-10-17 22:25:45 -07:00
core_thermal.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
emad.h mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
i2c.c mlxsw: remove unused arrays mlxsw_i2c_driver_name and mlxsw_pci_driver_name 2018-08-10 10:23:51 -07:00
i2c.h mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
ib.h mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
item.h mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
minimal.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
pci.c mlxsw: pci: Derive event type from event queue number 2018-10-04 09:53:03 -07:00
pci.h mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
pci_hw.h mlxsw: pci: Fix a typo 2018-10-10 22:22:07 -07:00
port.h mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
reg.h mlxsw: reg: QEEC: Add minimum shaper fields 2018-10-31 12:56:58 -07:00
resources.h mlxsw: resources: Add NVE resources 2018-10-11 10:08:23 -07:00
spectrum.c mlxsw: spectrum: Fix IP2ME CPU policer configuration 2018-11-03 19:31:42 -07:00
spectrum.h mlxsw: spectrum: Enable VxLAN enslavement to bridges 2018-10-17 17:45:08 -07:00
spectrum1_acl_tcam.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum1_kvdl.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum1_mr_tcam.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum2_acl_tcam.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum2_kvdl.c mlxsw: spectrum: Add a new type of KVD linear record 2018-10-11 10:08:22 -07:00
spectrum2_mr_tcam.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_acl.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_acl_atcam.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_acl_ctcam.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_acl_erp.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_acl_flex_actions.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_acl_flex_actions.h mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_acl_flex_keys.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_acl_tcam.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_acl_tcam.h mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_buffers.c mlxsw: spectrum_buffers: Tweak SBMM configuration 2018-09-20 07:46:01 -07:00
spectrum_cnt.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_cnt.h mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_dcb.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_dpipe.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_dpipe.h mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_fid.c mlxsw: spectrum_fid: Clear NVE configuration when destroying 802.1D FIDs 2018-10-17 17:45:07 -07:00
spectrum_flower.c net_sched: remove list_head from tc_action 2018-08-21 12:45:44 -07:00
spectrum_ipip.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_ipip.h mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_kvdl.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_mr.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_mr.h mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_mr_tcam.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_mr_tcam.h mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_nve.c mlxsw: spectrum_nve: Remove easily triggerable warnings 2018-12-06 13:31:08 -08:00
spectrum_nve.h mlxsw: spectrum_nve: Implement common NVE core 2018-10-17 17:45:07 -07:00
spectrum_nve_vxlan.c mlxsw: spectrum_nve: Implement VxLAN operations 2018-10-17 17:45:07 -07:00
spectrum_qdisc.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_router.c mlxsw: spectrum_router: Relax GRE decap matching check 2018-12-06 13:31:08 -08:00
spectrum_router.h mlxsw: spectrum: Move L3 protocol and address definitions to global header file 2018-10-11 10:08:22 -07:00
spectrum_span.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_span.h mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
spectrum_switchdev.c mlxsw: spectrum_switchdev: Fix VLAN device deletion via ioctl 2018-12-06 13:31:09 -08:00
spectrum_switchdev.h mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
switchib.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
switchx2.c mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00
trap.h mlxsw: spectrum: Add NVE packet traps 2018-10-11 10:08:23 -07:00
txheader.h mlxsw: Replace license text with SPDX identifiers and adjust copyrights 2018-08-09 10:36:10 -07:00