From: Greg KH <gregkh@linuxfoundation.org>
To: Dan Halbert <halbert@halwitz.org>
Cc: Linux USB List <linux-usb@vger.kernel.org>
Subject: Re: Kernel crash during USB device enumeration or MSC mounting
Date: Sat, 4 Jul 2020 17:36:07 +0200 [thread overview]
Message-ID: <20200704153607.GB433456@kroah.com> (raw)
In-Reply-To: <20200704153429.GA433456@kroah.com>
On Sat, Jul 04, 2020 at 05:34:29PM +0200, Greg KH wrote:
> On Sat, Jul 04, 2020 at 11:15:29AM -0400, Dan Halbert wrote:
> > Hi -- I was referred to this list by Kai-Heng Feng after filing an issue on
> > the Ubuntu bug tracker here:
> >
> > https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1871143.
> >
> > Many further details are in that report, including "lsusb -v", "lspci -v",
> > dmesg, and call trace output.
>
> Where is the kernel crash in those logs? I don't seem to be able to
> find the correct one, can you just send it here so we can read and
> comment on it in the email thread? I see something odd with the fat
> driver, are you sure you are creating a correct filesystem image for it
> to handle?
>
> > We are seeing kernel crashes from certain composite USB devices that present
> > as MSC, CDC, HID, and MIDI. The devices are microcontroller boards running
> > CircuitPython (https://github.com/adafruit/circuitpython), which uses the
> > TinyUSB USB stack: https://github.com/hathach/tinyusb.
> >
> > The board is commanded to forcibly reformat its MSC FAT12 filesystem and
> > then reset. This causes a USB reset and re-enumeration, which can often
> > (though not all the time) cause a kernel crash.
>
> What do you mean by "reset"? Are you disconnecting the device from the
> USB bus causing it to electronically be removed and then added back? Or
> doing something else?
>
> > The crashes may be some kind of use-after-free bug in the kernel USB driver.
>
> Maybe, but the traces seem _very_ short on the stuff on the web page,
> can you send us the full traceback from the crash?
>
> > We have seen this or similar crashes caused by several different boards that
> > use different microcontrollers. The hosts are x64, including Dell
> > Intel-chipset desktops and an older Mac Mini running Linux (also Intel
> > chipset).
>
> That's not good, but might mean it is a filesystem issue, not a USB
> issue.
Ok, this trace:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1871143/comments/4
seems to point at the filesystem code. Are you sure you are creating
the image correctly?
If you unplug and plug the device back in with that same filesystem
image, does it work, or still crash?
thanks,
greg k-h
next prev parent reply other threads:[~2020-07-04 15:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-04 15:15 Kernel crash during USB device enumeration or MSC mounting Dan Halbert
2020-07-04 15:34 ` Greg KH
2020-07-04 15:36 ` Greg KH [this message]
2020-07-04 15:56 ` Dan Halbert
2020-07-04 16:09 ` Alan Stern
2020-07-04 16:33 ` Dan Halbert
2020-07-04 18:02 ` Alan Stern
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=20200704153607.GB433456@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=halbert@halwitz.org \
--cc=linux-usb@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