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]
Date:   Thu, 18 Nov 2021 14:08:04 -0800
From:   Nick Desaulniers <ndesaulniers@...gle.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     x86@...nel.org, linux-kernel@...r.kernel.org,
        "H.J. Lu" <hjl.tools@...il.com>, llvm@...ts.linux.dev,
        linux-toolchains@...r.kernel.org,
        Masahiro Yamada <masahiroy@...nel.org>
Subject: Re: [PATCH] x86: Use -mindirect-branch-cs-prefix for RETPOLINE builds

On Thu, Nov 18, 2021 at 10:54 AM Peter Zijlstra <peterz@...radead.org> wrote:
>
>
> In order to further enable commit:
>
>   bbe2df3f6b6d ("x86/alternative: Try inline spectre_v2=retpoline,amd")
>
> add the new GCC flag -mindirect-branch-cs-prefix:
>
>   https://gcc.gnu.org/g:2196a681d7810ad8b227bf983f38ba716620545e
>
> to RETPOLINE=y builds. This should allow fully inlining retpoline,amd
> for GCC builds.

Do you mind adding the following link tags:

Link: https://gcc.gnu.org/g:2196a681d7810ad8b227bf983f38ba716620545e
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102952
Link: https://bugs.llvm.org/show_bug.cgi?id=52323

If the feature would be helpful to implement in Clang, would you mind
keeping the cc-option, but moving the check outside of the `ifdef
CONFIG_CC_IS_GCC` block? That way, we don't need to revisit the
Makefile?

(Tangential: I wonder why RETPOLINE_CFLAGS aren't defined in
arch/x86/Makefile; they seem to be x86 specific at the moment).

With the above link tags, and with or without moving this outside the
gcc-specific guard:
Acked-by: Nick Desaulniers <ndesaulniers@...gle.com>

>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> ---
>  Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/Makefile b/Makefile
> index 9e12c14ea0fb..5fd5b5f091ae 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -690,6 +690,7 @@ endif
>
>  ifdef CONFIG_CC_IS_GCC
>  RETPOLINE_CFLAGS       := $(call cc-option,-mindirect-branch=thunk-extern -mindirect-branch-register)
> +RETPOLINE_CFLAGS       += $(call cc-option,-mindirect-branch-cs-prefix)
>  RETPOLINE_VDSO_CFLAGS  := $(call cc-option,-mindirect-branch=thunk-inline -mindirect-branch-register)
>  endif
>  ifdef CONFIG_CC_IS_CLANG



-- 
Thanks,
~Nick Desaulniers

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ