* Re: USB disconnect -> kernel panic
[not found] ` <20120102182255.GC8562@xanatos>
@ 2012-01-03 23:58 ` Greg KH
[not found] ` <20120103235847.GF21311-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 9+ messages in thread
From: Greg KH @ 2012-01-03 23:58 UTC (permalink / raw)
To: Sarah Sharp, Oliver Neukum
Cc: Bdale Garbee, keithp-aN4HjG94KOLQT0dZR+AlfA,
linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-serial-u79uwXL29TY76Z2rM5mHXA
On Mon, Jan 02, 2012 at 10:22:55AM -0800, Sarah Sharp wrote:
> On Sat, Dec 24, 2011 at 03:32:26PM -0700, Bdale Garbee wrote:
> > Hi Sarah! Merry Christmas!
> >
> > I've been working on another production run of Altus Metrum products
> > today, and in the process of flashing and calibrating a pile of our
> > TeleDongle units, I've been seeing sporadic kernel panics when
> > unplugging them from my notebook USB. Has now happened three times this
> > morning.
> >
> > I'm running 3.1.6 now, but I saw this under 3.1.5 too, at least once.
> > The notebook is an HP 2540p.
> >
> > Keith suggested I send you the attached photo of my screen showing the
> > panic info.
>
> It's somewhere in the tty layer, and doesn't look USB related. I think
> Greg KH is the tty maintainer right now, so you might want to ask him.
We've had some cdc_acm driver problems in the past, but I thought they
were all resolved. 3.1.3 should have fixed those problems. We have
some more cleanups queued up for 3.3, but nothing that should be fixing
something like this.
Oliver, any thoughts about this (see the original post on linux-usb for
the crash dump.)
thanks,
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: USB disconnect -> kernel panic
[not found] ` <20120103235847.GF21311-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
@ 2012-01-04 3:09 ` Bdale Garbee
[not found] ` <87fwfwmaeo.fsf-wvU4uTqWWAI@public.gmane.org>
2012-01-04 9:01 ` Oliver Neukum
1 sibling, 1 reply; 9+ messages in thread
From: Bdale Garbee @ 2012-01-04 3:09 UTC (permalink / raw)
To: Greg KH, Sarah Sharp, Oliver Neukum
Cc: keithp-aN4HjG94KOLQT0dZR+AlfA, linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-serial-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 1500 bytes --]
On Tue, 3 Jan 2012 15:58:47 -0800, Greg KH <greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org> wrote:
> On Mon, Jan 02, 2012 at 10:22:55AM -0800, Sarah Sharp wrote:
> > On Sat, Dec 24, 2011 at 03:32:26PM -0700, Bdale Garbee wrote:
> > > Hi Sarah! Merry Christmas!
> > >
> > > I've been working on another production run of Altus Metrum products
> > > today, and in the process of flashing and calibrating a pile of our
> > > TeleDongle units, I've been seeing sporadic kernel panics when
> > > unplugging them from my notebook USB. Has now happened three times this
> > > morning.
> > >
> > > I'm running 3.1.6 now, but I saw this under 3.1.5 too, at least once.
> > > The notebook is an HP 2540p.
> > >
> > > Keith suggested I send you the attached photo of my screen showing the
> > > panic info.
> >
> > It's somewhere in the tty layer, and doesn't look USB related. I think
> > Greg KH is the tty maintainer right now, so you might want to ask him.
>
> We've had some cdc_acm driver problems in the past, but I thought they
> were all resolved. 3.1.3 should have fixed those problems. We have
> some more cleanups queued up for 3.3, but nothing that should be fixing
> something like this.
>
> Oliver, any thoughts about this (see the original post on linux-usb for
> the crash dump.)
For what it's worth, it happened to me again today running 3.2.0-rc7. I
didn't bother photographing the screen again, though I'm happy to do
that if it'll help.
Bdale
[-- Attachment #2: Type: application/pgp-signature, Size: 827 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: USB disconnect -> kernel panic
[not found] ` <20120103235847.GF21311-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2012-01-04 3:09 ` Bdale Garbee
@ 2012-01-04 9:01 ` Oliver Neukum
2012-01-04 17:26 ` Keith Packard
1 sibling, 1 reply; 9+ messages in thread
From: Oliver Neukum @ 2012-01-04 9:01 UTC (permalink / raw)
To: Greg KH
Cc: Sarah Sharp, Oliver Neukum, Bdale Garbee,
keithp-aN4HjG94KOLQT0dZR+AlfA, linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-serial-u79uwXL29TY76Z2rM5mHXA
Am Mittwoch, 4. Januar 2012, 00:58:47 schrieb Greg KH:
> On Mon, Jan 02, 2012 at 10:22:55AM -0800, Sarah Sharp wrote:
> > On Sat, Dec 24, 2011 at 03:32:26PM -0700, Bdale Garbee wrote:
> > > Hi Sarah! Merry Christmas!
> > >
> > > I've been working on another production run of Altus Metrum products
> > > today, and in the process of flashing and calibrating a pile of our
> > > TeleDongle units, I've been seeing sporadic kernel panics when
> > > unplugging them from my notebook USB. Has now happened three times this
> > > morning.
> > >
> > > I'm running 3.1.6 now, but I saw this under 3.1.5 too, at least once.
> > > The notebook is an HP 2540p.
> > >
> > > Keith suggested I send you the attached photo of my screen showing the
> > > panic info.
> >
> > It's somewhere in the tty layer, and doesn't look USB related. I think
> > Greg KH is the tty maintainer right now, so you might want to ask him.
>
> We've had some cdc_acm driver problems in the past, but I thought they
> were all resolved. 3.1.3 should have fixed those problems. We have
> some more cleanups queued up for 3.3, but nothing that should be fixing
> something like this.
>
> Oliver, any thoughts about this (see the original post on linux-usb for
> the crash dump.)
Do you have a pointer? I assumed this to be this issue:
http://www.spinics.net/lists/linux-usb/msg55779.html
And I am waiting for the announced patch.
Regards
Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: USB disconnect -> kernel panic
2012-01-04 9:01 ` Oliver Neukum
@ 2012-01-04 17:26 ` Keith Packard
0 siblings, 0 replies; 9+ messages in thread
From: Keith Packard @ 2012-01-04 17:26 UTC (permalink / raw)
To: Oliver Neukum, Greg KH
Cc: Sarah Sharp, Oliver Neukum, Bdale Garbee, linux-usb, linux-serial
[-- Attachment #1: Type: text/plain, Size: 596 bytes --]
On Wed, 4 Jan 2012 10:01:57 +0100, Oliver Neukum <oneukum@suse.de> wrote:
> Do you have a pointer? I assumed this to be this issue:
> http://www.spinics.net/lists/linux-usb/msg55779.html
> And I am waiting for the announced patch.
The patch was posted to the list about half an hour after the Thilo's
first message:
From: Thilo-Alexander Ginkel <thilo@ginkel.com>
Subject: [PATCH 1/1] usb: cdc-acm: Fix acm_tty_hangup() vs. acm_tty_close() race
Date: Sat, 17 Dec 2011 10:55:10 +0100
Message-Id: <1324115710-14756-1-git-send-email-thilo@ginkel.com>
--
keith.packard@intel.com
[-- Attachment #2: Type: application/pgp-signature, Size: 827 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: USB disconnect -> kernel panic
[not found] ` <87fwfwmaeo.fsf-wvU4uTqWWAI@public.gmane.org>
@ 2012-01-04 23:01 ` Greg KH
2012-01-04 23:26 ` Alan Cox
2012-01-05 5:36 ` Bdale Garbee
0 siblings, 2 replies; 9+ messages in thread
From: Greg KH @ 2012-01-04 23:01 UTC (permalink / raw)
To: Bdale Garbee
Cc: Sarah Sharp, Oliver Neukum, keithp-aN4HjG94KOLQT0dZR+AlfA,
linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-serial-u79uwXL29TY76Z2rM5mHXA
On Tue, Jan 03, 2012 at 08:09:03PM -0700, Bdale Garbee wrote:
> On Tue, 3 Jan 2012 15:58:47 -0800, Greg KH <greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org> wrote:
> > On Mon, Jan 02, 2012 at 10:22:55AM -0800, Sarah Sharp wrote:
> > > On Sat, Dec 24, 2011 at 03:32:26PM -0700, Bdale Garbee wrote:
> > > > Hi Sarah! Merry Christmas!
> > > >
> > > > I've been working on another production run of Altus Metrum products
> > > > today, and in the process of flashing and calibrating a pile of our
> > > > TeleDongle units, I've been seeing sporadic kernel panics when
> > > > unplugging them from my notebook USB. Has now happened three times this
> > > > morning.
> > > >
> > > > I'm running 3.1.6 now, but I saw this under 3.1.5 too, at least once.
> > > > The notebook is an HP 2540p.
> > > >
> > > > Keith suggested I send you the attached photo of my screen showing the
> > > > panic info.
> > >
> > > It's somewhere in the tty layer, and doesn't look USB related. I think
> > > Greg KH is the tty maintainer right now, so you might want to ask him.
> >
> > We've had some cdc_acm driver problems in the past, but I thought they
> > were all resolved. 3.1.3 should have fixed those problems. We have
> > some more cleanups queued up for 3.3, but nothing that should be fixing
> > something like this.
> >
> > Oliver, any thoughts about this (see the original post on linux-usb for
> > the crash dump.)
>
> For what it's worth, it happened to me again today running 3.2.0-rc7. I
> didn't bother photographing the screen again, though I'm happy to do
> that if it'll help.
Ok, can you try the patch below and let me know if it solves the problem
or not?
thanks,
greg k-h
-------------------
From: Thilo-Alexander Ginkel <thilo-6Cr7QIIRUuHQT0dZR+AlfA@public.gmane.org>
Subject: usb: cdc-acm: Fix acm_tty_hangup() vs. acm_tty_close() race
There is a race condition involving acm_tty_hangup() and acm_tty_close() where
hangup() would attempt to access tty->driver_data without proper locking and
NULL checking after close() has potentially already set it to NULL.
One possibility to (sporadically) trigger this behavior is to perform a
suspend/resume cycle with a running WWAN data connection.
This patch addresses the issue by introducing a NULL check for
tty->driver_data in acm_tty_hangup() protected by open_mutex and exiting
gracefully when hangup() is invoked on a device that has already been closed.
Signed-off-by: Thilo-Alexander Ginkel <thilo-6Cr7QIIRUuHQT0dZR+AlfA@public.gmane.org>
---
drivers/usb/class/cdc-acm.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index a8078d0..97f2e58 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -554,10 +554,18 @@ static void acm_port_down(struct acm *acm)
static void acm_tty_hangup(struct tty_struct *tty)
{
- struct acm *acm = tty->driver_data;
- tty_port_hangup(&acm->port);
+ struct acm *acm;
+
mutex_lock(&open_mutex);
+ acm = tty->driver_data;
+
+ if (!acm)
+ goto out;
+
+ tty_port_hangup(&acm->port);
acm_port_down(acm);
+
+out:
mutex_unlock(&open_mutex);
}
--
1.7.5.4
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: USB disconnect -> kernel panic
2012-01-04 23:01 ` Greg KH
@ 2012-01-04 23:26 ` Alan Cox
[not found] ` <20120104232659.05da01ee-38n7/U1jhRXW96NNrWNlrekiAK3p4hvP@public.gmane.org>
2012-01-05 5:36 ` Bdale Garbee
1 sibling, 1 reply; 9+ messages in thread
From: Alan Cox @ 2012-01-04 23:26 UTC (permalink / raw)
To: Greg KH
Cc: Bdale Garbee, Sarah Sharp, Oliver Neukum, keithp, linux-usb,
linux-serial
> Ok, can you try the patch below and let me know if it solves the problem
> or not?
If it does the right fix is to stop clearing tty->driver_data. If
tty->driver_data can go NULL outside of the final release then its
probably an exploitable hole.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: USB disconnect -> kernel panic
[not found] ` <20120104232659.05da01ee-38n7/U1jhRXW96NNrWNlrekiAK3p4hvP@public.gmane.org>
@ 2012-01-05 0:11 ` Greg KH
0 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2012-01-05 0:11 UTC (permalink / raw)
To: Alan Cox
Cc: Bdale Garbee, Sarah Sharp, Oliver Neukum,
keithp-aN4HjG94KOLQT0dZR+AlfA, linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-serial-u79uwXL29TY76Z2rM5mHXA
On Wed, Jan 04, 2012 at 11:26:59PM +0000, Alan Cox wrote:
> > Ok, can you try the patch below and let me know if it solves the problem
> > or not?
>
> If it does the right fix is to stop clearing tty->driver_data. If
> tty->driver_data can go NULL outside of the final release then its
> probably an exploitable hole.
So in acm_tty_close() we shouldn't set driver_data to NULL after we
unregister the device?
Ah, that should happen in tty_operations->cleanup()? It seems that
cdc_acm.c doesn't have that function, which is causing this problem now,
right?
thanks,
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: USB disconnect -> kernel panic
2012-01-04 23:01 ` Greg KH
2012-01-04 23:26 ` Alan Cox
@ 2012-01-05 5:36 ` Bdale Garbee
[not found] ` <87mxa2ww0f.fsf-wvU4uTqWWAI@public.gmane.org>
1 sibling, 1 reply; 9+ messages in thread
From: Bdale Garbee @ 2012-01-05 5:36 UTC (permalink / raw)
To: Greg KH; +Cc: Sarah Sharp, Oliver Neukum, keithp, linux-usb, linux-serial
[-- Attachment #1: Type: text/plain, Size: 504 bytes --]
On Wed, 4 Jan 2012 15:01:49 -0800, Greg KH <greg@kroah.com> wrote:
> Ok, can you try the patch below and let me know if it solves the problem
> or not?
It's hard to prove a negative, but after applying the patch to 3.2.0-rc7
and running with it for a while doing frequent power cycles on our
devices attached via USB, abruptly disconnecting USB during active
serial connections, etc .. I haven't seen the panic again.
Will report if it happens again with the patch in place, but so far so good.
Bdale
[-- Attachment #2: Type: application/pgp-signature, Size: 827 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: USB disconnect -> kernel panic
[not found] ` <87mxa2ww0f.fsf-wvU4uTqWWAI@public.gmane.org>
@ 2012-01-05 20:04 ` Greg KH
0 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2012-01-05 20:04 UTC (permalink / raw)
To: Bdale Garbee
Cc: Sarah Sharp, Oliver Neukum, keithp-aN4HjG94KOLQT0dZR+AlfA,
linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-serial-u79uwXL29TY76Z2rM5mHXA
On Wed, Jan 04, 2012 at 10:36:48PM -0700, Bdale Garbee wrote:
> On Wed, 4 Jan 2012 15:01:49 -0800, Greg KH <greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org> wrote:
> > Ok, can you try the patch below and let me know if it solves the problem
> > or not?
>
> It's hard to prove a negative, but after applying the patch to 3.2.0-rc7
> and running with it for a while doing frequent power cycles on our
> devices attached via USB, abruptly disconnecting USB during active
> serial connections, etc .. I haven't seen the panic again.
>
> Will report if it happens again with the patch in place, but so far so good.
Thanks, I'll queue this up then, and work to solve this in the "correct"
way in a week or so.
thanks,
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2012-01-05 20:04 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <87mxahk3d1.fsf@gag.com>
[not found] ` <20120102182255.GC8562@xanatos>
2012-01-03 23:58 ` USB disconnect -> kernel panic Greg KH
[not found] ` <20120103235847.GF21311-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2012-01-04 3:09 ` Bdale Garbee
[not found] ` <87fwfwmaeo.fsf-wvU4uTqWWAI@public.gmane.org>
2012-01-04 23:01 ` Greg KH
2012-01-04 23:26 ` Alan Cox
[not found] ` <20120104232659.05da01ee-38n7/U1jhRXW96NNrWNlrekiAK3p4hvP@public.gmane.org>
2012-01-05 0:11 ` Greg KH
2012-01-05 5:36 ` Bdale Garbee
[not found] ` <87mxa2ww0f.fsf-wvU4uTqWWAI@public.gmane.org>
2012-01-05 20:04 ` Greg KH
2012-01-04 9:01 ` Oliver Neukum
2012-01-04 17:26 ` Keith Packard
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).