Skip to content

Commit 9d0fc4f

Browse files
P33Mpopcornmix
authored andcommitted
dwc_otg: fix potential use-after-free case in interrupt handler
If a transaction had previously aborted, certain interrupts are enabled to track error counts and reset where necessary. On IN endpoints the host generates an ACK interrupt near-simultaneously with completion of transfer. In the case where this transfer had previously had an error, this results in a use-after-free on the QTD memory space with a 1-byte length being overwritten to 0x00.
1 parent a02d8dd commit 9d0fc4f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2223,7 +2223,8 @@ int32_t dwc_otg_hcd_handle_hc_n_intr(dwc_otg_hcd_t * dwc_otg_hcd, uint32_t num)
22232223
retval |= handle_hc_nak_intr(dwc_otg_hcd, hc, hc_regs, qtd);
22242224
}
22252225
if (hcint.b.ack) {
2226-
retval |= handle_hc_ack_intr(dwc_otg_hcd, hc, hc_regs, qtd);
2226+
if(!hcint.b.chhltd)
2227+
retval |= handle_hc_ack_intr(dwc_otg_hcd, hc, hc_regs, qtd);
22272228
}
22282229
if (hcint.b.nyet) {
22292230
retval |= handle_hc_nyet_intr(dwc_otg_hcd, hc, hc_regs, qtd);

0 commit comments

Comments
 (0)