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: <20211116184737.GA2324186@p14s>
Date:   Tue, 16 Nov 2021 11:47:37 -0700
From:   Mathieu Poirier <mathieu.poirier@...aro.org>
To:     "Peng Fan (OSS)" <peng.fan@....nxp.com>
Cc:     ohad@...ery.com, bjorn.andersson@...aro.org,
        o.rempel@...gutronix.de, shawnguo@...nel.org,
        s.hauer@...gutronix.de, kernel@...gutronix.de, festevam@...il.com,
        linux-imx@....com, linux-remoteproc@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Peng Fan <peng.fan@....com>, kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] remoteproc: coredump: correct argument 2 type for
 memcpy_fromio

Hi Peng,

On Wed, Nov 10, 2021 at 11:21:01AM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@....com>
> 
> Address the sparse check warning:
> >> drivers/remoteproc/remoteproc_coredump.c:169:53:
> sparse: warning: incorrect type in argument 2 (different address spaces)
> sparse:    expected void const volatile [noderef] __iomem *src
> sparse:    got void *[assigned] ptr
> 
> Reported-by: kernel test robot <lkp@...el.com>
> Signed-off-by: Peng Fan <peng.fan@....com>
> ---
>  drivers/remoteproc/remoteproc_coredump.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/remoteproc/remoteproc_coredump.c b/drivers/remoteproc/remoteproc_coredump.c
> index aee657cc08c6..f39c98aa1b49 100644
> --- a/drivers/remoteproc/remoteproc_coredump.c
> +++ b/drivers/remoteproc/remoteproc_coredump.c
> @@ -166,7 +166,7 @@ static void rproc_copy_segment(struct rproc *rproc, void *dest,
>  			memset(dest, 0xff, size);
>  		} else {
>  			if (is_iomem)
> -				memcpy_fromio(dest, ptr, size);
> +				memcpy_fromio(dest, (void const __iomem *)ptr, size);

Shouldn't this be (const void __iomem *) to respect the signature in [1]?

[1]. https://elixir.bootlin.com/linux/latest/source/include/asm-generic/logic_io.h#L71

>  			else
>  				memcpy(dest, ptr, size);
>  		}
> -- 
> 2.25.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ