OSDN Git Service

net: mvpp2: Use strscpy to handle stat strings
authorMaxime Chevallier <maxime.chevallier@bootlin.com>
Thu, 6 Jun 2019 08:42:56 +0000 (10:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Jun 2019 10:20:48 +0000 (12:20 +0200)
commitc6a020e0117f8565ade79749188bc48e7c13206f
tree74b2389830f59795d2dbf8c17a3a55d501483669
parentd305d61fcf9656032c337924036e9939fbf2033e
net: mvpp2: Use strscpy to handle stat strings

[ Upstream commit d37acd5aa99c57505b64913e0e2624ec3daed8c5 ]

Use a safe strscpy call to copy the ethtool stat strings into the
relevant buffers, instead of a memcpy that will be accessing
out-of-bound data.

Fixes: 118d6298f6f0 ("net: mvpp2: add ethtool GOP statistics")
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c