All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@intel.com>
To: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linux USB Mailing List <linux-usb@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] xhci-ring: Fix Null pointer dereference
Date: Thu, 28 Aug 2014 18:20:17 +0300	[thread overview]
Message-ID: <53FF48B1.5090901@intel.com> (raw)
In-Reply-To: <CAPybu_1UytoxXk-t7u_3vQ6KL-5DmVUz1u5PiDLysBCvgit--A@mail.gmail.com>

On 08/28/2014 03:36 PM, Ricardo Ribalda Delgado wrote:
> Hello Mathias
> 
> This is the dmesg output after your patch. No WARN(), no crash :), but
> still some weird messages:
> 
> [  146.511623] usb 2-2: new SuperSpeed USB device number 2 using xhci_hcd
> [  146.531652] usb 2-2: New USB device found, idVendor=0525, idProduct=a4a5
> [  146.531661] usb 2-2: New USB device strings: Mfr=3, Product=4, SerialNumber=0
> [  146.531666] usb 2-2: Product: Mass Storage Gadget
> [  146.531670] usb 2-2: Manufacturer: Linux 3.16.0-qtec-standard+ with net2280
> [  147.772743] usb-storage 2-2:1.0: USB Mass Storage device detected
> [  147.773018] usb-storage 2-2:1.0: Quirks match for vid 0525 pid a4a5: 10000
> [  147.773185] scsi host6: usb-storage 2-2:1.0
> [  147.773361] usbcore: registered new interface driver usb-storage
> [  147.788950] usbcore: registered new interface driver uas
> [  148.772699] scsi 6:0:0:0: Direct-Access     Linux    File-Stor
> Gadget 0316 PQ: 0 ANSI: 2
> [  148.773192] sd 6:0:0:0: Attached scsi generic sg2 type 0
> [  148.774860] sd 6:0:0:0: [sdb] 32768 512-byte logical blocks: (16.7
> MB/16.0 MiB)
> [  148.888294] usb 2-2: reset SuperSpeed USB device number 2 using xhci_hcd
> [  148.905202] xhci_hcd 0000:0e:00.0: xHCI xhci_drop_endpoint called
> with disabled ep ffff880036f3cc88
> [  148.905207] xhci_hcd 0000:0e:00.0: xHCI xhci_drop_endpoint called
> with disabled ep ffff880036f3cc40
> [  148.906324] xhci_hcd 0000:0e:00.0: Error: Failed finding new dequeue state
> [  148.912639] sd 6:0:0:0: [sdb] Test WP failed, assume Write Enabled
> [  149.014972] sd 6:0:0:0: [sdb] Write cache: enabled, read cache:
> enabled, doesn't support DPO or FUA
> [  149.128640] usb 2-2: reset SuperSpeed USB device number 2 using xhci_hcd
> [  149.145953] xhci_hcd 0000:0e:00.0: xHCI xhci_drop_endpoint called
> with disabled ep ffff880036f3cc88
> [  149.145963] xhci_hcd 0000:0e:00.0: xHCI xhci_drop_endpoint called
> with disabled ep ffff880036f3cc40
> [  149.147525] xhci_hcd 0000:0e:00.0: Error: Failed finding new dequeue state
> [  149.268626] usb 2-2: reset SuperSpeed USB device number 2 using xhci_hcd
> [  149.285563] xhci_hcd 0000:0e:00.0: xHCI xhci_drop_endpoint called
> with disabled ep ffff880036f3cc88
> [  149.285573] xhci_hcd 0000:0e:00.0: xHCI xhci_drop_endpoint called
> with disabled ep ffff880036f3cc40
> [  149.286904] xhci_hcd 0000:0e:00.0: Error: Failed finding new dequeue state
> [  149.404621] usb 2-2: reset SuperSpeed USB device number 2 using xhci_hcd
> [  149.421397] xhci_hcd 0000:0e:00.0: xHCI xhci_drop_endpoint called
> with disabled ep ffff880036f3cc88
> [  149.421404] xhci_hcd 0000:0e:00.0: xHCI xhci_drop_endpoint called
> with disabled ep ffff880036f3cc40
> [  149.422855] xhci_hcd 0000:0e:00.0: Error: Failed finding new dequeue state
> [  149.431667]  sdb: unknown partition table
> [  149.544713] usb 2-2: reset SuperSpeed USB device number 2 using xhci_hcd
> [  149.561649] xhci_hcd 0000:0e:00.0: xHCI xhci_drop_endpoint called
> with disabled ep ffff880036f3cc88
> [  149.561658] xhci_hcd 0000:0e:00.0: xHCI xhci_drop_endpoint called
> with disabled ep ffff880036f3cc40
> [  149.563021] xhci_hcd 0000:0e:00.0: Error: Failed finding new dequeue state
> [  149.680733] usb 2-2: reset SuperSpeed USB device number 2 using xhci_hcd
> [  149.697766] xhci_hcd 0000:0e:00.0: xHCI xhci_drop_endpoint called
> with disabled ep ffff880036f3cc88
> [  149.697774] xhci_hcd 0000:0e:00.0: xHCI xhci_drop_endpoint called
> with disabled ep ffff880036f3cc40
> [  149.699025] xhci_hcd 0000:0e:00.0: Error: Failed finding new dequeue state
> [  149.706700] sd 6:0:0:0: [sdb] Write cache: enabled, read cache:
> enabled, doesn't support DPO or FUA
> [  149.706712] sd 6:0:0:0: [sdb] Attached SCSI disk
> [  149.820933] usb 2-2: reset SuperSpeed USB device number 2 using xhci_hcd
> [  149.837887] xhci_hcd 0000:0e:00.0: xHCI xhci_drop_endpoint called
> with disabled ep ffff880036f3cc88
> [  149.837895] xhci_hcd 0000:0e:00.0: xHCI xhci_drop_endpoint called
> with disabled ep ffff880036f3cc40
> [  149.839242] xhci_hcd 0000:0e:00.0: Error: Failed finding new dequeue state
> [  155.752101] usb 3-1.5.6: reset high-speed USB device number 10 using ehci-pci
> [  155.866642] cdc_acm 3-1.5.6:1.1: This device cannot do calls on its
> own. It is not a modem.
> [  155.866756] cdc_acm 3-1.5.6:1.1: ttyACM0: USB ACM device
> [  155.867613] usb 3-1.5.6: usbfs: process 1521 (pool) did not claim
> interface 0 before use
> [  160.471327] pool[1680]: segfault at fffffffffc0e61c0 ip
> 00007f570f036200 sp 00007f570639f0d0 error 5 in
> libc-2.19.so[7f570efee000+19f000]
> 
> Thanks!
> 

Thanks, I see you already found bug 75521 
https://bugzilla.kernel.org/show_bug.cgi?id=75521

I think this is the same cause.
Currently I suspect that one halted endpoint is not handled before the entire device is reset.
After device reset we try to handle the old halted endpoint that has a pointer to a invalid old dequeue state.

I'll see If I can make a patch that clears all pending halted endpoint states (xhci software internal states) when a device is reset.

If I send testpatches to the bug can you try them out on top of 3.17-rc2?

-Mathias 

  reply	other threads:[~2014-08-28 15:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-26 15:47 [PATCH] xhci-ring: Fix Null pointer dereference Ricardo Ribalda Delgado
2014-08-27 14:25 ` Mathias Nyman
2014-08-27 14:14   ` Ricardo Ribalda Delgado
2014-08-27 15:27     ` Mathias Nyman
2014-08-27 16:10       ` Ricardo Ribalda Delgado
2014-08-28 10:41         ` Mathias Nyman
2014-08-28 10:50           ` Ricardo Ribalda Delgado
2014-08-28 12:36             ` Ricardo Ribalda Delgado
2014-08-28 15:20               ` Mathias Nyman [this message]
2014-08-28 15:09                 ` Ricardo Ribalda Delgado
2014-08-29 15:20                   ` Mathias Nyman
2014-09-01  9:02                     ` Ricardo Ribalda Delgado
2014-09-01  9:36                       ` Ricardo Ribalda Delgado
2014-09-01 10:37                         ` Mathias Nyman
2014-09-01 10:26                           ` Ricardo Ribalda Delgado
2014-09-01 11:12                             ` Mathias Nyman
2014-09-01 11:19                               ` Ricardo Ribalda Delgado
2014-09-01 12:25                                 ` Mathias Nyman
2014-09-01 12:14                                   ` Ricardo Ribalda Delgado
2014-09-01 14:16                           ` 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=53FF48B1.5090901@intel.com \
    --to=mathias.nyman@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=ricardo.ribalda@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.