public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Christian Marangi <ansuelsmth@gmail.com>,
	Pavel Machek <pavel@ucw.cz>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Daniel Golle <daniel@makrotopia.org>,
	Li Zetao <lizetao1@huawei.com>,
	linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] leds: trigger: netdev: Fix kernel panic on interface rename trig notify
Date: Mon, 5 Feb 2024 08:50:07 +0000	[thread overview]
Message-ID: <20240205085007.GA19855@google.com> (raw)
In-Reply-To: <8d51f09b-e6d2-4ee1-9e7d-b545d561798a@lunn.ch>

On Sun, 04 Feb 2024, Andrew Lunn wrote:

> On Sun, Feb 04, 2024 at 12:54:01AM +0100, Christian Marangi wrote:
> > Commit d5e01266e7f5 ("leds: trigger: netdev: add additional specific link
> > speed mode") in the various changes, reworked the way to set the LINKUP
> > mode in commit cee4bd16c319 ("leds: trigger: netdev: Recheck
> > NETDEV_LED_MODE_LINKUP on dev rename") and moved it to a generic function.
> > 
> > This changed the logic where, in the previous implementation the dev
> > from the trigger event was used to check if the carrier was ok, but in
> > the new implementation with the generic function, the dev in
> > trigger_data is used instead.
> > 
> > This is problematic and cause a possible kernel panic due to the fact
> > that the dev in the trigger_data still reference the old one as the
> > new one (passed from the trigger event) still has to be hold and saved
> > in the trigger_data struct (done in the NETDEV_REGISTER case).
> > 
> > On calling of get_device_state(), an invalid net_dev is used and this
> > cause a kernel panic.
> > 
> > To handle this correctly, move the call to get_device_state() after the
> > new net_dev is correctly set in trigger_data (in the NETDEV_REGISTER
> > case) and correctly parse the new dev.
> > 
> > Fixes: d5e01266e7f5 ("leds: trigger: netdev: add additional specific link speed mode")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> 
> This should have 'net' in the subject line, to indicate which tree its
> for.

No, it shouldn't.

Contributors aren't obliged to know anything about merging strategies.

Why does this need to go in via net?

> Otherwise:
> 
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Thanks.  Always very useful.

-- 
Lee Jones [李琼斯]

  reply	other threads:[~2024-02-05  8:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-03 23:54 [PATCH] leds: trigger: netdev: Fix kernel panic on interface rename trig notify Christian Marangi
2024-02-04 15:15 ` Andrew Lunn
2024-02-05  8:50   ` Lee Jones [this message]
2024-02-05 13:41     ` Andrew Lunn
2024-02-05 13:53       ` Christian Marangi
2024-02-05 14:33         ` Lee Jones
2024-02-05 14:38           ` Christian Marangi
2024-02-05 15:04             ` Lee Jones
2024-02-08 14:12               ` Lee Jones
2024-02-05 14:27       ` Lee Jones
2024-02-08 14:04 ` (subset) " Lee Jones

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=20240205085007.GA19855@google.com \
    --to=lee@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=ansuelsmth@gmail.com \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=lizetao1@huawei.com \
    --cc=pavel@ucw.cz \
    --cc=stable@vger.kernel.org \
    /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