All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-usb@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first
Date: Wed, 23 Nov 2016 16:44:03 +0200	[thread overview]
Message-ID: <5835AB33.4050701@linux.intel.com> (raw)
In-Reply-To: <d9152f4c-2c3c-6a75-a737-9138dc2d49d6@roeck-us.net>

On 23.11.2016 15:32, Guenter Roeck wrote:
> On 11/23/2016 04:24 AM, Mathias Nyman wrote:
>> the tt_info provided by a HS hub might be in use to by a child device
>> Make sure we free the devices in the correct order.
>>
>> This is needed in special cases such as when xhci controller is
>> reset when resuming from hibernate, and all virt_devices are freed.
>>
>> Also free the virt_devices starting from max slot_id as children
>> more commonly have higher slot_id than parent.
>>
>> CC: <stable@vger.kernel.org>
>> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
>>
>> ---
>>
>> Guenter Roeck, does this work for you?
>>
>> A rework of how tt_info is stored and used might be needed,
>> but that will take some time and won't go to stable as easily.
>
> I'll give it a try. One concern, though: xhci_free_virt_device() is called
> from multiple places, and does not always remove all devices. Is it save
> to assume that all other callers remove children first ?
>

This should be the only place that xhci does a massive xhci_free_virt_device(),

In the other places it's initiated per device by usb core which should handle
child-parent relationships, or then just error paths when failing to allocate
a device in the first place (no children yet)

-Mathias





  reply	other threads:[~2016-11-23 14:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-15 20:36 [RFC PATCH] xhci: Fix memory use after free in xhci_free_virt_device Guenter Roeck
2016-11-17 15:11 ` Mathias Nyman
2016-11-23 12:24   ` [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first Mathias Nyman
2016-11-23 13:32     ` Guenter Roeck
2016-11-23 14:44       ` Mathias Nyman [this message]
2016-11-24  9:02     ` Felipe Balbi
2016-11-24  9:57       ` Mathias Nyman
2016-11-24 11:03         ` Felipe Balbi
2016-11-24 12:07           ` Mathias Nyman
2016-11-24 19:58     ` Guenter Roeck
2016-11-28 20:24     ` Guenter Roeck
2016-11-30 11:41       ` Mathias Nyman
2016-12-09 21:28         ` Guenter Roeck
2016-12-12 13:50           ` Mathias Nyman

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=5835AB33.4050701@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=stable@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 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.