Re: [PATCH net 4/4] net: dsa: mv88e6xxx: Utilize strncpy() for ethtool::get_strings

2018-03-01 Thread Florian Fainelli
On 03/01/2018 07:08 PM, Andrew Lunn wrote: > On Thu, Mar 01, 2018 at 04:25:29PM -0800, Florian Fainelli wrote: >> Do not use memcpy() which is not safe, but instead use strncpy() which >> will make sure that the string is NUL terminated (in the Linux >> implementation) if the string is smaller th

Re: [PATCH net 4/4] net: dsa: mv88e6xxx: Utilize strncpy() for ethtool::get_strings

2018-03-01 Thread Andrew Lunn
On Thu, Mar 01, 2018 at 04:25:29PM -0800, Florian Fainelli wrote: > Do not use memcpy() which is not safe, but instead use strncpy() which > will make sure that the string is NUL terminated (in the Linux > implementation) if the string is smaller than the length specified. This > fixes KASAN out of

[PATCH net 4/4] net: dsa: mv88e6xxx: Utilize strncpy() for ethtool::get_strings

2018-03-01 Thread Florian Fainelli
Do not use memcpy() which is not safe, but instead use strncpy() which will make sure that the string is NUL terminated (in the Linux implementation) if the string is smaller than the length specified. This fixes KASAN out of bounds warnings while fetching port statistics. Fixes: f5e2ed022dff ("ds