All of lore.kernel.org
 help / color / mirror / Atom feed
* + makefile-move-stackprotector-availability-out-of-kconfig.patch added to -mm tree
@ 2017-10-17 21:06 akpm
  0 siblings, 0 replies; 2+ messages in thread
From: akpm @ 2017-10-17 21:06 UTC (permalink / raw)
  To: keescook, dalias, labbott, mingo, mmarek, npiggin, viro,
	yamada.masahiro, ysato, mm-commits


The patch titled
     Subject: Makefile: move stackprotector availability out of Kconfig
has been added to the -mm tree.  Its filename is
     makefile-move-stackprotector-availability-out-of-kconfig.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/makefile-move-stackprotector-availability-out-of-kconfig.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/makefile-move-stackprotector-availability-out-of-kconfig.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Kees Cook <keescook@chromium.org>
Subject: Makefile: move stackprotector availability out of Kconfig

Various portions of the kernel, especially per-architecture pieces, need
to know if the compiler is building it with the stack protector.  This was
done in the arch/Kconfig with 'select', but this doesn't allow a way to do
auto-detected compiler support.  In preparation for creating an
on-if-available default, move the logic for the definition of
CONFIG_CC_STACKPROTECTOR into the Makefile.

Link: http://lkml.kernel.org/r/1506972007-80614-3-git-send-email-keescook@chromium.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <mmarek@suse.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Rich Felker <dalias@libc.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 Makefile     |    7 +++++--
 arch/Kconfig |    8 --------
 2 files changed, 5 insertions(+), 10 deletions(-)

diff -puN arch/Kconfig~makefile-move-stackprotector-availability-out-of-kconfig arch/Kconfig
--- a/arch/Kconfig~makefile-move-stackprotector-availability-out-of-kconfig
+++ a/arch/Kconfig
@@ -523,12 +523,6 @@ config HAVE_CC_STACKPROTECTOR
 	  - its compiler supports the -fstack-protector option
 	  - it has implemented a stack canary (e.g. __stack_chk_guard)
 
-config CC_STACKPROTECTOR
-	def_bool n
-	help
-	  Set when a stack-protector mode is enabled, so that the build
-	  can enable kernel-side support for the GCC feature.
-
 choice
 	prompt "Stack Protector buffer overflow detection"
 	depends on HAVE_CC_STACKPROTECTOR
@@ -549,7 +543,6 @@ config CC_STACKPROTECTOR_NONE
 
 config CC_STACKPROTECTOR_REGULAR
 	bool "Regular"
-	select CC_STACKPROTECTOR
 	help
 	  Functions will have the stack-protector canary logic added if they
 	  have an 8-byte or larger character array on the stack.
@@ -563,7 +556,6 @@ config CC_STACKPROTECTOR_REGULAR
 
 config CC_STACKPROTECTOR_STRONG
 	bool "Strong"
-	select CC_STACKPROTECTOR
 	help
 	  Functions will have the stack-protector canary logic added in any
 	  of the following conditions:
diff -puN Makefile~makefile-move-stackprotector-availability-out-of-kconfig Makefile
--- a/Makefile~makefile-move-stackprotector-availability-out-of-kconfig
+++ a/Makefile
@@ -688,8 +688,11 @@ else
   stackp-flag := $(call cc-option, -fno-stack-protector)
 endif
 endif
-# Find arch-specific stack protector compiler sanity-checking script.
-ifdef CONFIG_CC_STACKPROTECTOR
+ifdef stackp-name
+  # If the stack protector has been selected, inform the rest of the build.
+  KBUILD_CFLAGS += -DCONFIG_CC_STACKPROTECTOR
+  KBUILD_AFLAGS += -DCONFIG_CC_STACKPROTECTOR
+  # Find arch-specific stack protector compiler sanity-checking script.
   stackp-path := $(srctree)/scripts/gcc-$(SRCARCH)_$(BITS)-has-stack-protector.sh
   stackp-check := $(wildcard $(stackp-path))
 endif
_

Patches currently in -mm which might be from keescook@chromium.org are

writeback-convert-timers-to-use-timer_setup.patch
sh-boot-add-static-stack-protector-to-pre-kernel.patch
makefile-move-stackprotector-availability-out-of-kconfig.patch


^ permalink raw reply	[flat|nested] 2+ messages in thread

* + makefile-move-stackprotector-availability-out-of-kconfig.patch added to -mm tree
@ 2017-10-02 21:43 akpm
  0 siblings, 0 replies; 2+ messages in thread
From: akpm @ 2017-10-02 21:43 UTC (permalink / raw)
  To: keescook, dalias, labbott, mingo, mmarek, npiggin, viro,
	yamada.masahiro, ysato, mm-commits


The patch titled
     Subject: Makefile: move stackprotector availability out of Kconfig
has been added to the -mm tree.  Its filename is
     makefile-move-stackprotector-availability-out-of-kconfig.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/makefile-move-stackprotector-availability-out-of-kconfig.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/makefile-move-stackprotector-availability-out-of-kconfig.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Kees Cook <keescook@chromium.org>
Subject: Makefile: move stackprotector availability out of Kconfig

Various portions of the kernel, especially per-architecture pieces, need
to know if the compiler is building it with the stack protector.  This was
done in the arch/Kconfig with 'select', but this doesn't allow a way to do
auto-detected compiler support.  In preparation for creating an
on-if-available default, move the logic for the definition of
CONFIG_CC_STACKPROTECTOR into the Makefile.

Link: http://lkml.kernel.org/r/1506972007-80614-3-git-send-email-keescook@chromium.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <mmarek@suse.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Rich Felker <dalias@libc.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 Makefile     |    7 +++++--
 arch/Kconfig |    8 --------
 2 files changed, 5 insertions(+), 10 deletions(-)

diff -puN arch/Kconfig~makefile-move-stackprotector-availability-out-of-kconfig arch/Kconfig
--- a/arch/Kconfig~makefile-move-stackprotector-availability-out-of-kconfig
+++ a/arch/Kconfig
@@ -523,12 +523,6 @@ config HAVE_CC_STACKPROTECTOR
 	  - its compiler supports the -fstack-protector option
 	  - it has implemented a stack canary (e.g. __stack_chk_guard)
 
-config CC_STACKPROTECTOR
-	def_bool n
-	help
-	  Set when a stack-protector mode is enabled, so that the build
-	  can enable kernel-side support for the GCC feature.
-
 choice
 	prompt "Stack Protector buffer overflow detection"
 	depends on HAVE_CC_STACKPROTECTOR
@@ -549,7 +543,6 @@ config CC_STACKPROTECTOR_NONE
 
 config CC_STACKPROTECTOR_REGULAR
 	bool "Regular"
-	select CC_STACKPROTECTOR
 	help
 	  Functions will have the stack-protector canary logic added if they
 	  have an 8-byte or larger character array on the stack.
@@ -563,7 +556,6 @@ config CC_STACKPROTECTOR_REGULAR
 
 config CC_STACKPROTECTOR_STRONG
 	bool "Strong"
-	select CC_STACKPROTECTOR
 	help
 	  Functions will have the stack-protector canary logic added in any
 	  of the following conditions:
diff -puN Makefile~makefile-move-stackprotector-availability-out-of-kconfig Makefile
--- a/Makefile~makefile-move-stackprotector-availability-out-of-kconfig
+++ a/Makefile
@@ -688,8 +688,11 @@ else
   stackp-flag := $(call cc-option, -fno-stack-protector)
 endif
 endif
-# Find arch-specific stack protector compiler sanity-checking script.
-ifdef CONFIG_CC_STACKPROTECTOR
+ifdef stackp-name
+  # If the stack protector has been selected, inform the rest of the build.
+  KBUILD_CFLAGS += -DCONFIG_CC_STACKPROTECTOR
+  KBUILD_AFLAGS += -DCONFIG_CC_STACKPROTECTOR
+  # Find arch-specific stack protector compiler sanity-checking script.
   stackp-path := $(srctree)/scripts/gcc-$(SRCARCH)_$(BITS)-has-stack-protector.sh
   stackp-check := $(wildcard $(stackp-path))
 endif
_

Patches currently in -mm which might be from keescook@chromium.org are

sh-boot-add-static-stack-protector-to-pre-kernel.patch
makefile-move-stackprotector-availability-out-of-kconfig.patch
makefile-introduce-config_cc_stackprotector_auto.patch


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-17 21:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-17 21:06 + makefile-move-stackprotector-availability-out-of-kconfig.patch added to -mm tree akpm
  -- strict thread matches above, loose matches on Subject: below --
2017-10-02 21:43 akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.