[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKwvOdm1dy7RiSfP1Ra1ek08OQ=8o8FDnrMdW44e6ZssgPbCAw@mail.gmail.com>
Date: Tue, 14 Sep 2021 12:46:08 -0700
From: Nick Desaulniers <ndesaulniers@...gle.com>
To: Sami Tolvanen <samitolvanen@...gle.com>
Cc: x86@...nel.org, Kees Cook <keescook@...omium.org>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Nathan Chancellor <nathan@...nel.org>,
Sedat Dilek <sedat.dilek@...il.com>,
linux-hardening@...r.kernel.org, linux-kernel@...r.kernel.org,
clang-built-linux@...glegroups.com
Subject: Re: [PATCH v3 14/16] x86, cpu: Use LTO for cpu.c with CFI
On Tue, Sep 14, 2021 at 12:11 PM Sami Tolvanen <samitolvanen@...gle.com> wrote:
>
> Allow LTO to be used for cpu.c when CONFIG_CFI_CLANG is enabled to avoid
> indirect call failures. CFI requires Clang >= 13, which doesn't have the
> stack protector inlining bug.
True, that was fixed in clang-12. I hope to one day use
__attribute__((no_stack_protector)) to clean up this chem spill.
Reviewed-by: Nick Desaulniers <ndesaulniers@...gle.com>
Technically, GCC still has this bug.
>
> Signed-off-by: Sami Tolvanen <samitolvanen@...gle.com>
> ---
> arch/x86/power/Makefile | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/x86/power/Makefile b/arch/x86/power/Makefile
> index 379777572bc9..a0532851fed7 100644
> --- a/arch/x86/power/Makefile
> +++ b/arch/x86/power/Makefile
> @@ -4,9 +4,11 @@
> # itself be stack-protected
> CFLAGS_cpu.o := -fno-stack-protector
>
> +ifndef CONFIG_CFI_CLANG
> # Clang may incorrectly inline functions with stack protector enabled into
> # __restore_processor_state(): https://bugs.llvm.org/show_bug.cgi?id=47479
> CFLAGS_REMOVE_cpu.o := $(CC_FLAGS_LTO)
> +endif
>
> obj-$(CONFIG_PM_SLEEP) += cpu.o
> obj-$(CONFIG_HIBERNATION) += hibernate_$(BITS).o hibernate_asm_$(BITS).o hibernate.o
> --
> 2.33.0.309.g3052b89438-goog
>
--
Thanks,
~Nick Desaulniers
Powered by blists - more mailing lists