lkml.org 
[lkml]   [2019]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 1/6] leds: netdev trigger: use memcpy in device_name_store
From
Date
On 26/03/2019 20.53, Jacek Anaszewski wrote:
> Hi Rasmus,
>
> Thank you for the patch.
>
> On 3/14/19 3:06 PM, Rasmus Villemoes wrote:
>> If userspace doesn't end the input with a newline (which can easily
>> happen if the write happens from a C program that does write(fd,
>> iface, strlen(iface))), we may end up including garbage from a
>> previous, longer value in the device_name. For example
>>
>> # cat device_name
>>
>> # printf 'eth12' > device_name
>> # cat device_name
>> eth12
>> # printf 'eth3' > device_name
>> # cat device_name
>> eth32
>>
>
> Added tag:
>
> Fixes: 06f502f57d0d ("leds: trigger: Introduce a NETDEV trigger")
>
> and applied to the fixes-for-5.1-rc3 branch.
>

You're stripping lines beginning with #. This is the commit in -next:


commit 09466021a80c926aa7de68e5162bdfea2a117483
Author: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Date: Thu Mar 14 15:06:14 2019 +0100

leds: netdev trigger: use memcpy in device_name_store

If userspace doesn't end the input with a newline (which can easily
happen if the write happens from a C program that does write(fd,
iface, strlen(iface))), we may end up including garbage from a
previous, longer value in the device_name. For example

eth12
eth32

which is entirely useless and confusing. Please fix this before it
actually hits mainline. And you may want to look into "git commit
--cleanup" and/or "git config commit.cleanup" (scissors is much better
than the default strip).

Rasmus

\
 
 \ /
  Last update: 2019-03-27 16:27    [W:0.090 / U:1.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site