linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: wim@djo.tudelft.nl
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: crash by cdc_acm driver in kernels 4.8-rc1/5
Date: Wed, 28 Sep 2016 11:16:04 +0200	[thread overview]
Message-ID: <1475054164.4635.7.camel@suse.com> (raw)
In-Reply-To: <20160927163414.GA21487@djo.tudelft.nl>

[-- Attachment #1: Type: text/plain, Size: 962 bytes --]

On Tue, 2016-09-27 at 18:34 +0200, Wim Osterholt wrote:
> On Thu, Sep 22, 2016 at 04:40:50PM +0200, Oliver Neukum wrote:
> > 
> > dmesg -c
> > echo 9 > /proc/sysrq-trigger
> > modprobe cdc_acm
> > echo "module cdc_acm +mpf" > /sys/kernel/debug/dynamic_debug/control
> > 
> > [plug your device in]
> > 
> > and provide the full output of dmesg after that.
> 
> After some experimenting I succeeded in grabbing it over the serial port.
> The console was immedately frozen, but the serial port kept working:

Very good. This is a valid oops. We can do two things. When I
decode it, seems to crash in acm_alloc_minor() which does not make
sense. It is likely that our kernels or compilers are a bit different.
Could you please call gdb on your kernel module cdc-acm.ko
and do:

list *(acm_probe+0x4ee)

this should show you where it crashes. In addition I've attached
a patch with paranoid debugging. Could you compile and test a kernel
with it?

	Regards
		Oliver


[-- Attachment #2: 0001-CDC-ACM-more-paranoid-debugging.patch --]
[-- Type: text/x-patch, Size: 1171 bytes --]

From 28bb525ab295bd014768868eafb6a76d0c0d80c2 Mon Sep 17 00:00:00 2001
From: Oliver Neukum <oneukum@suse.com>
Date: Wed, 28 Sep 2016 11:11:04 +0200
Subject: [PATCH] CDC-ACM: more paranoid debugging

---
 drivers/usb/class/cdc-acm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 78f0f85..283e16e 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1324,10 +1324,13 @@ made_compressed_probe:
 	if (minor < 0)
 		goto alloc_fail1;
 
+	WARN_ON(!epctrl);
 	ctrlsize = usb_endpoint_maxp(epctrl);
+	WARN_ON(!epread);
 	readsize = usb_endpoint_maxp(epread) *
 				(quirks == SINGLE_RX_URB ? 1 : 2);
 	acm->combined_interfaces = combined_interfaces;
+	WARN_ON(!epwrite);
 	acm->writesize = usb_endpoint_maxp(epwrite) * 20;
 	acm->control = control_interface;
 	acm->data = data_interface;
@@ -1352,6 +1355,7 @@ made_compressed_probe:
 	acm->port.ops = &acm_port_ops;
 	init_usb_anchor(&acm->delayed);
 	acm->quirks = quirks;
+	dev_dbg(&intf->dev, "control structures set up\n");
 
 	buf = usb_alloc_coherent(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma);
 	if (!buf)
-- 
2.6.2


  reply	other threads:[~2016-09-28  9:16 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-08 11:58 crash by cdc_acm driver in kernels 4.8-rc1/5 Wim Osterholt
2016-09-08 12:20 ` Oliver Neukum
2016-09-08 12:58   ` Wim Osterholt
2016-09-08 13:05     ` Oliver Neukum
2016-09-08 15:00       ` Wim Osterholt
2016-09-08 16:54       ` Wim Osterholt
2016-09-09 13:24       ` Wim Osterholt
2016-09-12  2:43       ` Wim Osterholt
2016-09-20 13:05         ` Oliver Neukum
2016-09-20 15:45           ` Wim Osterholt
2016-09-21 12:21             ` Oliver Neukum
2016-09-21 16:21               ` Wim Osterholt
2016-09-21 16:41               ` Wim Osterholt
2016-09-22 14:40                 ` Oliver Neukum
2016-09-22 17:56                   ` Wim Osterholt
2016-09-22 19:21                   ` Wim Osterholt
2016-09-23 10:04                   ` Wim Osterholt
2016-09-27 16:34                   ` Wim Osterholt
2016-09-28  9:16                     ` Oliver Neukum [this message]
2016-09-28 14:46                       ` Wim Osterholt
2016-09-28 15:08                       ` Wim Osterholt
2016-09-28 15:23                         ` Oliver Neukum
2016-09-29 13:26                           ` Wim Osterholt
2016-10-06 10:53                             ` Oliver Neukum
2016-10-17 14:10     ` Oliver Neukum
2016-10-17 15:20       ` Wim Osterholt
2016-10-18 12:18         ` Oliver Neukum
2016-10-18 14:51           ` Wim Osterholt
2016-11-05 13:34           ` Wim Osterholt
2016-11-15  0:16           ` Wim Osterholt
2016-11-15 11:07             ` Oliver Neukum
2016-11-15 11:26             ` poma
2016-11-15 13:29               ` Wim Osterholt
2016-11-16 12:34                 ` Oliver Neukum
2016-11-16 15:07                   ` Wim Osterholt
2016-11-17  1:57                     ` Wim Osterholt
2016-11-17  9:14                       ` Wim Osterholt
2016-11-17 16:11                         ` Wim Osterholt
2016-11-21 13:19                           ` Oliver Neukum
2016-11-21 15:58                             ` Wim Osterholt
2016-11-21 20:23                               ` Wim Osterholt
2016-11-21 23:49                                 ` poma
2016-11-22 17:50                               ` Bjørn Mork
2016-11-23  0:48                                 ` Wim Osterholt
2016-11-22 15:38                             ` Wim Osterholt
2016-11-22 18:08                               ` Bjørn Mork
2016-11-23  0:54                                 ` Wim Osterholt
2016-11-23  7:37                                   ` Bjørn Mork
2016-11-23 15: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=1475054164.4635.7.camel@suse.com \
    --to=oneukum@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=wim@djo.tudelft.nl \
    /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).