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] [day] [month] [year] [list]
Message-ID: <6o6t4cnfr2untfmm2yykhnh3h24vpk42hfzsejyf4krkcpbzow@ohrp56cwvvzv>
Date: Mon, 25 Aug 2025 18:46:22 +0300
From: Ioana Ciornei <ioana.ciornei@....com>
To: Salah Triki <salah.triki@...il.com>
Cc: Markus Elfring <Markus.Elfring@....de>, 
	Christophe Leroy <christophe.leroy@...roup.eu>, linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] bus: fsl-mc: Check return value of
 platform_get_resource()

On Mon, Aug 25, 2025 at 10:34:35AM +0100, Salah Triki wrote:
> platform_get_resource() returns NULL in case of failure, so check its
> return value and propagate the error in order to prevent NULL pointer
> dereference.
> 
> Fixes: 6305166c8771 ("bus: fsl-mc: Add ACPI support for fsl-mc")
> Cc: <stable@...r.kernel.org>
> Signed-off-by: Salah Triki <salah.triki@...il.com>

Acked-by: Ioana Ciornei <ioana.ciornei@....com>

> ---
> Changes in v2:
>    - Add Fixes and Cc tags, as suggested by Markus Elfring and Christophe
>      Leroy.
>    - Remove blank line before the if statement, as suggested by Markus
>      Elfring.
>    - Replace ENODEV with EINVAL, as suggestd by Christophe Leroy.
> 
>  drivers/bus/fsl-mc/fsl-mc-bus.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c
> index 7671bd158545..cd83cd564736 100644
> --- a/drivers/bus/fsl-mc/fsl-mc-bus.c
> +++ b/drivers/bus/fsl-mc/fsl-mc-bus.c
> @@ -1105,6 +1105,9 @@ static int fsl_mc_bus_probe(struct platform_device *pdev)
>  	 * Get physical address of MC portal for the root DPRC:
>  	 */
>  	plat_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	if (!plat_res)
> +		return -EINVAL;
> +
>  	mc_portal_phys_addr = plat_res->start;
>  	mc_portal_size = resource_size(plat_res);
>  	mc_portal_base_phys_addr = mc_portal_phys_addr & ~0x3ffffff;
> -- 
> 2.43.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ