lkml.org 
[lkml]   [2018]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH v2 0/4] net: Use strlcpy() for ethtool::get_strings
Date
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

\
 
 \ /
  Last update: 2018-03-03 00:09    [W:0.061 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site