diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2021-09-16 14:33:35 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-09-17 14:21:46 +0100 |
commit | 02319bf15acf54004216e40ac9c171437f24be24 (patch) | |
tree | 8dbd658f239e9c8bea35e0253613ec158e7a118c /fs/xfs | |
parent | 3c9cfb5269f76d447dbadb67835368f3111a91d7 (diff) |
net: dsa: bcm_sf2: Fix array overrun in bcm_sf2_num_active_ports()
After d12e1c464988 ("net: dsa: b53: Set correct number of ports in the
DSA struct") we stopped setting dsa_switch::num_ports to DSA_MAX_PORTS,
which created an off by one error between the statically allocated
bcm_sf2_priv::port_sts array (of size DSA_MAX_PORTS). When
dsa_is_cpu_port() is used, we end-up accessing an out of bounds member
and causing a NPD.
Fix this by iterating with the appropriate port count using
ds->num_ports.
Fixes: d12e1c464988 ("net: dsa: b53: Set correct number of ports in the DSA struct")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/xfs')
0 files changed, 0 insertions, 0 deletions