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: <YpS0C8tVG2E5jGSV@MiWiFi-R3L-srv>
Date:   Mon, 30 May 2022 20:09:47 +0800
From:   Baoquan He <bhe@...hat.com>
To:     ysato@...rs.sourceforge.jp, dalias@...c.org
Cc:     linux-sh@...r.kernel.org, linux-kernel@...r.kernel.org,
        kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] sh: cast away __iomem to remove sparse warning

Hi,

On 05/07/22 at 09:34am, Baoquan He wrote:
> LKP reported a sparse warning in arch/sh/kernel/crash_dump.c during
> a kdump patchset reviewing:
> https://lore.kernel.org/all/202204082128.JKXXDGpa-lkp@intel.com/T/#u
> 
> ../arch/sh/kernel/crash_dump.c:23:36: sparse: warning: incorrect type in argument 1 (different address spaces)
> ../arch/sh/kernel/crash_dump.c:23:36: sparse:    expected void const *addr
> ../arch/sh/kernel/crash_dump.c:23:36: sparse:    got void [noderef] __iomem *
> 
> This warning happened when __iomem pointer is passed into fucntion
> which doesn't expect it. Casting away the __iomem can fix it.

This warning was reported by lkp during one patchset posted and
reviewing. Since it's not related to the patchset, I just sent it
separately so that later code change on arch/sh/kernel/crash_dump.c
won't trigger the lkp warning again.

[PATCH v5 RESEND 0/3] Convert vmcore to use an iov_iter
https://lore.kernel.org/all/20220408090636.560886-2-bhe@redhat.com/T/#u

Now the above patchset has been merged into linus's tree, please
consider taking this patch.

Thanks
Baoquan

> 
> Reported-by: kernel test robot <lkp@...el.com>
> Signed-off-by: Baoquan He <bhe@...hat.com>
> ---
>  arch/sh/kernel/crash_dump.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/sh/kernel/crash_dump.c b/arch/sh/kernel/crash_dump.c
> index 19ce6a950aac..52d1d54eb6b1 100644
> --- a/arch/sh/kernel/crash_dump.c
> +++ b/arch/sh/kernel/crash_dump.c
> @@ -20,7 +20,7 @@ ssize_t copy_oldmem_page(struct iov_iter *iter, unsigned long pfn,
>  		return 0;
>  
>  	vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE);
> -	csize = copy_to_iter(vaddr + offset, csize, iter);
> +	csize = copy_to_iter((const void __force *)vaddr + offset, csize, iter);
>  	iounmap(vaddr);
>  
>  	return csize;
> -- 
> 2.34.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ