[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1603181013020.1866-100000@iolanthe.rowland.org>
Date: Fri, 18 Mar 2016 10:13:34 -0400 (EDT)
From: Alan Stern <stern@...land.harvard.edu>
To: Nicolai Stange <nicstange@...il.com>
cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Peter Chen <peter.chen@...escale.com>,
Philipp Zabel <p.zabel@...gutronix.de>,
Rob Herring <robh@...nel.org>, Arnd Bergmann <arnd@...db.de>,
Geliang Tang <geliangtang@....com>,
Stefan Koch <stefan.koch10@...il.com>,
Viresh Kumar <viresh.kumar@...aro.org>,
Tomeu Vizoso <tomeu.vizoso@...labora.com>,
Oliver Neukum <oneukum@...e.com>, <linux-usb@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] usb/core: usb_alloc_dev(): fix setting of ->portnum
On Thu, 17 Mar 2016, Nicolai Stange wrote:
> With commit 69bec7259853 ("USB: core: let USB device know device node"),
> the port1 argument of usb_alloc_dev() gets overwritten as follows:
>
> ... usb_alloc_dev(..., unsigned port1)
> {
> ...
> if (!parent->parent) {
> port1 = usb_hcd_find_raw_port_number(..., port1);
> }
> ...
> }
>
> Later on, this now overwritten port1 gets assigned to ->portnum:
>
> dev->portnum = port1;
>
> However, since xhci_find_raw_port_number() isn't idempotent, the
> aforementioned commit causes a number of KASAN splats like the following:
...
> Fix this by not overwriting the port1 argument in usb_alloc_dev(), but
> storing the raw port number as required by OF in an additional variable,
> raw_port.
>
> Fixes: 69bec7259853 ("USB: core: let USB device know device node")
> Signed-off-by: Nicolai Stange <nicstange@...il.com>
> ---
> Applicable to linux-next-20160317
>
> Changes to v1:
> - Initialize raw_port with port1
Acked-by: Alan Stern <stern@...land.harvard.edu>
Powered by blists - more mailing lists