]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
usb: dwc2: fix the incorrect bitmaps for the ports of multi_tt hub
authorWilliam Wu <william.wu@rock-chips.com>
Mon, 21 May 2018 10:12:00 +0000 (18:12 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 14 Jan 2019 09:28:55 +0000 (09:28 +0000)
commit13ebadf175eaf0cbe464e4bc8302575f932c1e90
tree5f1756048b1a5dd89992130e0a76c7eacdf3e96d
parentf4b668ca4b1f692f84d6de42161a0bd30640f9af
usb: dwc2: fix the incorrect bitmaps for the ports of multi_tt hub

BugLink: http://bugs.launchpad.net/bugs/1808185
commit 8760675932ddb614e83702117d36ea644050c609 upstream.

The dwc2_get_ls_map() use ttport to reference into the
bitmap if we're on a multi_tt hub. But the bitmaps index
from 0 to (hub->maxchild - 1), while the ttport index from
1 to hub->maxchild. This will cause invalid memory access
when the number of ttport is hub->maxchild.

Without this patch, I can easily meet a Kernel panic issue
if connect a low-speed USB mouse with the max port of FE2.1
multi-tt hub (1a40:0201) on rk3288 platform.

Fixes: 9f9f09b048f5 ("usb: dwc2: host: Totally redo the microframe scheduler")
Cc: <stable@vger.kernel.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Acked-by: Minas Harutyunyan hminas@synopsys.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/usb/dwc2/hcd_queue.c