From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796387672; b=eQRt6PA+5rc6Msk8aj1YboNZaSJLfoeDXZThHndAg+nTqemt54efOHmUQJbJmM5/KJoQ ba3wK8SLOAX6sBISPJeWKs1Opz7ShioxfAs1xp9hYVI9v2PqHBJpf6Aofc7QP1/CXBbOk 2QQ5j3SJlIPTFClS7HBn+rOrvRFZvqN4/geO+5Fk37Bmkiq9vajXkR/GO3d5Zdmv7SgJv usG4TxbeaxjcaG2SE4knjK0YfCAlVL1Hdk6FF7BIAb2IEYrCbVZbFxCz3XHTSikHAgW9f J9dy7ce9Vxve6jTNijkpmv2SUrtN7FKN7MIY5ZFta1ZjFMxco/EFxNxnLAzq3bLnBUQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796387672; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=A4eY+A0O98Cz9v3QbFK98phBc7DcuAIEm6G+0ffQoNE=; b=fJbRBKxF0tsmN8Dmw5+FBwrJSzAtlUAgWw4QiotEZByKc/shYxmoxEol1HmEEURvjKt9 PHS+Eu+s6FP28gu+L1ide+HxUGKab6IaIzGZGq4ROthMpj6qOS4SXjzi8frizIxU4yVXI sxi8yGEYQpU7Y4ZgjVJ/oDzxQBpB4j7nbpvRzqcLECscpUfmTQR1qZf5uupU+PPNsZBt3 Bz+kxnBIgdlVHMjQVid4/FRBf7S0PonEMjjE82Ddq6VVuqzRgN3T5/KY5FAE6iGKhKQeF rbnGMd8mgwGHkvobN29M9da7psmdHWCVfrTS7lsrbdkiIfyRbQoZPJcvqdoMfZz2E7Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=e5k+dWFq; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 924A6606A322; Fri, 4 Dec 2026 12:34:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=e5k+dWFq Received: by smtp.kernel.org (Postfix) with ESMTPSA id 091A81F000C2; Fri, 4 Dec 2026 12:34:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796387672; bh=A4eY+A0O98Cz9v3QbFK98phBc7DcuAIEm6G+0ffQoNE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=e5k+dWFqTaYhgC7ycA/7ZjplbJR/8AS82/Qeiwp33aGRM+mS1ACXqr1YqjngZPLa7 shG5oZ1dL9M9yxOU2k3KrwCsFwp2v1Va0Zcpp79veo1kaz+jDcbqYXxzl8RtJDsSCL 284s/EiOY4UeODAIKUmPNcEOWptdRxU0SHMG83y4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Frank Li , Linus Walleij , Vinod Koul , Sasha Levin Subject: [PATCH 6.1 0342/1059] dmaengine: ste_dma40: Validate DMA specifier length Date: Fri, 4 Dec 2026 18:57:53 +0900 Message-ID: <20261204100653.125942457@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Linus Walleij [ Upstream commit 9f1064ebe17cf3ab65ac6eb166398e02678aea33 ] The DMA40 binding requires three cells, but d40_xlate() reads args[0], args[1], and args[2] without checking args_count. A malformed provider node can specify fewer cells, leaving some of these values uninitialized when the OF DMA core invokes the translation callback. Reject specifiers that do not contain exactly three cells before reading the argument array. Fixes: fa332de5c6b3 ("dmaengine: ste_dma40: Supply full Device Tree parsing support") Assisted-by: LLM Reviewed-by: Frank Li Signed-off-by: Linus Walleij Link: https://patch.msgid.link/20260927-dma40-fixes-v7-17-89f595e8851d@kernel.org Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/ste_dma40.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index c890f720bfe37..3ec960b6a16d2 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -2505,6 +2505,9 @@ static struct dma_chan *d40_xlate(struct of_phandle_args *dma_spec, dma_cap_mask_t cap; u32 flags; + if (dma_spec->args_count != 3) + return NULL; + memset(&cfg, 0, sizeof(struct stedma40_chan_cfg)); dma_cap_zero(cap); -- 2.53.0