mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: "Rasmus Villemoes" <linux@rasmusvillemoes.dk>,
	"Pavel Machek" <pavel@ucw.cz>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>, linux-leds@vger.kernel.org
Subject: Re: [PATCH v2 1/6] leds: netdev trigger: use memcpy in device_name_store
Date: Wed, 27 Mar 2019 22:20:11 +0100	[thread overview]
Message-ID: <21193aab-7880-d116-64e8-dd08afe5a47f@gmail.com> (raw)
In-Reply-To: <d1fccd75-c48b-d585-1170-1c1b76e1e098@rasmusvillemoes.dk>

On 3/27/19 4:26 PM, Rasmus Villemoes wrote:
> 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).

Thanks for the heads-up. I must admit I'm hitting into that for the
first time. After "git am" it was all OK, but it got screwed up after
"git rebase -i". And having "commit.cleanup = scissors" set globally all
the time is annoying if one extensively uses interactive rebase for
rewording commit messages. It entails the need for manual removal of
the whole stuff that appears then after actual commit message prepended
with "#" comment characters.

This is probably the reason why people use often other characters
for command prompt (see the other fix for ledtrig-netdev). Note that, 
while it is of no so great importance for mainline, when people cherry
pick such patch to their out-of-tree repositories and then rebase, they
hit into the same issue.

-- 
Best regards,
Jacek Anaszewski

  reply	other threads:[~2019-03-27 21:20 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-11 10:59 replacement for CAN_LEDS Rasmus Villemoes
2019-03-11 14:42 ` Pavel Machek
2019-03-13 20:26   ` [PATCH 0/4] leds: netdev trigger: allow setting initial values in device tree Rasmus Villemoes
2019-03-13 20:26     ` [PATCH 1/4] leds: netdev trigger: use memcpy in device_name_store Rasmus Villemoes
2019-03-14  9:29       ` Uwe Kleine-König
2019-03-14  9:57         ` Rasmus Villemoes
2019-03-14 10:04           ` Uwe Kleine-König
2019-03-14 10:14       ` Pavel Machek
2019-03-14 10:54         ` Rasmus Villemoes
2019-03-14 12:16           ` Pavel Machek
2019-03-13 20:26     ` [PATCH 2/4] leds: netdev trigger: factor out middle part of device_name_store Rasmus Villemoes
2019-03-14  9:31       ` Uwe Kleine-König
2019-03-14  9:57         ` Rasmus Villemoes
2019-03-14 10:15         ` Pavel Machek
2019-03-14 10:20           ` Uwe Kleine-König
2019-03-13 20:26     ` [PATCH 3/4] leds: netdev trigger: add documentation to leds/common.txt Rasmus Villemoes
2019-03-13 20:26     ` [PATCH 4/4] leds: netdev trigger: allow setting initial values in device tree Rasmus Villemoes
2019-03-14  9:36       ` Uwe Kleine-König
2019-03-14 10:28         ` Rasmus Villemoes
2019-03-14 10:29       ` Pavel Machek
2019-03-14 11:26         ` Rasmus Villemoes
2019-03-14 12:00           ` Pavel Machek
2019-03-14 13:19             ` Rasmus Villemoes
2019-03-17 19:11               ` Pavel Machek
2019-03-24 20:39                 ` Rasmus Villemoes
2019-03-14 10:32       ` Jacek Anaszewski
2019-03-14 14:06     ` [PATCH v2 0/6] " Rasmus Villemoes
2019-03-14 14:06       ` [PATCH v2 1/6] leds: netdev trigger: use memcpy in device_name_store Rasmus Villemoes
2019-03-18 11:20         ` Pavel Machek
2019-03-26 19:53         ` Jacek Anaszewski
2019-03-27 15:26           ` Rasmus Villemoes
2019-03-27 21:20             ` Jacek Anaszewski [this message]
2019-03-27 21:31               ` Rasmus Villemoes
2019-03-27 21:45                 ` Jacek Anaszewski
2019-03-14 14:06       ` [PATCH v2 2/6] leds: netdev trigger: factor out middle part of device_name_store Rasmus Villemoes
2019-03-18 11:24         ` Pavel Machek
2019-03-14 14:06       ` [PATCH v2 3/6] leds: netdev trigger: move newline handling back to device_name_store Rasmus Villemoes
2019-03-18 11:25         ` Pavel Machek
2019-03-14 14:06       ` [PATCH v2 4/6] leds: netdev trigger: move name length checking to netdev_trig_set_device Rasmus Villemoes
2019-03-18 11:26         ` Pavel Machek
2019-03-14 14:06       ` [PATCH v2 5/6] leds: netdev trigger: add documentation to leds/common.txt Rasmus Villemoes
2019-03-14 14:06       ` [PATCH v2 6/6] leds: netdev trigger: allow setting initial values in device tree Rasmus Villemoes
2019-03-14 14:24         ` Jacek Anaszewski
2019-03-14 15:05           ` Rasmus Villemoes
2019-03-14 15:36             ` Jacek Anaszewski
2019-03-18 11:54         ` Pavel Machek
2019-03-28 16:28         ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=21193aab-7880-d116-64e8-dd08afe5a47f@gmail.com \
    --to=jacek.anaszewski@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=pavel@ucw.cz \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome