lkml.org 
[lkml]   [2018]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 0/4] net: Use strlcpy() for ethtool::get_strings
From
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Fri, 2 Mar 2018 15:08:35 -0800

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

Series applied, thanks Florian.

\
 
 \ /
  Last update: 2018-03-06 17:14    [W:1.791 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site