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: <CACRpkdb3DMvof3-xdtss0Pc6KM36pJA-iy=WhvtNVnsDpeJ24Q@mail.gmail.com>
Date:   Sat, 24 Jul 2021 00:51:32 +0200
From:   Linus Walleij <linus.walleij@...aro.org>
To:     Arnd Bergmann <arnd@...nel.org>
Cc:     Andrey Ryabinin <ryabinin.a.a@...il.com>,
        Russell King <linux@...linux.org.uk>,
        Ard Biesheuvel <ardb@...nel.org>,
        Mike Rapoport <rppt@...nel.org>,
        Abbott Liu <liuwenliang@...wei.com>,
        Arnd Bergmann <arnd@...db.de>,
        Alexander Potapenko <glider@...gle.com>,
        Andrey Konovalov <andreyknvl@...il.com>,
        Dmitry Vyukov <dvyukov@...gle.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        kasan-dev <kasan-dev@...glegroups.com>,
        Linux ARM <linux-arm-kernel@...ts.infradead.org>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ARM: kasan: work around LPAE build warning

On Wed, Jul 21, 2021 at 5:17 PM Arnd Bergmann <arnd@...nel.org> wrote:

> From: Arnd Bergmann <arnd@...db.de>
>
> pgd_page_vaddr() returns an 'unsigned long' address, causing a warning
> with the memcpy() call in kasan_init():
>
> arch/arm/mm/kasan_init.c: In function 'kasan_init':
> include/asm-generic/pgtable-nop4d.h:44:50: error: passing argument 2 of '__memcpy' makes pointer from integer without a cast [-Werror=int-conversion]
>    44 | #define pgd_page_vaddr(pgd)                     ((unsigned long)(p4d_pgtable((p4d_t){ pgd })))
>       |                                                 ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>       |                                                  |
>       |                                                  long unsigned int
> arch/arm/include/asm/string.h:58:45: note: in definition of macro 'memcpy'
>    58 | #define memcpy(dst, src, len) __memcpy(dst, src, len)
>       |                                             ^~~
> arch/arm/mm/kasan_init.c:229:16: note: in expansion of macro 'pgd_page_vaddr'
>   229 |                pgd_page_vaddr(*pgd_offset_k(KASAN_SHADOW_START)),
>       |                ^~~~~~~~~~~~~~
> arch/arm/include/asm/string.h:21:47: note: expected 'const void *' but argument is of type 'long unsigned int'
>    21 | extern void *__memcpy(void *dest, const void *src, __kernel_size_t n);
>       |                                   ~~~~~~~~~~~~^~~
>
> Avoid this by adding an explicit typecast.
>
> Fixes: 5615f69bc209 ("ARM: 9016/2: Initialize the mapping of KASan shadow memory")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>

I can't think of anything better.
Reviewed-by: Linus Walleij <linus.walleij@...aro.org>

Will you add this patch to Russell's patch tracker?

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ