From: PeilinHe <peilinhe2020@163.com>
To: olteanv@gmail.com
Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com,
fan.yu9@zte.com.cn, he.peilin@zte.com.cn, jiang.kun2@zte.com.cn,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
qiu.yutan@zte.com.cn, tu.qiang35@zte.com.cn,
wang.yaxin@zte.com.cn, xu.xin16@zte.com.cn,
yang.yang29@zte.com.cn, ye.xingchen@zte.com.cn,
zhang.yunkai@zte.com.cn
Subject: Re: Re: [PATCH linux next] net:dsa:fix the dsa_ptr null pointer dereference
Date: Tue, 24 Dec 2024 08:05:32 +0000 [thread overview]
Message-ID: <20241224080532.3958498-1-peilinhe2020@163.com> (raw)
In-Reply-To: <20241220112738.7maahbhxi2fnaven@skbuf>
>Thank you for the patch.
>
>There are many process problems with it however.
>
>The most glaring one is that you are examining a crash from kernel 5.4
>but patching linux-next, without having apparently also tested linux-next.
>It appears that you just made a static analysis which may result in
>incorrect conclusions. When submitting patches upstream you always have
>to test on the latest version and understand afterwards what is missing
>and needs to be backported in the particular stable version you are using.
>
>In particular here, dsa_switch_shutdown() now has this:
>
> dsa_switch_for_each_user_port(dp, ds) {
> conduit = dsa_port_to_conduit(dp);
> user_dev = dp->user;
>
> netif_device_detach(user_dev);
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> netdev_upper_dev_unlink(conduit, user_dev);
> }
>
>After netif_device_detach() is called, my expectation is that
>ethnl_ops_begin() sees that netif_device_present() is false, so it
>returns -ENODEV and does not proceed further to call into the device's
>ethtool ops. So that eliminates the premise for the crash.
>
>Secondly, linux-next is not a kernel tree that accepts patches, it is
>just for integration. For netdev, we have net.git for bug fixes and
>net-next.git for new features. You have to target your patch to net.git
>by using "[PATCH net v1]".
>
>If the problem does not exist in net.git but exists in stable kernels,
>you have to identify which patches are missing, adapt them if necessary,
>and then send them to stable@vger.kernel.org, with netdev and the other
>maintainers also CCed, and with a subject prefix along the lines of
>"[PATCH stable 5.4]". Generally, backporting patches manually to stable
>is rarely needed, so if that needs to happen, please use the space under
>the "---" marker (this is discarded when applying the patch in git) to
>explain to maintainers why (what conflicted, if it simply appears to
>have been missed, etc).
>
>There are other things to be aware of in Documentation/process/, I just
>summarized to you what I considered most relevant here.
Thank you for your feedback.
First, I apologize for an error in my previous commit description.
The kernel version that experienced the panic was actually 5.15.
Second, netif_device_present() does indeed prevent the null pointer
dereference of dsa_ptr.
Finally, this issue still persists in the 5.15 stable release,
therefore, following your suggestion, I will submit the relevant
patch to the 5.15 stable branch.
prev parent reply other threads:[~2024-12-24 8:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-20 6:05 [PATCH linux next] net:dsa:fix the dsa_ptr null pointer dereference jiang.kun2
2024-12-20 11:10 ` [PATCH linux next] net: dsa: fix " Markus Elfring
2024-12-20 11:27 ` [PATCH linux next] net:dsa:fix " Vladimir Oltean
2024-12-24 8:05 ` PeilinHe [this message]
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=20241224080532.3958498-1-peilinhe2020@163.com \
--to=peilinhe2020@163.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fan.yu9@zte.com.cn \
--cc=he.peilin@zte.com.cn \
--cc=jiang.kun2@zte.com.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=qiu.yutan@zte.com.cn \
--cc=tu.qiang35@zte.com.cn \
--cc=wang.yaxin@zte.com.cn \
--cc=xu.xin16@zte.com.cn \
--cc=yang.yang29@zte.com.cn \
--cc=ye.xingchen@zte.com.cn \
--cc=zhang.yunkai@zte.com.cn \
/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