Thread (7 messages) 7 messages, 3 authors, 2018-03-06

Re: [PATCH v2 0/4] net: Use strlcpy() for ethtool::get_strings

flat view

From: Andrew Lunn <andrew@lunn.ch>
Date: 2018-03-04 15:41:23
Also in: lkml

On Fri, Mar 02, 2018 at 03:08:35PM -0800, Florian Fainelli wrote:
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.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help