Re: [PATCH] x86: Fix location of '-plugin-opt=' flags

From: Kees Cook
Date: Fri May 21 2021 - 17:04:12 EST


On Fri, May 21, 2021 at 11:31:54AM -0700, Nathan Chancellor wrote:
> On Fri, May 21, 2021 at 10:59:10AM -0700, Kees Cook wrote:
> > On Tue, 18 May 2021 12:01:06 -0700, Nathan Chancellor wrote:
> > > Commit b33fff07e3e3 ("x86, build: allow LTO to be selected") added a
> > > couple of '-plugin-opt=' flags to KBUILD_LDFLAGS because the code model
> > > and stack alignment are not stored in LLVM bitcode. However, these flags
> > > were added to KBUILD_LDFLAGS prior to the emulation flag assignment,
> > > which uses ':=', so they were overwritten and never added to $(LD)
> > > invocations. The absence of these flags caused misalignment issues in
> > > the AMDGPU driver when compiling with CONFIG_LTO_CLANG, resulting in
> > > general protection faults.
> > >
> > > [...]
> >
> > (I've slightly adjusted the title.)
> >
> > Applied to for-next/clang/features, thanks!
> >
> > [1/1] x86: lto: Fix location of '-plugin-opt=' flags
> > https://git.kernel.org/kees/c/5d6c8592ee5f
> >
>
> Ingo picked this up in x86/urgent so you should not need to carry it.
>
> https://git.kernel.org/tip/0024430e920f2900654ad83cd081cf52e02a3ef5

Ah-ha, thanks! I didn't see a reply on the thread.

--
Kees Cook