From: David S. Miller Date: Tue, 6 Mar 2018 16:12:40 +0000 (-0500) Subject: Merge branch 'net-Use-strlcpy-for-ethtool-get_strings' X-Git-Tag: v4.19~1406^2~93 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=30b7483f35f283db62b10aa0dd81f059a165af21;p=platform%2Fkernel%2Flinux-rpi.git 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: David S. Miller --- 30b7483f35f283db62b10aa0dd81f059a165af21