Skip to content

net: Use strlcpy() for ethtool::get_strings

Florian Fainelli lkml netdev 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 2 repliesIn review
  2. v14 patches 5 repliesSuperseded

Changes in v2 from the cover letter

- dropped the 3 other patches that were not necessary
- use strlcpy() instead of strncpy()

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4net: dsa: b53: Use strlcpy() for ethtool::get_stringsdrivers/net/dsa/b53/b53_common.c+2 -20 replies
2/4net: phy: marvell: Use strlcpy() for ethtool::get_stringsdrivers/net/phy/marvell.c+2 -20 replies
3/4net: phy: micrel: Use strlcpy() for ethtool::get_stringsdrivers/net/phy/micrel.c+2 -20 replies
4/4net: phy: broadcom: Use strlcpy() for ethtool::get_stringsdrivers/net/phy/bcm-phy-lib.c+2 -20 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAndrew Lunn
SeriesR-b
1/4
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [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(-)
Signature · 1 line
2.14.1