[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <34584cb4-f012-c7c1-6cc9-6bbede46109b@gmail.com>
Date: Thu, 14 Feb 2019 16:31:36 -0800
From: Florian Fainelli <f.fainelli@...il.com>
To: David Miller <davem@...emloft.net>, dan.carpenter@...cle.com
Cc: andrew@...n.ch, vivien.didelot@...il.com, netdev@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH net] net: dsa: bcm_sf2: potential array overflow in
bcm_sf2_sw_suspend()
On 2/13/19 10:13 PM, David Miller wrote:
> From: Dan Carpenter <dan.carpenter@...cle.com>
> 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 in dsa_switch_alloc() and it has ds->num_ports
>> elements so this leads to a static checker warning about a potential out
>> of bounds read.
This would not happen here because bcm_sf2 calls b53_switch_alloc()
which does allocate the full port range (not for a good reason), but
it's good to fix that anyways.
>>
>> Fixes: 8cfa94984c9c ("net: dsa: bcm_sf2: add suspend/resume callbacks")
>> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
>
> Applied.
>
--
Florian
Powered by blists - more mailing lists