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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b54bbe95-7136-4ea7-a6e6-8bf0e1d12a7b@cs-soprasteria.com>
Date: Fri, 20 Jun 2025 07:57:23 +0000
From: LEROY Christophe <christophe.leroy2@...soprasteria.com>
To: Thomas Fourier <fourier.thomas@...il.com>
CC: Madhavan Srinivasan <maddy@...ux.ibm.com>, Michael Ellerman
	<mpe@...erman.id.au>, Nicholas Piggin <npiggin@...il.com>,
	"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] powerpc: floppy: Add missing checks after DMA map



Le 20/06/2025 à 09:55, Thomas Fourier a écrit :
> [Vous ne recevez pas souvent de courriers de fourier.thomas@...il.com. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ]
> 
> The DMA map functions can fail and should be tested for errors.
> 
> Signed-off-by: Thomas Fourier <fourier.thomas@...il.com>

Reviewed-by: Christophe Leroy <christophe.leroy@...roup.eu>

> ---
>   arch/powerpc/include/asm/floppy.h | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/include/asm/floppy.h b/arch/powerpc/include/asm/floppy.h
> index f8ce178b43b7..34abf8bea2cc 100644
> --- a/arch/powerpc/include/asm/floppy.h
> +++ b/arch/powerpc/include/asm/floppy.h
> @@ -144,9 +144,12 @@ static int hard_dma_setup(char *addr, unsigned long size, int mode, int io)
>                  bus_addr = 0;
>          }
> 
> -       if (!bus_addr)  /* need to map it */
> +       if (!bus_addr) {        /* need to map it */
>                  bus_addr = dma_map_single(&isa_bridge_pcidev->dev, addr, size,
>                                            dir);
> +               if (dma_mapping_error(&isa_bridge_pcidev->dev, bus_addr))
> +                       return -ENOMEM;
> +       }
> 
>          /* remember this one as prev */
>          prev_addr = addr;
> --
> 2.43.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ