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: <163636595480.15222.10658604372252056385.b4-ty@kernel.org>
Date:   Mon,  8 Nov 2021 10:37:49 +0000
From:   Will Deacon <will@...nel.org>
To:     Arnd Bergmann <arnd@...nel.org>,
        Suzuki K Poulose <suzuki.poulose@....com>,
        Marc Zyngier <maz@...nel.org>,
        Kristina Martsenko <kristina.martsenko@....com>,
        Bob Picco <bob.picco@...cle.com>,
        Catalin Marinas <catalin.marinas@....com>
Cc:     kernel-team@...roid.com, Will Deacon <will@...nel.org>,
        Vladimir Murzin <vladimir.murzin@....com>,
        Mark Rutland <mark.rutland@....com>,
        "Aneesh Kumar K.V" <aneesh.kumar@...ux.ibm.com>,
        Arnd Bergmann <arnd@...db.de>,
        Matthew Wilcox <willy@...radead.org>,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        Steven Price <steven.price@....com>,
        Ard Biesheuvel <ardb@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Anshuman Khandual <anshuman.khandual@....com>
Subject: Re: [PATCH] arm64: pgtable: make __pte_to_phys/__phys_to_pte_val inline functions

On Fri, 5 Nov 2021 08:54:03 +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
> 
> gcc warns about undefined behavior the vmalloc code when building
> with CONFIG_ARM64_PA_BITS_52, when the 'idx++' in the argument to
> __phys_to_pte_val() is evaluated twice:
> 
> mm/vmalloc.c: In function 'vmap_pfn_apply':
> mm/vmalloc.c:2800:58: error: operation on 'data->idx' may be undefined [-Werror=sequence-point]
>  2800 |         *pte = pte_mkspecial(pfn_pte(data->pfns[data->idx++], data->prot));
>       |                                                 ~~~~~~~~~^~
> arch/arm64/include/asm/pgtable-types.h:25:37: note: in definition of macro '__pte'
>    25 | #define __pte(x)        ((pte_t) { (x) } )
>       |                                     ^
> arch/arm64/include/asm/pgtable.h:80:15: note: in expansion of macro '__phys_to_pte_val'
>    80 |         __pte(__phys_to_pte_val((phys_addr_t)(pfn) << PAGE_SHIFT) | pgprot_val(prot))
>       |               ^~~~~~~~~~~~~~~~~
> mm/vmalloc.c:2800:30: note: in expansion of macro 'pfn_pte'
>  2800 |         *pte = pte_mkspecial(pfn_pte(data->pfns[data->idx++], data->prot));
>       |                              ^~~~~~~
> 
> [...]

Applied to arm64 (for-next/core), thanks!

[1/1] arm64: pgtable: make __pte_to_phys/__phys_to_pte_val inline functions
      https://git.kernel.org/arm64/c/c7c386fbc202

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ