From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA8B012BF21; Tue, 30 Apr 2024 10:42:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714473764; cv=none; b=rjaDrtN+GAMEz121kA9vN+lGLvzt7LOwGINvieXH2IxVLfkRmdE6A+AQh0QYL2h0lhvn3FJu+YPOy4XW98UA4taTSrwcj78z/KoTpGD3KK1KOXHjc/GGgqvGI0yaffWW7YtRstw7eEP7GORToGTwIsYEPayzgJj7AQcseFb6AIQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714473764; c=relaxed/simple; bh=lWrVEkCngJmGQcni8RmEF1NI8KNJMug8T1n/m3VicUw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RD2PCBUY+/iWgwwByM8KTZiI7kPDiCGSUjHQOhfHdQ5aXbrGhJU+jFJq2EYiByDyXJpfoqzKnvAbR7O0z4Jr4YO1oHV/aSFX7StecFUt8ZHRUVtFdAIRxw/UwqXvNvD2MKPzDoklb+M32D84AjHIsT26jModpWXib/0aSVuAOeA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hK01tYxW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="hK01tYxW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68CBCC2BBFC; Tue, 30 Apr 2024 10:42:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1714473763; bh=lWrVEkCngJmGQcni8RmEF1NI8KNJMug8T1n/m3VicUw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hK01tYxWJpsBE+qw9mfEdLFgd2Gusx64sgePrICBBsSbh83jSh6hBLu0mfx1Jsk0X WwtbBFl1JGqdQDzC+if9dw+Ysbf9JbWp4GFpCa4zk95W6X+UQIwv8nxwnUelJL2SK4 nOfOXVrm7690kprue+6LnODm7u/cgk8Nq097P/v8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dan Carpenter , Minas Harutyunyan Subject: [PATCH 4.19 31/77] usb: dwc2: host: Fix dereference issue in DDMA completion flow. Date: Tue, 30 Apr 2024 12:39:10 +0200 Message-ID: <20240430103042.050514202@linuxfoundation.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240430103041.111219002@linuxfoundation.org> References: <20240430103041.111219002@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Minas Harutyunyan commit eed04fa96c48790c1cce73c8a248e9d460b088f8 upstream. Fixed variable dereference issue in DDMA completion flow. Fixes: b258e4268850 ("usb: dwc2: host: Fix ISOC flow in DDMA mode") CC: stable@vger.kernel.org Reported-by: Dan Carpenter Closes: https://lore.kernel.org/linux-usb/2024040834-ethically-rumble-701f@gregkh/T/#m4c4b83bef0ebb4b67fe2e0a7d6466cbb6f416e39 Signed-off-by: Minas Harutyunyan Link: https://lore.kernel.org/r/cc826d3ef53c934d8e6d98870f17f3cdc3d2755d.1712665387.git.Minas.Harutyunyan@synopsys.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc2/hcd_ddma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/usb/dwc2/hcd_ddma.c +++ b/drivers/usb/dwc2/hcd_ddma.c @@ -897,13 +897,15 @@ static int dwc2_cmpl_host_isoc_dma_desc( struct dwc2_dma_desc *dma_desc; struct dwc2_hcd_iso_packet_desc *frame_desc; u16 frame_desc_idx; - struct urb *usb_urb = qtd->urb->priv; + struct urb *usb_urb; u16 remain = 0; int rc = 0; if (!qtd->urb) return -EINVAL; + usb_urb = qtd->urb->priv; + dma_sync_single_for_cpu(hsotg->dev, qh->desc_list_dma + (idx * sizeof(struct dwc2_dma_desc)), sizeof(struct dwc2_dma_desc),