[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180302230839.31468-1-f.fainelli@gmail.com>
Date: Fri, 2 Mar 2018 15:08:35 -0800
From: Florian Fainelli <f.fainelli@...il.com>
To: netdev@...r.kernel.org
Cc: david.laight@...lab.com, Florian Fainelli <f.fainelli@...il.com>,
Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...oirfairelinux.com>,
linux-kernel@...r.kernel.org (open list), opendmb@...il.com,
davem@...emloft.net
Subject: [PATCH v2 0/4] net: Use strlcpy() for ethtool::get_strings
Hi all,
After turning on KASAN on one of my systems, I started getting lots of out of
bounds errors while fetching a given port's statistics, and indeed using
memcpy() is unsafe for copying strings which have not been declared as an array
of ETH_GSTRING_LEN bytes, so let's use strlcpy() instead. This allows the best
of both worlds: we still keep the efficient memory usage of variably sized
strings, but we don't copy more than we need to.
Changes in v2:
- dropped the 3 other patches that were not necessary
- use strlcpy() instead of strncpy()
Florian Fainelli (4):
net: dsa: b53: Use strlcpy() for ethtool::get_strings
net: phy: marvell: Use strlcpy() for ethtool::get_strings
net: phy: micrel: Use strlcpy() for ethtool::get_strings
net: phy: broadcom: Use strlcpy() for ethtool::get_strings
drivers/net/dsa/b53/b53_common.c | 4 ++--
drivers/net/phy/bcm-phy-lib.c | 4 ++--
drivers/net/phy/marvell.c | 4 ++--
drivers/net/phy/micrel.c | 4 ++--
4 files changed, 8 insertions(+), 8 deletions(-)
--
2.14.1
Powered by blists - more mailing lists