lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 21 Sep 2016 22:16:55 +0200
From:   Vincent Stehlé <vincent.stehle@...oste.net>
To:     dmaengine@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org,
        Vincent Stehlé <vincent.stehle@...oste.net>,
        Zhangfei Gao <zhangfei.gao@...aro.org>,
        Vinod Koul <vinod.koul@...el.com>, stable@...r.kernel.org
Subject: [PATCH] dmaengine: k3dma: fix off by one

In k3_of_dma_simple_xlate(), the d->chans[] array has d->dma_requests
elements so > should be >=.

Fixes: 8e6152bc660e69f5 ("dmaengine: Add hisilicon k3 DMA engine driver")
Signed-off-by: Vincent Stehlé <vincent.stehle@...oste.net>
Cc: Zhangfei Gao <zhangfei.gao@...aro.org>
Cc: Vinod Koul <vinod.koul@...el.com>
Cc: stable@...r.kernel.org
---
 drivers/dma/k3dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c
index aabcb79..cd7f67b 100644
--- a/drivers/dma/k3dma.c
+++ b/drivers/dma/k3dma.c
@@ -792,7 +792,7 @@ static struct dma_chan *k3_of_dma_simple_xlate(struct of_phandle_args *dma_spec,
 	struct k3_dma_dev *d = ofdma->of_dma_data;
 	unsigned int request = dma_spec->args[0];
 
-	if (request > d->dma_requests)
+	if (request >= d->dma_requests)
 		return NULL;
 
 	return dma_get_slave_channel(&(d->chans[request].vc.chan));
-- 
2.9.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ