From: Jakub Kicinski <kuba@kernel.org>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: netdev@vger.kernel.org, "Andrew Lunn" <andrew@lunn.ch>,
"Vivien Didelot" <vivien.didelot@gmail.com>,
"Florian Fainelli" <f.fainelli@gmail.com>,
"Vladimir Oltean" <olteanv@gmail.com>,
"Clément Léger" <clement.leger@bootlin.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Paolo Abeni" <pabeni@redhat.com>,
"Sergei Antonov" <saproj@gmail.com>
Subject: Re: [PATCH net] net: dsa: don't dereference NULL extack in dsa_slave_changeupper()
Date: Mon, 22 Aug 2022 18:25:23 -0700 [thread overview]
Message-ID: <20220822182523.6821e176@kernel.org> (raw)
In-Reply-To: <20220819173925.3581871-1-vladimir.oltean@nxp.com>
On Fri, 19 Aug 2022 20:39:25 +0300 Vladimir Oltean wrote:
> diff --git a/net/dsa/slave.c b/net/dsa/slave.c
> index c548b969b083..804a00324c8b 100644
> --- a/net/dsa/slave.c
> +++ b/net/dsa/slave.c
> @@ -2487,7 +2487,7 @@ static int dsa_slave_changeupper(struct net_device *dev,
> if (!err)
> dsa_bridge_mtu_normalization(dp);
> if (err == -EOPNOTSUPP) {
> - if (!extack->_msg)
> + if (extack && !extack->_msg)
> NL_SET_ERR_MSG_MOD(extack,
> "Offloading not supported");
Other offload paths set the extack prior to the driver call,
which has the same effect. Can't we do the same thing here?
Do we care about preserving the extack from another notifier
handler or something? Does not seem like that's the case judging
but the commit under Fixes.
If it is the case (and hopefully not) we should add a new macro wrapper.
Manually twiddling with a field starting with an underscore makes
me feel dirty. Perhaps I have been writing too much python lately.
next prev parent reply other threads:[~2022-08-23 1:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-19 17:39 [PATCH net] net: dsa: don't dereference NULL extack in dsa_slave_changeupper() Vladimir Oltean
2022-08-20 2:53 ` Florian Fainelli
2022-08-21 14:01 ` Sergei Antonov
2022-08-23 1:25 ` Jakub Kicinski [this message]
2022-08-23 10:08 ` Vladimir Oltean
2022-08-23 15:00 ` Jakub Kicinski
2022-08-23 15:10 ` patchwork-bot+netdevbpf
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=20220822182523.6821e176@kernel.org \
--to=kuba@kernel.org \
--cc=andrew@lunn.ch \
--cc=clement.leger@bootlin.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=saproj@gmail.com \
--cc=vivien.didelot@gmail.com \
--cc=vladimir.oltean@nxp.com \
/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;
as well as URLs for NNTP newsgroup(s).