From: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: khtsai@google.com, sashal@kernel.org,
Merlijn Wajer <merlijn@wizzup.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [REGRESSION] usb: gadget: u_ether NULL deref in eth_stop after gether_detach_gadget
Date: Wed, 27 May 2026 11:37:27 +0300 [thread overview]
Message-ID: <f44f2c8e-accd-4ea8-8184-7da610340a9f@gmail.com> (raw)
In-Reply-To: <2026052726-vagrancy-lilac-bf72@gregkh>
On 27.05.26 г. 11:03 ч., Greg Kroah-Hartman wrote:
> On Tue, May 26, 2026 at 08:56:15AM +0300, Ivaylo Dimitrov wrote:
>> on linux 6.18.31 I am seeing a NULL pointer dereference during RNDIS gadget
>> teardown.
>
> Does this also happen on the latest 7.1-rc release?
>
I didn't test this on current -rc (this is a mobile phone and not
particularly easy to run latest Linux on), however this looks more like
an object lifetime contract issue than something specific to 6.18.y.
Also, the suspected patch was backported to 6.18.y together with
e002e92e88e12457373ed096b18716d97e7bbb20 ("usb: gadget: u_ether: Fix
NULL pointer deref in eth_get_drvinfo"), which fixes a similar issue, so
I strongly suspect the issue exists in current -rc as well.
>> I suspect the reason is commit:
>>
>> usb: gadget: f_ncm: Fix net_device lifecycle with device_move
>
> Do you have a proposed fix for this issue?
>
Not really, as checking whether dev->gadget is NULL before calling DBG()
looks more like a workaround than a proper fix to me. I also don't know
the subsystem well enough to judge whether switching to netdev_dbg()
instead of DBG() would be appropriate here, or whether that would defeat
the purpose of the existing debug messages (or cause confusion by mixing
gadget and netdev based logging).
I could use some maintainer advice on what they think the proper fix
should look like, and then I'll try to put together a fix.
Thanks,
Ivo
prev parent reply other threads:[~2026-05-27 8:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-26 5:56 Ivaylo Dimitrov
2026-05-27 8:03 ` Greg Kroah-Hartman
2026-05-27 8:37 ` Ivaylo Dimitrov [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=f44f2c8e-accd-4ea8-8184-7da610340a9f@gmail.com \
--to=ivo.g.dimitrov.75@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=khtsai@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=merlijn@wizzup.org \
--cc=sashal@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
all inboxes | Powered by JetHome®