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@xxxxxxxxxxxxxxxxxx>
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).