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: <20240320.213924.690460440850932744.syoshida@redhat.com>
Date: Wed, 20 Mar 2024 21:39:24 +0900 (JST)
From: Shigeru Yoshida <syoshida@...hat.com>
To: chr@...ma.com
Cc: netdev@...r.kernel.org, davem@...emloft.net
Subject: Re: [PATCH] net: ll_temac: platform_get_resource replaced by wrong
 function

On Tue, 19 Mar 2024 19:45:26 +0000, Claus Hansen Ries wrote:
> From: Claus Hansen ries <chr@...ma.com>
> 
> devm_platform_ioremap_resource_byname is called using 0 as name, which eventually 
> ends up in platform_get_resource_byname, where it causes a null pointer in strcmp.
> 
>                 if (type == resource_type(r) && !strcmp(r->name, name))
> 
> The correct function is devm_platform_ioremap_resource.
> 
> Fixes: bd69058 ("net: ll_temac: Use devm_platform_ioremap_resource_byname()")
> Signed-off-by: Claus H. Ries <chr@...ma.com>
> Cc: stable@...r.kernel.org

This patch LGTM. Before the commit bd69058 ("net: ll_temac: Use
devm_platform_ioremap_resource_byname()"), temac_probe() calls
platform_get_resource() with the index 0 to get the resource. So we
have to use devm_platform_ioremap_resource() with the index 0 here.

> ---
>  drivers/net/ethernet/xilinx/ll_temac_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
> index 9df39cf8b097..1072e2210aed 100644
> --- a/drivers/net/ethernet/xilinx/ll_temac_main.c
> +++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
> @@ -1443,7 +1443,7 @@ static int temac_probe(struct platform_device *pdev)
>         }
>           /* map device registers */
> -       lp->regs = devm_platform_ioremap_resource_byname(pdev, 0);
> +       lp->regs = devm_platform_ioremap_resource(pdev, 0);
>         if (IS_ERR(lp->regs)) {
>                 dev_err(&pdev->dev, "could not map TEMAC registers\n");
>                 return -ENOMEM;

However, it seems that the patch is indented by spaces instead of tabs
(maybe your mail client replaced this?). I recommend running
checkpatch.pl before submitting patches.

Also, we should put appropriate prefix, i.e. "net" or "net-next", in
the subject. As for this patch, I think "[PATCH net]" is appropriate.

Thanks,
Shigeru

> base-commit: d95fcdf4961d27a3d17e5c7728367197adc89b8d
> --  2.39.3 (Apple Git-146)
> 
> 
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ