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
| ||
|
Message-ID: <202310081402.A9A8C49@keescook> Date: Sun, 8 Oct 2023 14:03:23 -0700 From: Kees Cook <keescook@...omium.org> To: Christophe JAILLET <christophe.jaillet@...adoo.fr> Cc: gustavoars@...nel.org, Daniel Mack <daniel@...que.org>, Haojian Zhuang <haojian.zhuang@...il.com>, Robert Jarzmik <robert.jarzmik@...e.fr>, Vinod Koul <vkoul@...nel.org>, linux-hardening@...r.kernel.org, linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org, linux-arm-kernel@...ts.infradead.org, dmaengine@...r.kernel.org Subject: Re: [PATCH 1/2] dmaengine: pxa_dma: Remove an erroneous BUG_ON() in pxad_free_desc() On Sat, Oct 07, 2023 at 01:13:09PM +0200, Christophe JAILLET wrote: > If pxad_alloc_desc() fails on the first dma_pool_alloc() call, then > sw_desc->nb_desc is zero. > In such a case pxad_free_desc() is called and it will BUG_ON(). > > Remove this erroneous BUG_ON(). Perhaps it could be changed to a WARN_ON()? > It is also useless, because if "sw_desc->nb_desc == 0", then, on the first > iteration of the for loop, i is -1 and the loop will not be executed. > (both i and sw_desc->nb_desc are 'int') Agreed. > > Fixes: a57e16cf0333 ("dmaengine: pxa: add pxa dmaengine driver") > Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr> > --- > drivers/dma/pxa_dma.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/dma/pxa_dma.c b/drivers/dma/pxa_dma.c > index 3c574dc0613b..94cef2905940 100644 > --- a/drivers/dma/pxa_dma.c > +++ b/drivers/dma/pxa_dma.c > @@ -722,7 +722,6 @@ static void pxad_free_desc(struct virt_dma_desc *vd) > dma_addr_t dma; > struct pxad_desc_sw *sw_desc = to_pxad_sw_desc(vd); > > - BUG_ON(sw_desc->nb_desc == 0); > for (i = sw_desc->nb_desc - 1; i >= 0; i--) { > if (i > 0) > dma = sw_desc->hw_desc[i - 1]->ddadr; > -- > 2.34.1 > -- Kees Cook
Powered by blists - more mailing lists