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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZBSj/0kIGVROIGi7@matsya>
Date:   Fri, 17 Mar 2023 23:01:43 +0530
From:   Vinod Koul <vkoul@...nel.org>
To:     Péter Ujfalusi <peter.ujfalusi@...il.com>
Cc:     Kang Chen <void0red@...il.com>, dmaengine@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] dmaengine: ti: add null check of devm_kasprintf in
 edma_probe and udma_probe

On 14-03-23, 22:01, Péter Ujfalusi wrote:
> Hi,
> 
> On 26/02/2023 11:40, Kang Chen wrote:
> > devm_kasprintf may fails, irq_name and uc->name might be null and wrong irq
> > name will be used in request.
> 
> In general, I would have preferred to have separate patches for the two
> drivers to make them easier to backport if one decides.

Right these should be separate

> 
> If you decide to resend, you can add my to them:
> 
> Acked-by: Peter Ujfalusi <peter.ujfalusi@...il.com>
> 
> > 
> > Signed-off-by: Kang Chen <void0red@...il.com>
> > ---
> >   drivers/dma/ti/edma.c    | 8 ++++++++
> >   drivers/dma/ti/k3-udma.c | 2 ++
> >   2 files changed, 10 insertions(+)
> > 
> > diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c
> > index fa06d7e6d..85cd72b64 100644
> > --- a/drivers/dma/ti/edma.c
> > +++ b/drivers/dma/ti/edma.c
> > @@ -2413,6 +2413,10 @@ static int edma_probe(struct platform_device *pdev)
> >   	if (irq >= 0) {
> >   		irq_name = devm_kasprintf(dev, GFP_KERNEL, "%s_ccint",
> >   					  dev_name(dev));
> > +		if (!irq_name) {
> > +			ret = -ENOMEM;
> > +			goto err_disable_pm;
> > +		}
> >   		ret = devm_request_irq(dev, irq, dma_irq_handler, 0, irq_name,
> >   				       ecc);
> >   		if (ret) {
> > @@ -2429,6 +2433,10 @@ static int edma_probe(struct platform_device *pdev)
> >   	if (irq >= 0) {
> >   		irq_name = devm_kasprintf(dev, GFP_KERNEL, "%s_ccerrint",
> >   					  dev_name(dev));
> > +		if (!irq_name) {
> > +			ret = -ENOMEM;
> > +			goto err_disable_pm;
> > +		}
> >   		ret = devm_request_irq(dev, irq, dma_ccerr_handler, 0, irq_name,
> >   				       ecc);
> >   		if (ret) {
> > diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
> > index 7e23a6fde..692d1d25c 100644
> > --- a/drivers/dma/ti/k3-udma.c
> > +++ b/drivers/dma/ti/k3-udma.c
> > @@ -5494,6 +5494,8 @@ static int udma_probe(struct platform_device *pdev)
> >   		uc->config.dir = DMA_MEM_TO_MEM;
> >   		uc->name = devm_kasprintf(dev, GFP_KERNEL, "%s chan%d",
> >   					  dev_name(dev), i);
> > +		if (!uc->name)
> > +			return -ENOMEM;
> >   		vchan_init(&uc->vc, &ud->ddev);
> >   		/* Use custom vchan completion handling */
> 
> -- 
> Péter

-- 
~Vinod

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ