From: Greg Kroah-Hartman Date: Tue, 10 Jul 2018 13:41:48 +0000 (+0200) Subject: 4.9-stable patches X-Git-Tag: v3.18.115~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=443755c3624c013bbf5eb9b83165024ea7b7591f;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: mlxsw-spectrum-forbid-linking-of-vlan-devices-to-devices-that-have-uppers.patch --- diff --git a/queue-4.9/mlxsw-spectrum-forbid-linking-of-vlan-devices-to-devices-that-have-uppers.patch b/queue-4.9/mlxsw-spectrum-forbid-linking-of-vlan-devices-to-devices-that-have-uppers.patch new file mode 100644 index 00000000000..b711b446e75 --- /dev/null +++ b/queue-4.9/mlxsw-spectrum-forbid-linking-of-vlan-devices-to-devices-that-have-uppers.patch @@ -0,0 +1,50 @@ +From idosch@mellanox.com Tue Jul 10 15:31:57 2018 +From: Ido Schimmel +Date: Sun, 8 Jul 2018 14:23:19 +0300 +Subject: mlxsw: spectrum: Forbid linking of VLAN devices to devices that have uppers +To: stable@vger.kernel.org +Cc: gregkh@linuxfoundation.org, jslaby@suse.cz, davem@davemloft.net, jiri@mellanox.com, Ido Schimmel +Message-ID: <20180708112319.26988-1-idosch@mellanox.com> + +From: Ido Schimmel + +Jiri Slaby noticed that the backport of upstream commit 25cc72a33835 +("mlxsw: spectrum: Forbid linking to devices that have uppers") to +kernel 4.9.y introduced the same check twice in the same function +instead of in two different places. + +Fix this by relocating one of the checks to its intended place, thus +preventing unsupported configurations as described in the original +commit. + +Fixes: 73ee5a73e75f ("mlxsw: spectrum: Forbid linking to devices that have uppers") +Signed-off-by: Ido Schimmel +Reported-by: Jiri Slaby +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +@@ -4187,10 +4187,6 @@ static int mlxsw_sp_netdevice_port_upper + if (netif_is_lag_port(dev) && is_vlan_dev(upper_dev) && + !netif_is_lag_master(vlan_dev_real_dev(upper_dev))) + return -EINVAL; +- if (!info->linking) +- break; +- if (netdev_has_any_upper_dev(upper_dev)) +- return -EINVAL; + break; + case NETDEV_CHANGEUPPER: + upper_dev = info->upper_dev; +@@ -4566,6 +4562,8 @@ static int mlxsw_sp_netdevice_vport_even + return -EINVAL; + if (!info->linking) + break; ++ if (netdev_has_any_upper_dev(upper_dev)) ++ return -EINVAL; + /* We can't have multiple VLAN interfaces configured on + * the same port and being members in the same bridge. + */