Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 30b7483f authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'net-Use-strlcpy-for-ethtool-get_strings'



Florian Fainelli says:

====================
net: Use strlcpy() for ethtool::get_strings

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()
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents ce380619 8a17eefa
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment