Re: [PATCH net] net: dsa: bcm_sf2: potential array overflow in bcm_sf2_sw_suspend()

2019-02-14 Thread Florian Fainelli
On 2/13/19 10:13 PM, David Miller wrote: > From: Dan Carpenter > Date: Wed, 13 Feb 2019 11:23:04 +0300 > >> The value of ->num_ports comes from bcm_sf2_sw_probe() and it is less >> than or equal to DSA_MAX_PORTS. The ds->ports[] array is used inside >> the dsa_is_user_port() and dsa_is_cpu_port(

Re: [PATCH net] net: dsa: bcm_sf2: potential array overflow in bcm_sf2_sw_suspend()

2019-02-13 Thread David Miller
From: Dan Carpenter Date: Wed, 13 Feb 2019 11:23:04 +0300 > The value of ->num_ports comes from bcm_sf2_sw_probe() and it is less > than or equal to DSA_MAX_PORTS. The ds->ports[] array is used inside > the dsa_is_user_port() and dsa_is_cpu_port() functions. The ds->ports[] > array is allocated

Re: [PATCH net] net: dsa: bcm_sf2: potential array overflow in bcm_sf2_sw_suspend()

2019-02-13 Thread Vivien Didelot
On Wed, 13 Feb 2019 11:23:04 +0300, Dan Carpenter wrote: > The value of ->num_ports comes from bcm_sf2_sw_probe() and it is less > than or equal to DSA_MAX_PORTS. The ds->ports[] array is used inside > the dsa_is_user_port() and dsa_is_cpu_port() functions. The ds->ports[] > array is allocated

[PATCH net] net: dsa: bcm_sf2: potential array overflow in bcm_sf2_sw_suspend()

2019-02-13 Thread Dan Carpenter
The value of ->num_ports comes from bcm_sf2_sw_probe() and it is less than or equal to DSA_MAX_PORTS. The ds->ports[] array is used inside the dsa_is_user_port() and dsa_is_cpu_port() functions. The ds->ports[] array is allocated in dsa_switch_alloc() and it has ds->num_ports elements so this lea