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]
Date:   Fri, 22 Feb 2019 16:50:46 +0100
From:   Andrey Konovalov <andreyknvl@...gle.com>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will.deacon@....com>, natechancellor@...il.com,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Andrey Ryabinin <aryabinin@...tuozzo.com>,
        Dmitry Vyukov <dvyukov@...gle.com>,
        Linux ARM <linux-arm-kernel@...ts.infradead.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] arm64: avoid clang warning about self-assignment

On Fri, Feb 22, 2019 at 3:43 PM Arnd Bergmann <arnd@...db.de> wrote:
>
> Building a preprocessed source file for arm64 now always produces
> a warning with clang because of the page_to_virt() macro assigning
> a variable to itself.
>
> Adding a new temporary variable avoids this issue.
>
> Fixes: 2813b9c02962 ("kasan, mm, arm64: tag non slab memory allocated via pagealloc")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>

Reviewed-by: Andrey Konovalov <andreyknvl@...gle.com>

Thanks!

> ---
>  arch/arm64/include/asm/memory.h | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h
> index b01ef0180a03..290195168bb3 100644
> --- a/arch/arm64/include/asm/memory.h
> +++ b/arch/arm64/include/asm/memory.h
> @@ -312,8 +312,9 @@ static inline void *phys_to_virt(phys_addr_t x)
>  #define page_to_virt(page)     ({                                      \
>         unsigned long __addr =                                          \
>                 ((__page_to_voff(page)) | PAGE_OFFSET);                 \
> -       __addr = __tag_set(__addr, page_kasan_tag(page));               \
> -       ((void *)__addr);                                               \
> +       unsigned long __addr_tag =                                      \
> +                __tag_set(__addr, page_kasan_tag(page));               \
> +       ((void *)__addr_tag);                                           \
>  })
>
>  #define virt_to_page(vaddr)    ((struct page *)((__virt_to_pgoff(vaddr)) | VMEMMAP_START))
> --
> 2.20.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ