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:   Sun, 25 Jun 2017 13:05:30 +0900
From:   Masahiro Yamada <yamada.masahiro@...ionext.com>
To:     Matthias Kaehlcke <mka@...omium.org>
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        "H . Peter Anvin" <hpa@...or.com>,
        "H . J . Lu" <hjl.tools@...il.com>,
        David Woodhouse <dwmw2@...radead.org>,
        Michal Marek <mmarek@...e.com>, X86 ML <x86@...nel.org>,
        Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Michael Davidson <md@...gle.com>,
        Greg Hackmann <ghackmann@...gle.com>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Stephen Hines <srhines@...gle.com>,
        Kees Cook <keescook@...omium.org>,
        Arnd Bergmann <arnd@...db.de>,
        Bernhard Rosenkränzer 
        <Bernhard.Rosenkranzer@...aro.org>,
        Peter Foley <pefoley2@...oley.com>,
        Behan Webster <behanw@...verseincode.com>,
        Douglas Anderson <dianders@...omium.org>
Subject: Re: [PATCH v5 3/3] x86/build: Specify stack alignment for clang

2017-06-22 8:28 GMT+09:00 Matthias Kaehlcke <mka@...omium.org>:
> For gcc stack alignment is configured with -mpreferred-stack-boundary=N,
> clang has the option -mstack-alignment=N for that purpose. Use the same
> alignment as with gcc.
>
> If the alignment is not specified clang assumes an alignment of
> 16 bytes, as required by the standard ABI. However as mentioned in
> d9b0cde91c60 ("x86-64, gcc: Use -mpreferred-stack-boundary=3 if
> supported") the standard kernel entry on x86-64 leaves the stack
> on an 8-byte boundary, as a consequence clang will keep the stack
> misaligned.
>
> Signed-off-by: Matthias Kaehlcke <mka@...omium.org>
> ---
> Changes in v5:
> - Use cc-option to probe for a compiler option instead of selecting
>   it based on the compiler name.
>
>  arch/x86/Makefile | 26 +++++++++++++++++++++-----
>  1 file changed, 21 insertions(+), 5 deletions(-)
>
> diff --git a/arch/x86/Makefile b/arch/x86/Makefile
> index b2dae639f778..b32b32b422c2 100644
> --- a/arch/x86/Makefile
> +++ b/arch/x86/Makefile
> @@ -11,6 +11,14 @@ else
>          KBUILD_DEFCONFIG := $(ARCH)_defconfig
>  endif
>
> +# For gcc stack alignment is specified with -mpreferred-stack-boundary,
> +# clang has the option -mstack-alignment for that purpose.
> +ifneq ($(call cc-option, -mpreferred-stack-boundary=4,),)
> +        cc_stack_align_opt := -mpreferred-stack-boundary
> +else ifneq ($(call cc-option, -mstack-alignment=4,),)
> +        cc_stack_align_opt := -mstack-alignment
> +endif
> +

The commas after "=4" are redundant.

I removed them when I applied this patch.





-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ