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: <20220222172632.ohyamkkiztspp5zl@skbuf>
Date:   Tue, 22 Feb 2022 17:26:32 +0000
From:   Vladimir Oltean <vladimir.oltean@....com>
To:     Ido Schimmel <idosch@...dia.com>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "petrm@...dia.com" <petrm@...dia.com>,
        "jiri@...dia.com" <jiri@...dia.com>,
        "danieller@...dia.com" <danieller@...dia.com>,
        "vadimp@...dia.com" <vadimp@...dia.com>
Subject: Re: [PATCH net-next 02/12] mlxsw: spectrum_span: Ignore VLAN entries
 not used by the bridge in mirroring

On Tue, Feb 22, 2022 at 07:16:53PM +0200, Ido Schimmel wrote:
> Only VLAN entries installed on the bridge device itself should be
> considered when checking whether a packet with a specific VLAN can be
> mirrored via a bridge device. VLAN entries only used to keep context
> (i.e., entries with 'BRIDGE_VLAN_INFO_BRENTRY' unset) should be ignored.
> 
> Fix this by preventing mirroring when the VLAN entry does not have the
> 'BRIDGE_VLAN_INFO_BRENTRY' flag set.
> 
> Fixes: ddaff5047003 ("mlxsw: spectrum: remove guards against !BRIDGE_VLAN_INFO_BRENTRY")
> Signed-off-by: Ido Schimmel <idosch@...dia.com>
> Reviewed-by: Petr Machata <petrm@...dia.com>
> ---

Sorry, I didn't realize br_vlan_get_info() doesn't have a
br_vlan_should_use() check. Maybe we should add it, for the same
consideration that a !BRENTRY master VLAN is still a data structure
private to the bridge, that shouldn't be revealed to other modules?

Anyway, this works too.

Reviewed-by: Vladimir Oltean <vladimir.oltean@....com>

> Cc: Vladimir Oltean <vladimir.oltean@....com>
> ---
>  drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
> index 5459490c7790..b73466470f75 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
> @@ -269,7 +269,8 @@ mlxsw_sp_span_entry_bridge_8021q(const struct net_device *br_dev,
>  
>  	if (!vid && WARN_ON(br_vlan_get_pvid(br_dev, &vid)))
>  		return NULL;
> -	if (!vid || br_vlan_get_info(br_dev, vid, &vinfo))
> +	if (!vid || br_vlan_get_info(br_dev, vid, &vinfo) ||
> +	    !(vinfo.flags & BRIDGE_VLAN_INFO_BRENTRY))
>  		return NULL;
>  
>  	edev = br_fdb_find_port(br_dev, dmac, vid);
> -- 
> 2.33.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ