lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <wiho9h0fafp.fsf@dev-r-vrt-156.mtr.labs.mlnx>
Date:   Mon, 28 May 2018 11:31:38 +0300
From:   Petr Machata <petrm@...lanox.com>
To:     Ido Schimmel <idosch@...sch.org>
Cc:     Andrew Lunn <andrew@...n.ch>, Ido Schimmel <idosch@...lanox.com>,
        netdev@...r.kernel.org, davem@...emloft.net, jiri@...lanox.com,
        mlxsw@...lanox.com
Subject: Re: [PATCH net] mlxsw: spectrum: Forbid creation of VLAN 1 over port/LAG

Ido Schimmel <idosch@...sch.org> writes:

> On Mon, May 28, 2018 at 05:55:58AM +0200, Andrew Lunn wrote:
>> > diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
>> > index ca38a30fbe91..adc6ab2cf429 100644
>> > --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
>> > +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
>> > @@ -4433,6 +4433,11 @@ static int mlxsw_sp_netdevice_port_upper_event(struct net_device *lower_dev,
>> >  			NL_SET_ERR_MSG_MOD(extack, "Can not put a VLAN on an OVS port");
>> >  			return -EINVAL;
>> >  		}
>> > +		if (is_vlan_dev(upper_dev) &&
>> > +		    vlan_dev_vlan_id(upper_dev) == 1) {
>> > +			NL_SET_ERR_MSG_MOD(extack, "Creating a VLAN device with VID 1 is unsupported: VLAN 1 carries untagged traffic");
>> > +			return -EINVAL;
>> > +		}
>> 
>> Would ENOTSUPP be a better return code. VLAN 1 is valid, you just
>> don't support it.
>
> OK, makes sense. We currently use EINVAL for such errors, but we can
> convert to EOPNOTSUPP in net-next.

Yep, agreed.

Thanks,
Petr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ