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] [day] [month] [year] [list]
Message-Id: <20191119.152227.1835791894022993413.davem@davemloft.net>
Date:   Tue, 19 Nov 2019 15:22:27 -0800 (PST)
From:   David Miller <davem@...emloft.net>
To:     olteanv@...il.com
Cc:     andrew@...n.ch, f.fainelli@...il.com, vivien.didelot@...il.com,
        claudiu.manoil@....com, alexandru.marginean@....com,
        xiaoliang.yang_1@....com, yangbo.lu@....com,
        netdev@...r.kernel.org, vladimir.oltean@....com
Subject: Re: [PATCH net-next] net: dsa: felix: Fix CPU port assignment when
 not last port

From: Vladimir Oltean <olteanv@...il.com>
Date: Mon, 18 Nov 2019 20:16:57 +0200

> From: Vladimir Oltean <vladimir.oltean@....com>
> 
> On the NXP LS1028A, there are 2 Ethernet links between the Felix switch
> and the ENETC:
> - eno2 <-> swp4, at 2.5G
> - eno3 <-> swp5, at 1G
> 
> Only one of the above Ethernet port pairs can act as a DSA link for
> tagging.
> 
> When adding initial support for the driver, it was tested only on the 1G
> eno3 <-> swp5 interface, due to the necessity of using PHYLIB initially
> (which treats fixed-link interfaces as emulated C22 PHYs, so it doesn't
> support fixed-link speeds higher than 1G).
> 
> After making PHYLINK work, it appears that swp4 still can't act as CPU
> port. So it looks like ocelot_set_cpu_port was being called for swp4,
> but then it was called again for swp5, overwriting the CPU port assigned
> in the DT.
> 
> It appears that when you call dsa_upstream_port for a port that is not
> defined in the device tree (such as swp5 when using swp4 as CPU port),
> its dp->cpu_dp pointer is not initialized by dsa_tree_setup_default_cpu,
> and this trips up the following condition in dsa_upstream_port:
> 
> 	if (!cpu_dp)
> 		return port;
> 
> So the moral of the story is: don't call dsa_upstream_port for a port
> that is not defined in the device tree, and therefore its dsa_port
> structure is not completely initialized (ds->num_ports is still 6).
> 
> Fixes: 56051948773e ("net: dsa: ocelot: add driver for Felix switch family")
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>

Applied.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ