ixp4xx: remove linux 3.10 support
[openwrt.git] / target / linux / brcm2708 / patches-3.10 / 0053-dwc_otg-fix-potential-use-after-free-case-in-interru.patch
1 From 898039471876ec67191d7afcabea38ac5e90285a Mon Sep 17 00:00:00 2001
2 From: P33M <P33M@github.com>
3 Date: Thu, 28 Feb 2013 16:52:51 +0000
4 Subject: [PATCH 053/196] dwc_otg: fix potential use-after-free case in
5  interrupt handler
6
7 If a transaction had previously aborted, certain interrupts are
8 enabled to track error counts and reset where necessary. On IN
9 endpoints the host generates an ACK interrupt near-simultaneously
10 with completion of transfer. In the case where this transfer had
11 previously had an error, this results in a use-after-free on
12 the QTD memory space with a 1-byte length being overwritten to
13 0x00.
14 ---
15  drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 3 ++-
16  1 file changed, 2 insertions(+), 1 deletion(-)
17
18 diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
19 index e8c91e7..0c81a64 100644
20 --- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
21 +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
22 @@ -2223,7 +2223,8 @@ int32_t dwc_otg_hcd_handle_hc_n_intr(dwc_otg_hcd_t * dwc_otg_hcd, uint32_t num)
23                 retval |= handle_hc_nak_intr(dwc_otg_hcd, hc, hc_regs, qtd);
24         }
25         if (hcint.b.ack) {
26 -               retval |= handle_hc_ack_intr(dwc_otg_hcd, hc, hc_regs, qtd);
27 +               if(!hcint.b.chhltd)
28 +                       retval |= handle_hc_ack_intr(dwc_otg_hcd, hc, hc_regs, qtd);
29         }
30         if (hcint.b.nyet) {
31                 retval |= handle_hc_nyet_intr(dwc_otg_hcd, hc, hc_regs, qtd);
32 -- 
33 1.9.1
34