From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Greg KH <gregkh@linuxfoundation.org>,
Marek Szyprowski <m.szyprowski@samsung.com>
Cc: pmenzel@molgen.mpg.de, mika.westerberg@linux.intel.com,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-samsung-soc@vger.kernel.org, krzk@kernel.org,
stable <stable@vger.kernel.org>
Subject: Re: [RFT PATCH v2] xhci: Fix memory leak when caching protocol extended capability PSI tables
Date: Wed, 12 Feb 2020 11:01:52 +0200 [thread overview]
Message-ID: <a6eedbbf-ce9f-b9c8-beee-a9c941051aeb@linux.intel.com> (raw)
In-Reply-To: <20200211161316.GA1914687@kroah.com>
On 11.2.2020 18.13, Greg KH wrote:
> On Tue, Feb 11, 2020 at 04:12:40PM +0100, Marek Szyprowski wrote:
>> Hi Mathias,
>>
>> On 11.02.2020 16:01, Mathias Nyman wrote:
>>> xhci driver assumed that xHC controllers have at most one custom
>>> supported speed table (PSI) for all usb 3.x ports.
>>> Memory was allocated for one PSI table under the xhci hub structure.
>>>
>>> Turns out this is not the case, some controllers have a separate
>>> "supported protocol capability" entry with a PSI table for each port.
>>> This means each usb3 roothub port can in theory support different custom
>>> speeds.
>>>
>>> To solve this, cache all supported protocol capabilities with their PSI
>>> tables in an array, and add pointers to the xhci port structure so that
>>> every port points to its capability entry in the array.
>>>
>>> When creating the SuperSpeedPlus USB Device Capability BOS descriptor
>>> for the xhci USB 3.1 roothub we for now will use only data from the
>>> first USB 3.1 capable protocol capability entry in the array.
>>> This could be improved later, this patch focuses resolving
>>> the memory leak.
>>>
>>> Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
>>> Reported-by: Sajja Venkateswara Rao <VenkateswaraRao.Sajja@amd.com>
>>> Fixes: 47189098f8be ("xhci: parse xhci protocol speed ID list for usb 3.1 usage")
>>> Cc: stable <stable@vger.kernel.org> # v4.4+
>>> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
>>
>> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
>
> Nice!
>
> Should I revert the first and then apply this?
>
Yes, please
Thanks
-Mathias
next prev parent reply other threads:[~2020-02-12 8:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20d0559f-8d0f-42f5-5ebf-7f658a172161@linux.intel.com>
2020-02-11 15:01 ` [RFT PATCH v2] xhci: Fix memory leak when caching protocol extended capability PSI tables Mathias Nyman
2020-02-11 15:12 ` Marek Szyprowski
2020-02-11 16:13 ` Greg KH
2020-02-12 9:01 ` Mathias Nyman [this message]
2020-02-12 17:51 ` Greg KH
2020-02-13 13:33 ` Jon Hunter
2020-02-14 7:47 ` Mathias Nyman
2020-02-14 8:35 ` Jon Hunter
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=a6eedbbf-ce9f-b9c8-beee-a9c941051aeb@linux.intel.com \
--to=mathias.nyman@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=mika.westerberg@linux.intel.com \
--cc=pmenzel@molgen.mpg.de \
--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 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).