* linux-next: build failure after merge of the kspp tree @ 2018-07-27 9:02 Stephen Rothwell 2018-07-27 9:06 ` Stephen Rothwell 0 siblings, 1 reply; 15+ messages in thread From: Stephen Rothwell @ 2018-07-27 9:02 UTC (permalink / raw) To: Kees Cook Cc: Linux-Next Mailing List, Linux Kernel Mailing List, Alexander Popov [-- Attachment #1: Type: text/plain, Size: 437 bytes --] Hi Kees, After merging the kspp tree, today's linux-next build (x86_64 allmodconfig) failed like this: cc1: error: plugin stackleak_plugin should be specified before -fplugin-arg-stackleak_plugin-disable in the command line Maybe caused by commit a8b9eaddb9c0 ("gcc-plugins: Add STACKLEAK plugin for tracking the kernel stack") I have used the kspp tree from next-20180726 for today. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: linux-next: build failure after merge of the kspp tree 2018-07-27 9:02 linux-next: build failure after merge of the kspp tree Stephen Rothwell @ 2018-07-27 9:06 ` Stephen Rothwell 2018-07-27 10:55 ` Stephen Rothwell 0 siblings, 1 reply; 15+ messages in thread From: Stephen Rothwell @ 2018-07-27 9:06 UTC (permalink / raw) To: Kees Cook Cc: Linux-Next Mailing List, Linux Kernel Mailing List, Alexander Popov [-- Attachment #1: Type: text/plain, Size: 725 bytes --] Hi all, On Fri, 27 Jul 2018 19:02:07 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > After merging the kspp tree, today's linux-next build (x86_64 > allmodconfig) failed like this: > > cc1: error: plugin stackleak_plugin should be specified before -fplugin-arg-stackleak_plugin-disable in the command line > > Maybe caused by commit > > a8b9eaddb9c0 ("gcc-plugins: Add STACKLEAK plugin for tracking the kernel stack") > > I have used the kspp tree from next-20180726 for today. Well, that obviously didn't work since the tree hasn't changed for a few days. I can't see what has interacted to make this happen, so I have dropped the kspp tree for today. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: linux-next: build failure after merge of the kspp tree 2018-07-27 9:06 ` Stephen Rothwell @ 2018-07-27 10:55 ` Stephen Rothwell 2018-07-27 12:55 ` Will Deacon 0 siblings, 1 reply; 15+ messages in thread From: Stephen Rothwell @ 2018-07-27 10:55 UTC (permalink / raw) To: Kees Cook Cc: Linux-Next Mailing List, Linux Kernel Mailing List, Alexander Popov, Catalin Marinas, Will Deacon, Laura Abbott [-- Attachment #1: Type: text/plain, Size: 984 bytes --] Hi all, On Fri, 27 Jul 2018 19:06:47 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > On Fri, 27 Jul 2018 19:02:07 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > > > After merging the kspp tree, today's linux-next build (x86_64 > > allmodconfig) failed like this: > > > > cc1: error: plugin stackleak_plugin should be specified before -fplugin-arg-stackleak_plugin-disable in the command line > > > > Maybe caused by commit > > > > a8b9eaddb9c0 ("gcc-plugins: Add STACKLEAK plugin for tracking the kernel stack") > > > > I have used the kspp tree from next-20180726 for today. > > Well, that obviously didn't work since the tree hasn't changed for a > few days. > > I can't see what has interacted to make this happen, so I have dropped > the kspp tree for today. Actually, it may have been caused by commit 0b3e336601b8 ("arm64: Add support for STACKLEAK gcc plugin") from the arm64 tree. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: linux-next: build failure after merge of the kspp tree 2018-07-27 10:55 ` Stephen Rothwell @ 2018-07-27 12:55 ` Will Deacon 2018-07-27 13:01 ` Will Deacon 2018-07-30 7:33 ` Stephen Rothwell 0 siblings, 2 replies; 15+ messages in thread From: Will Deacon @ 2018-07-27 12:55 UTC (permalink / raw) To: Stephen Rothwell Cc: Kees Cook, Linux-Next Mailing List, Linux Kernel Mailing List, Alexander Popov, Catalin Marinas, Laura Abbott On Fri, Jul 27, 2018 at 08:55:11PM +1000, Stephen Rothwell wrote: > On Fri, 27 Jul 2018 19:06:47 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > > > On Fri, 27 Jul 2018 19:02:07 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > > > > > After merging the kspp tree, today's linux-next build (x86_64 > > > allmodconfig) failed like this: > > > > > > cc1: error: plugin stackleak_plugin should be specified before -fplugin-arg-stackleak_plugin-disable in the command line > > > > > > Maybe caused by commit > > > > > > a8b9eaddb9c0 ("gcc-plugins: Add STACKLEAK plugin for tracking the kernel stack") > > > > > > I have used the kspp tree from next-20180726 for today. > > > > Well, that obviously didn't work since the tree hasn't changed for a > > few days. > > > > I can't see what has interacted to make this happen, so I have dropped > > the kspp tree for today. > > Actually, it may have been caused by commit > > 0b3e336601b8 ("arm64: Add support for STACKLEAK gcc plugin") > > from the arm64 tree. Thanks, Stephen. I managed to reproduce this by merging for-next/kspp from Kees's tree and for-next/core from the arm64 tree. The failure happens when building the EFI stub, so the commit you mention above is almost certainly the culprit. We build the stub with the following GCC invocation: gcc -Wp,-MD,drivers/firmware/efi/libstub/.efi-stub-helper.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.9/include -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -mcmodel=small -m64 -D__KERNEL__ -O2 -fPIC -fno-strict-aliasing -mno-red-zone -mno-mmx -mno-sse -fshort-wchar -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY -ffreestanding -fno-stack-protector -fplugin-arg-stackleak_plugin-disable -fno-builtin -DKBUILD_BASENAME='"efi_stub_helper"' -DKBUILD_MODNAME='"efi_stub_helper"' -c -o drivers/firmware/efi/libstub/.tmp_efi-stub-helper.o drivers/firmware/efi/libstub/efi-st ub-helper.c so given that we're not passing any -fplugin= option anyway (because we override KBUILD_CFLAGS for the stub), I don't understand why we need to the disable option at all. Laura? Will ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: linux-next: build failure after merge of the kspp tree 2018-07-27 12:55 ` Will Deacon @ 2018-07-27 13:01 ` Will Deacon 2018-07-27 13:27 ` Will Deacon 2018-07-30 7:33 ` Stephen Rothwell 1 sibling, 1 reply; 15+ messages in thread From: Will Deacon @ 2018-07-27 13:01 UTC (permalink / raw) To: Stephen Rothwell Cc: Kees Cook, Linux-Next Mailing List, Linux Kernel Mailing List, Alexander Popov, Catalin Marinas, Laura Abbott On Fri, Jul 27, 2018 at 01:55:22PM +0100, Will Deacon wrote: > On Fri, Jul 27, 2018 at 08:55:11PM +1000, Stephen Rothwell wrote: > > On Fri, 27 Jul 2018 19:06:47 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > > > > > On Fri, 27 Jul 2018 19:02:07 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > > > > > > > After merging the kspp tree, today's linux-next build (x86_64 > > > > allmodconfig) failed like this: > > > > > > > > cc1: error: plugin stackleak_plugin should be specified before -fplugin-arg-stackleak_plugin-disable in the command line > > > > > > > > Maybe caused by commit > > > > > > > > a8b9eaddb9c0 ("gcc-plugins: Add STACKLEAK plugin for tracking the kernel stack") > > > > > > > > I have used the kspp tree from next-20180726 for today. > > > > > > Well, that obviously didn't work since the tree hasn't changed for a > > > few days. > > > > > > I can't see what has interacted to make this happen, so I have dropped > > > the kspp tree for today. > > > > Actually, it may have been caused by commit > > > > 0b3e336601b8 ("arm64: Add support for STACKLEAK gcc plugin") > > > > from the arm64 tree. > > Thanks, Stephen. I managed to reproduce this by merging for-next/kspp from > Kees's tree and for-next/core from the arm64 tree. The failure happens when > building the EFI stub, so the commit you mention above is almost certainly > the culprit. > > We build the stub with the following GCC invocation: > > gcc -Wp,-MD,drivers/firmware/efi/libstub/.efi-stub-helper.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.9/include -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -mcmodel=small -m64 -D__KERNEL__ -O2 -fPIC -fno-strict-aliasing -mno-red-zone -mno-mmx -mno-sse -fshort-wchar -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY -ffreestanding -fno-stack-protector -fplugin-arg-stackleak_plugin-disable -fno-builtin -DKBUILD_BASENAME='"efi_stub_helper"' -DKBUILD_MODNAME='"efi_stub_helper"' -c -o drivers/firmware/efi/libstub/.tmp_efi-stub-helper.o drivers/firmware/efi/libstub/efi- stub-helper.c > > so given that we're not passing any -fplugin= option anyway (because we > override KBUILD_CFLAGS for the stub), I don't understand why we need > to the disable option at all. > > Laura? ... ah, but arm and arm64 inherit the old KBUILD_CFLAGS via the cflags-$(CONFIG_ARM64) and cflags-$(CONFIG_ARM) definitions, so they would be the places where we need to disable the plugin. Will ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: linux-next: build failure after merge of the kspp tree 2018-07-27 13:01 ` Will Deacon @ 2018-07-27 13:27 ` Will Deacon 2018-07-27 16:00 ` Kees Cook 0 siblings, 1 reply; 15+ messages in thread From: Will Deacon @ 2018-07-27 13:27 UTC (permalink / raw) To: Stephen Rothwell Cc: Kees Cook, Linux-Next Mailing List, Linux Kernel Mailing List, Alexander Popov, Catalin Marinas, Laura Abbott On Fri, Jul 27, 2018 at 02:01:06PM +0100, Will Deacon wrote: > On Fri, Jul 27, 2018 at 01:55:22PM +0100, Will Deacon wrote: > > On Fri, Jul 27, 2018 at 08:55:11PM +1000, Stephen Rothwell wrote: > > > On Fri, 27 Jul 2018 19:06:47 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > > > > > > > On Fri, 27 Jul 2018 19:02:07 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > > > > > > > > > After merging the kspp tree, today's linux-next build (x86_64 > > > > > allmodconfig) failed like this: > > > > > > > > > > cc1: error: plugin stackleak_plugin should be specified before -fplugin-arg-stackleak_plugin-disable in the command line > > > > > > > > > > Maybe caused by commit > > > > > > > > > > a8b9eaddb9c0 ("gcc-plugins: Add STACKLEAK plugin for tracking the kernel stack") > > > > > > > > > > I have used the kspp tree from next-20180726 for today. > > > > > > > > Well, that obviously didn't work since the tree hasn't changed for a > > > > few days. > > > > > > > > I can't see what has interacted to make this happen, so I have dropped > > > > the kspp tree for today. > > > > > > Actually, it may have been caused by commit > > > > > > 0b3e336601b8 ("arm64: Add support for STACKLEAK gcc plugin") > > > > > > from the arm64 tree. > > > > Thanks, Stephen. I managed to reproduce this by merging for-next/kspp from > > Kees's tree and for-next/core from the arm64 tree. The failure happens when > > building the EFI stub, so the commit you mention above is almost certainly > > the culprit. > > > > We build the stub with the following GCC invocation: > > > > gcc -Wp,-MD,drivers/firmware/efi/libstub/.efi-stub-helper.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.9/include -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -mcmodel=small -m64 -D__KERNEL__ -O2 -fPIC -fno-strict-aliasing -mno-red-zone -mno-mmx -mno-sse -fshort-wchar -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY -ffreestanding -fno-stack-protector -fplugin-arg-stackleak_plugin-disable -fno-builtin -DKBUILD_BASENAME='"efi_stub_helper"' -DKBUILD_MODNAME='"efi_stub_helper"' -c -o drivers/firmware/efi/libstub/.tmp_efi-stub-helper.o drivers/firmware/efi/libstub/ef i-stub-helper.c > > > > so given that we're not passing any -fplugin= option anyway (because we > > override KBUILD_CFLAGS for the stub), I don't understand why we need > > to the disable option at all. > > > > Laura? > > ... ah, but arm and arm64 inherit the old KBUILD_CFLAGS via the > cflags-$(CONFIG_ARM64) and cflags-$(CONFIG_ARM) definitions, so they > would be the places where we need to disable the plugin. i.e. something like the diff below. Will --->8 diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile index 25dd2a14560d..f3700fe08908 100644 --- a/drivers/firmware/efi/libstub/Makefile +++ b/drivers/firmware/efi/libstub/Makefile @@ -11,9 +11,11 @@ cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ -O2 \ -fPIC -fno-strict-aliasing -mno-red-zone \ -mno-mmx -mno-sse -fshort-wchar -cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS)) -fpie +cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS)) -fpie \ + $(DISABLE_STACKLEAK_PLUGIN) cflags-$(CONFIG_ARM) := $(subst -pg,,$(KBUILD_CFLAGS)) \ - -fno-builtin -fpic -mno-single-pic-base + -fno-builtin -fpic -mno-single-pic-base \ + $(DISABLE_STACKLEAK_PLUGIN) cflags-$(CONFIG_EFI_ARMSTUB) += -I$(srctree)/scripts/dtc/libfdt @@ -21,7 +23,6 @@ KBUILD_CFLAGS := $(cflags-y) -DDISABLE_BRANCH_PROFILING \ -D__NO_FORTIFY \ $(call cc-option,-ffreestanding) \ $(call cc-option,-fno-stack-protector) \ - $(DISABLE_STACKLEAK_PLUGIN) GCOV_PROFILE := n KASAN_SANITIZE := n ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: linux-next: build failure after merge of the kspp tree 2018-07-27 13:27 ` Will Deacon @ 2018-07-27 16:00 ` Kees Cook 0 siblings, 0 replies; 15+ messages in thread From: Kees Cook @ 2018-07-27 16:00 UTC (permalink / raw) To: Will Deacon Cc: Stephen Rothwell, Linux-Next Mailing List, Linux Kernel Mailing List, Alexander Popov, Catalin Marinas, Laura Abbott On Fri, Jul 27, 2018 at 6:27 AM, Will Deacon <will.deacon@arm.com> wrote: > On Fri, Jul 27, 2018 at 02:01:06PM +0100, Will Deacon wrote: >> On Fri, Jul 27, 2018 at 01:55:22PM +0100, Will Deacon wrote: >> > On Fri, Jul 27, 2018 at 08:55:11PM +1000, Stephen Rothwell wrote: >> > > On Fri, 27 Jul 2018 19:06:47 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote: >> > > > >> > > > On Fri, 27 Jul 2018 19:02:07 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote: >> > > > > >> > > > > After merging the kspp tree, today's linux-next build (x86_64 >> > > > > allmodconfig) failed like this: >> > > > > >> > > > > cc1: error: plugin stackleak_plugin should be specified before -fplugin-arg-stackleak_plugin-disable in the command line >> > > > > >> > > > > Maybe caused by commit >> > > > > >> > > > > a8b9eaddb9c0 ("gcc-plugins: Add STACKLEAK plugin for tracking the kernel stack") >> > > > > >> > > > > I have used the kspp tree from next-20180726 for today. >> > > > >> > > > Well, that obviously didn't work since the tree hasn't changed for a >> > > > few days. >> > > > >> > > > I can't see what has interacted to make this happen, so I have dropped >> > > > the kspp tree for today. >> > > >> > > Actually, it may have been caused by commit >> > > >> > > 0b3e336601b8 ("arm64: Add support for STACKLEAK gcc plugin") >> > > >> > > from the arm64 tree. >> > >> > Thanks, Stephen. I managed to reproduce this by merging for-next/kspp from >> > Kees's tree and for-next/core from the arm64 tree. The failure happens when >> > building the EFI stub, so the commit you mention above is almost certainly >> > the culprit. >> > >> > We build the stub with the following GCC invocation: >> > >> > gcc -Wp,-MD,drivers/firmware/efi/libstub/.efi-stub-helper.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.9/include -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -mcmodel=small -m64 -D__KERNEL__ -O2 -fPIC -fno-strict-aliasing -mno-red-zone -mno-mmx -mno-sse -fshort-wchar -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY -ffreestanding -fno-stack-protector -fplugin-arg-stackleak_plugin-disable -fno-builtin -DKBUILD_BASENAME='"efi_stub_helper"' -DKBUILD_MODNAME='"efi_stub_helper"' -c -o drivers/firmware/efi/libstub/.tmp_efi-stub-helper.o drivers/firmware/efi/libstub/efi-stub-helper.c >> > >> > so given that we're not passing any -fplugin= option anyway (because we >> > override KBUILD_CFLAGS for the stub), I don't understand why we need >> > to the disable option at all. >> > >> > Laura? >> >> ... ah, but arm and arm64 inherit the old KBUILD_CFLAGS via the >> cflags-$(CONFIG_ARM64) and cflags-$(CONFIG_ARM) definitions, so they >> would be the places where we need to disable the plugin. > > i.e. something like the diff below. > > Will > > --->8 > > diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile > index 25dd2a14560d..f3700fe08908 100644 > --- a/drivers/firmware/efi/libstub/Makefile > +++ b/drivers/firmware/efi/libstub/Makefile > @@ -11,9 +11,11 @@ cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ -O2 \ > -fPIC -fno-strict-aliasing -mno-red-zone \ > -mno-mmx -mno-sse -fshort-wchar > > -cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS)) -fpie > +cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS)) -fpie \ > + $(DISABLE_STACKLEAK_PLUGIN) > cflags-$(CONFIG_ARM) := $(subst -pg,,$(KBUILD_CFLAGS)) \ > - -fno-builtin -fpic -mno-single-pic-base > + -fno-builtin -fpic -mno-single-pic-base \ > + $(DISABLE_STACKLEAK_PLUGIN) > > cflags-$(CONFIG_EFI_ARMSTUB) += -I$(srctree)/scripts/dtc/libfdt > > @@ -21,7 +23,6 @@ KBUILD_CFLAGS := $(cflags-y) -DDISABLE_BRANCH_PROFILING \ > -D__NO_FORTIFY \ > $(call cc-option,-ffreestanding) \ > $(call cc-option,-fno-stack-protector) \ > - $(DISABLE_STACKLEAK_PLUGIN) > > GCOV_PROFILE := n > KASAN_SANITIZE := n Ah! Thanks for tracking this down! -Kees -- Kees Cook Pixel Security ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: linux-next: build failure after merge of the kspp tree 2018-07-27 12:55 ` Will Deacon 2018-07-27 13:01 ` Will Deacon @ 2018-07-30 7:33 ` Stephen Rothwell 2018-07-30 14:47 ` Laura Abbott 2018-07-31 10:09 ` linux-next: build failure after merge of the kspp tree Will Deacon 1 sibling, 2 replies; 15+ messages in thread From: Stephen Rothwell @ 2018-07-30 7:33 UTC (permalink / raw) To: Will Deacon Cc: Kees Cook, Linux-Next Mailing List, Linux Kernel Mailing List, Alexander Popov, Catalin Marinas, Laura Abbott [-- Attachment #1: Type: text/plain, Size: 2644 bytes --] Hi all, On Fri, 27 Jul 2018 13:55:22 +0100 Will Deacon <will.deacon@arm.com> wrote: > > On Fri, Jul 27, 2018 at 08:55:11PM +1000, Stephen Rothwell wrote: > > On Fri, 27 Jul 2018 19:06:47 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > > > > > On Fri, 27 Jul 2018 19:02:07 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > > > > > > > After merging the kspp tree, today's linux-next build (x86_64 > > > > allmodconfig) failed like this: > > > > > > > > cc1: error: plugin stackleak_plugin should be specified before -fplugin-arg-stackleak_plugin-disable in the command line > > > > > > > > Maybe caused by commit > > > > > > > > a8b9eaddb9c0 ("gcc-plugins: Add STACKLEAK plugin for tracking the kernel stack") > > > > > > > > I have used the kspp tree from next-20180726 for today. > > > > > > Well, that obviously didn't work since the tree hasn't changed for a > > > few days. > > > > > > I can't see what has interacted to make this happen, so I have dropped > > > the kspp tree for today. > > > > Actually, it may have been caused by commit > > > > 0b3e336601b8 ("arm64: Add support for STACKLEAK gcc plugin") > > > > from the arm64 tree. > > Thanks, Stephen. I managed to reproduce this by merging for-next/kspp from > Kees's tree and for-next/core from the arm64 tree. The failure happens when > building the EFI stub, so the commit you mention above is almost certainly > the culprit. > > We build the stub with the following GCC invocation: > > gcc -Wp,-MD,drivers/firmware/efi/libstub/.efi-stub-helper.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.9/include -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -mcmodel=small -m64 -D__KERNEL__ -O2 -fPIC -fno-strict-aliasing -mno-red-zone -mno-mmx -mno-sse -fshort-wchar -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY -ffreestanding -fno-stack-protector -fplugin-arg-stackleak_plugin-disable -fno-builtin -DKBUILD_BASENAME='"efi_stub_helper"' -DKBUILD_MODNAME='"efi_stub_helper"' -c -o drivers/firmware/efi/libstub/.tmp_efi-stub-helper.o drivers/firmware/efi/libstub/efi-stub-helper.c > > so given that we're not passing any -fplugin= option anyway (because we > override KBUILD_CFLAGS for the stub), I don't understand why we need > to the disable option at all. > > Laura? So today I am just trying reverting that arm64 tree commit. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: linux-next: build failure after merge of the kspp tree 2018-07-30 7:33 ` Stephen Rothwell @ 2018-07-30 14:47 ` Laura Abbott 2018-07-30 16:37 ` Will Deacon 2018-07-31 10:09 ` linux-next: build failure after merge of the kspp tree Will Deacon 1 sibling, 1 reply; 15+ messages in thread From: Laura Abbott @ 2018-07-30 14:47 UTC (permalink / raw) To: Stephen Rothwell, Will Deacon Cc: Kees Cook, Linux-Next Mailing List, Linux Kernel Mailing List, Alexander Popov, Catalin Marinas On 07/30/2018 12:33 AM, Stephen Rothwell wrote: > Hi all, > > On Fri, 27 Jul 2018 13:55:22 +0100 Will Deacon <will.deacon@arm.com> wrote: >> >> On Fri, Jul 27, 2018 at 08:55:11PM +1000, Stephen Rothwell wrote: >>> On Fri, 27 Jul 2018 19:06:47 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote: >>>> >>>> On Fri, 27 Jul 2018 19:02:07 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote: >>>>> >>>>> After merging the kspp tree, today's linux-next build (x86_64 >>>>> allmodconfig) failed like this: >>>>> >>>>> cc1: error: plugin stackleak_plugin should be specified before -fplugin-arg-stackleak_plugin-disable in the command line >>>>> >>>>> Maybe caused by commit >>>>> >>>>> a8b9eaddb9c0 ("gcc-plugins: Add STACKLEAK plugin for tracking the kernel stack") >>>>> >>>>> I have used the kspp tree from next-20180726 for today. >>>> >>>> Well, that obviously didn't work since the tree hasn't changed for a >>>> few days. >>>> >>>> I can't see what has interacted to make this happen, so I have dropped >>>> the kspp tree for today. >>> >>> Actually, it may have been caused by commit >>> >>> 0b3e336601b8 ("arm64: Add support for STACKLEAK gcc plugin") >>> >>> from the arm64 tree. >> >> Thanks, Stephen. I managed to reproduce this by merging for-next/kspp from >> Kees's tree and for-next/core from the arm64 tree. The failure happens when >> building the EFI stub, so the commit you mention above is almost certainly >> the culprit. >> >> We build the stub with the following GCC invocation: >> >> gcc -Wp,-MD,drivers/firmware/efi/libstub/.efi-stub-helper.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.9/include -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -mcmodel=small -m64 -D__KERNEL__ -O2 -fPIC -fno-strict-aliasing -mno-red-zone -mno-mmx -mno-sse -fshort-wchar -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY -ffreestanding -fno-stack-protector -fplugin-arg-stackleak_plugin-disable -fno-builtin -DKBUILD_BASENAME='"efi_stub_helper"' -DKBUILD_MODNAME='"efi_stub_helper"' -c -o drivers/firmware/efi/libstub/.tmp_efi-stub-helper.o drivers/firmware/efi/libstub/ef i-stub-helper.c >> >> so given that we're not passing any -fplugin= option anyway (because we >> override KBUILD_CFLAGS for the stub), I don't understand why we need >> to the disable option at all. >> >> Laura? > > So today I am just trying reverting that arm64 tree commit. > It looks like arm and arm64 start from the KBUILD_CFLAGS and then filter out vs. x86 which just specifies the CFLAGS individually, hence x86 picking up the disable when there's no plugin at all. This seems to be the simplest fix unless we want to change arm64 to not pick up all the KBUILD_CFLAGS to match x86. That seems like a more involved process though. If this is okay, I can send a patch that also sticks a comment in there explaining why fixing on arm64 is necessary. diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile index 25dd2a14560d..31f376279d5c 100644 --- a/drivers/firmware/efi/libstub/Makefile +++ b/drivers/firmware/efi/libstub/Makefile @@ -11,7 +11,8 @@ cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ -O2 \ -fPIC -fno-strict-aliasing -mno-red-zone \ -mno-mmx -mno-sse -fshort-wchar -cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS)) -fpie +cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS)) -fpie \ + $(DISABLE_STACKLEAK_PLUGIN) cflags-$(CONFIG_ARM) := $(subst -pg,,$(KBUILD_CFLAGS)) \ -fno-builtin -fpic -mno-single-pic-base @@ -21,7 +22,6 @@ KBUILD_CFLAGS := $(cflags-y) -DDISABLE_BRANCH_PROFILING \ -D__NO_FORTIFY \ $(call cc-option,-ffreestanding) \ $(call cc-option,-fno-stack-protector) \ - $(DISABLE_STACKLEAK_PLUGIN) GCOV_PROFILE := n KASAN_SANITIZE := n ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: linux-next: build failure after merge of the kspp tree 2018-07-30 14:47 ` Laura Abbott @ 2018-07-30 16:37 ` Will Deacon 2018-07-30 18:31 ` [PATCH] efi/libstub: Only disable stackleak plugin for arm64 Laura Abbott 0 siblings, 1 reply; 15+ messages in thread From: Will Deacon @ 2018-07-30 16:37 UTC (permalink / raw) To: Laura Abbott Cc: Stephen Rothwell, Kees Cook, Linux-Next Mailing List, Linux Kernel Mailing List, Alexander Popov, Catalin Marinas Hi Laura, On Mon, Jul 30, 2018 at 07:47:52AM -0700, Laura Abbott wrote: > On 07/30/2018 12:33 AM, Stephen Rothwell wrote: > >On Fri, 27 Jul 2018 13:55:22 +0100 Will Deacon <will.deacon@arm.com> wrote: > >>On Fri, Jul 27, 2018 at 08:55:11PM +1000, Stephen Rothwell wrote: > >>>Actually, it may have been caused by commit > >>> > >>> 0b3e336601b8 ("arm64: Add support for STACKLEAK gcc plugin") > >>> > >>>from the arm64 tree. > >> > >>Thanks, Stephen. I managed to reproduce this by merging for-next/kspp from > >>Kees's tree and for-next/core from the arm64 tree. The failure happens when > >>building the EFI stub, so the commit you mention above is almost certainly > >>the culprit. > >> > >>We build the stub with the following GCC invocation: > >> > >> gcc -Wp,-MD,drivers/firmware/efi/libstub/.efi-stub-helper.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.9/include -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -mcmodel=small -m64 -D__KERNEL__ -O2 -fPIC -fno-strict-aliasing -mno-red-zone -mno-mmx -mno-sse -fshort-wchar -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY -ffreestanding -fno-stack-protector -fplugin-arg-stackleak_plugin-disable -fno-builtin -DKBUILD_BASENAME='"efi_stub_helper"' -DKBUILD_MODNAME='"efi_stub_helper"' -c -o drivers/firmware/efi/libstub/.tmp_efi-stub-helper.o drivers/firmware/efi/libstub/e fi-stub-helper.c > >> > >>so given that we're not passing any -fplugin= option anyway (because we > >>override KBUILD_CFLAGS for the stub), I don't understand why we need > >>to the disable option at all. > >> > >>Laura? > > > >So today I am just trying reverting that arm64 tree commit. > > > > It looks like arm and arm64 start from the KBUILD_CFLAGS and > then filter out vs. x86 which just specifies the CFLAGS individually, > hence x86 picking up the disable when there's no plugin at all. This > seems to be the simplest fix unless we want to change arm64 to not > pick up all the KBUILD_CFLAGS to match x86. That seems like a more > involved process though. If this is okay, I can send a patch > that also sticks a comment in there explaining why fixing on arm64 > is necessary. Indeed, I posted a very similar patch last week! https://lore.kernel.org/lkml/CAGXu5jJ=0YBYKkQM3=KZRp1o3fT0yGY6-0UDkkit0WenFM3oDg@mail.gmail.com/T/#m1bd3d2de78e33da4d1f496fd82be7cf088ebaa06 If you send a version with a commit message, I'm happy to pick it up. Cheers, Will ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH] efi/libstub: Only disable stackleak plugin for arm64 2018-07-30 16:37 ` Will Deacon @ 2018-07-30 18:31 ` Laura Abbott 2018-07-30 19:09 ` Kees Cook 2018-07-31 8:51 ` Will Deacon 0 siblings, 2 replies; 15+ messages in thread From: Laura Abbott @ 2018-07-30 18:31 UTC (permalink / raw) To: Will Deacon Cc: Laura Abbott, Stephen Rothwell, Kees Cook, Linux-Next Mailing List, Linux Kernel Mailing List, Alexander Popov, Catalin Marinas arm64 uses the full KBUILD_CFLAGS for building libstub as opposed to x86 which doesn't. This means that x86 doesn't pick up the gcc-plugins. We need to disable the stackleak plugin but doing this unconditionally breaks x86 build since it doesn't have any plugins. Switch to disabling the stackleak plugin for arm64 only. Signed-off-by: Laura Abbott <labbott@redhat.com> --- drivers/firmware/efi/libstub/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile index 25dd2a14560d..88c322d7c71e 100644 --- a/drivers/firmware/efi/libstub/Makefile +++ b/drivers/firmware/efi/libstub/Makefile @@ -11,7 +11,10 @@ cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ -O2 \ -fPIC -fno-strict-aliasing -mno-red-zone \ -mno-mmx -mno-sse -fshort-wchar -cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS)) -fpie +# arm64 uses the full KBUILD_CFLAGS so it's necessary to explicitly +# disable the stackleak plugin +cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS)) -fpie \ + $(DISABLE_STACKLEAK_PLUGIN) cflags-$(CONFIG_ARM) := $(subst -pg,,$(KBUILD_CFLAGS)) \ -fno-builtin -fpic -mno-single-pic-base @@ -21,7 +24,6 @@ KBUILD_CFLAGS := $(cflags-y) -DDISABLE_BRANCH_PROFILING \ -D__NO_FORTIFY \ $(call cc-option,-ffreestanding) \ $(call cc-option,-fno-stack-protector) \ - $(DISABLE_STACKLEAK_PLUGIN) GCOV_PROFILE := n KASAN_SANITIZE := n -- 2.17.1 ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH] efi/libstub: Only disable stackleak plugin for arm64 2018-07-30 18:31 ` [PATCH] efi/libstub: Only disable stackleak plugin for arm64 Laura Abbott @ 2018-07-30 19:09 ` Kees Cook 2018-07-31 8:51 ` Will Deacon 1 sibling, 0 replies; 15+ messages in thread From: Kees Cook @ 2018-07-30 19:09 UTC (permalink / raw) To: Laura Abbott Cc: Will Deacon, Stephen Rothwell, Linux-Next Mailing List, Linux Kernel Mailing List, Alexander Popov, Catalin Marinas On Mon, Jul 30, 2018 at 11:31 AM, Laura Abbott <labbott@redhat.com> wrote: > arm64 uses the full KBUILD_CFLAGS for building libstub as opposed > to x86 which doesn't. This means that x86 doesn't pick up > the gcc-plugins. We need to disable the stackleak plugin but > doing this unconditionally breaks x86 build since it doesn't > have any plugins. Switch to disabling the stackleak plugin for > arm64 only. > > Signed-off-by: Laura Abbott <labbott@redhat.com> Reviewed-by: Kees Cook <keescook@chromium.org> Thanks! -Kees > --- > drivers/firmware/efi/libstub/Makefile | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile > index 25dd2a14560d..88c322d7c71e 100644 > --- a/drivers/firmware/efi/libstub/Makefile > +++ b/drivers/firmware/efi/libstub/Makefile > @@ -11,7 +11,10 @@ cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ -O2 \ > -fPIC -fno-strict-aliasing -mno-red-zone \ > -mno-mmx -mno-sse -fshort-wchar > > -cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS)) -fpie > +# arm64 uses the full KBUILD_CFLAGS so it's necessary to explicitly > +# disable the stackleak plugin > +cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS)) -fpie \ > + $(DISABLE_STACKLEAK_PLUGIN) > cflags-$(CONFIG_ARM) := $(subst -pg,,$(KBUILD_CFLAGS)) \ > -fno-builtin -fpic -mno-single-pic-base > > @@ -21,7 +24,6 @@ KBUILD_CFLAGS := $(cflags-y) -DDISABLE_BRANCH_PROFILING \ > -D__NO_FORTIFY \ > $(call cc-option,-ffreestanding) \ > $(call cc-option,-fno-stack-protector) \ > - $(DISABLE_STACKLEAK_PLUGIN) > > GCOV_PROFILE := n > KASAN_SANITIZE := n > -- > 2.17.1 > -- Kees Cook Pixel Security ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] efi/libstub: Only disable stackleak plugin for arm64 2018-07-30 18:31 ` [PATCH] efi/libstub: Only disable stackleak plugin for arm64 Laura Abbott 2018-07-30 19:09 ` Kees Cook @ 2018-07-31 8:51 ` Will Deacon 1 sibling, 0 replies; 15+ messages in thread From: Will Deacon @ 2018-07-31 8:51 UTC (permalink / raw) To: Laura Abbott Cc: Stephen Rothwell, Kees Cook, Linux-Next Mailing List, Linux Kernel Mailing List, Alexander Popov, Catalin Marinas On Mon, Jul 30, 2018 at 11:31:18AM -0700, Laura Abbott wrote: > arm64 uses the full KBUILD_CFLAGS for building libstub as opposed > to x86 which doesn't. This means that x86 doesn't pick up > the gcc-plugins. We need to disable the stackleak plugin but > doing this unconditionally breaks x86 build since it doesn't > have any plugins. Switch to disabling the stackleak plugin for > arm64 only. > > Signed-off-by: Laura Abbott <labbott@redhat.com> > --- > drivers/firmware/efi/libstub/Makefile | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) Cheers, Laura, I'll pick this up today. I think we'll need the same thing for 32-bit ARM if/when they enable support for the plugin. Will > diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile > index 25dd2a14560d..88c322d7c71e 100644 > --- a/drivers/firmware/efi/libstub/Makefile > +++ b/drivers/firmware/efi/libstub/Makefile > @@ -11,7 +11,10 @@ cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ -O2 \ > -fPIC -fno-strict-aliasing -mno-red-zone \ > -mno-mmx -mno-sse -fshort-wchar > > -cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS)) -fpie > +# arm64 uses the full KBUILD_CFLAGS so it's necessary to explicitly > +# disable the stackleak plugin > +cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS)) -fpie \ > + $(DISABLE_STACKLEAK_PLUGIN) > cflags-$(CONFIG_ARM) := $(subst -pg,,$(KBUILD_CFLAGS)) \ > -fno-builtin -fpic -mno-single-pic-base > > @@ -21,7 +24,6 @@ KBUILD_CFLAGS := $(cflags-y) -DDISABLE_BRANCH_PROFILING \ > -D__NO_FORTIFY \ > $(call cc-option,-ffreestanding) \ > $(call cc-option,-fno-stack-protector) \ > - $(DISABLE_STACKLEAK_PLUGIN) > > GCOV_PROFILE := n > KASAN_SANITIZE := n > -- > 2.17.1 > ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: linux-next: build failure after merge of the kspp tree 2018-07-30 7:33 ` Stephen Rothwell 2018-07-30 14:47 ` Laura Abbott @ 2018-07-31 10:09 ` Will Deacon 2018-07-31 11:27 ` Stephen Rothwell 1 sibling, 1 reply; 15+ messages in thread From: Will Deacon @ 2018-07-31 10:09 UTC (permalink / raw) To: Stephen Rothwell Cc: Kees Cook, Linux-Next Mailing List, Linux Kernel Mailing List, Alexander Popov, Catalin Marinas, Laura Abbott On Mon, Jul 30, 2018 at 05:33:56PM +1000, Stephen Rothwell wrote: > On Fri, 27 Jul 2018 13:55:22 +0100 Will Deacon <will.deacon@arm.com> wrote: > > Thanks, Stephen. I managed to reproduce this by merging for-next/kspp from > > Kees's tree and for-next/core from the arm64 tree. The failure happens when > > building the EFI stub, so the commit you mention above is almost certainly > > the culprit. > > > > We build the stub with the following GCC invocation: > > > > gcc -Wp,-MD,drivers/firmware/efi/libstub/.efi-stub-helper.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.9/include -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -mcmodel=small -m64 -D__KERNEL__ -O2 -fPIC -fno-strict-aliasing -mno-red-zone -mno-mmx -mno-sse -fshort-wchar -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY -ffreestanding -fno-stack-protector -fplugin-arg-stackleak_plugin-disable -fno-builtin -DKBUILD_BASENAME='"efi_stub_helper"' -DKBUILD_MODNAME='"efi_stub_helper"' -c -o drivers/firmware/efi/libstub/.tmp_efi-stub-helper.o drivers/firmware/efi/libstub/ef i-stub-helper.c > > > > so given that we're not passing any -fplugin= option anyway (because we > > override KBUILD_CFLAGS for the stub), I don't understand why we need > > to the disable option at all. > > > > Laura? > > So today I am just trying reverting that arm64 tree commit. I've pushed out Laura's fix to the arm64 for-next/core branch, so this should be resolved in the next next. Will ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: linux-next: build failure after merge of the kspp tree 2018-07-31 10:09 ` linux-next: build failure after merge of the kspp tree Will Deacon @ 2018-07-31 11:27 ` Stephen Rothwell 0 siblings, 0 replies; 15+ messages in thread From: Stephen Rothwell @ 2018-07-31 11:27 UTC (permalink / raw) To: Will Deacon Cc: Kees Cook, Linux-Next Mailing List, Linux Kernel Mailing List, Alexander Popov, Catalin Marinas, Laura Abbott [-- Attachment #1: Type: text/plain, Size: 316 bytes --] Hi Will, On Tue, 31 Jul 2018 11:09:18 +0100 Will Deacon <will.deacon@arm.com> wrote: > > I've pushed out Laura's fix to the arm64 for-next/core branch, so this > should be resolved in the next next. Thanks. I actually applied Laura's patch to today's linux-next as well. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2018-07-31 11:27 UTC | newest] Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-07-27 9:02 linux-next: build failure after merge of the kspp tree Stephen Rothwell 2018-07-27 9:06 ` Stephen Rothwell 2018-07-27 10:55 ` Stephen Rothwell 2018-07-27 12:55 ` Will Deacon 2018-07-27 13:01 ` Will Deacon 2018-07-27 13:27 ` Will Deacon 2018-07-27 16:00 ` Kees Cook 2018-07-30 7:33 ` Stephen Rothwell 2018-07-30 14:47 ` Laura Abbott 2018-07-30 16:37 ` Will Deacon 2018-07-30 18:31 ` [PATCH] efi/libstub: Only disable stackleak plugin for arm64 Laura Abbott 2018-07-30 19:09 ` Kees Cook 2018-07-31 8:51 ` Will Deacon 2018-07-31 10:09 ` linux-next: build failure after merge of the kspp tree Will Deacon 2018-07-31 11:27 ` Stephen Rothwell
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).