]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: marvell: Fix buffer overrun with stats counters
authorAndrew Lunn <andrew@lunn.ch>
Wed, 24 Apr 2019 22:33:00 +0000 (00:33 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 26 Apr 2019 16:06:14 +0000 (12:06 -0400)
commit5f13b6cd7c4934c5acaeada6feec867797750d35
treed73687fe5b1629b5ed92ff1c0c435add7141f2ca
parent18954eb092e6a9c3f65771cf76dba68395e63d95
net: phy: marvell: Fix buffer overrun with stats counters

marvell_get_sset_count() returns how many statistics counters there
are. If the PHY supports fibre, there are 3, otherwise two.

marvell_get_strings() does not make this distinction, and always
returns 3 strings. This then often results in writing past the end
of the buffer for the strings.

Fixes: 6794e40d8e9c ("Marvell phy: add field to get errors from fiber link.")
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/marvell.c