]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 31 Dec 2017 09:21:21 +0000 (10:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 31 Dec 2017 09:21:21 +0000 (10:21 +0100)
added patches:
kbuild-add-fno-stack-check-to-kernel-build-options.patch

queue-4.14/kbuild-add-fno-stack-check-to-kernel-build-options.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/kbuild-add-fno-stack-check-to-kernel-build-options.patch b/queue-4.14/kbuild-add-fno-stack-check-to-kernel-build-options.patch
new file mode 100644 (file)
index 0000000..afcec00
--- /dev/null
@@ -0,0 +1,49 @@
+From 3ce120b16cc548472f80cf8644f90eda958cf1b6 Mon Sep 17 00:00:00 2001
+From: Linus Torvalds <torvalds@linux-foundation.org>
+Date: Fri, 29 Dec 2017 17:34:43 -0800
+Subject: kbuild: add '-fno-stack-check' to kernel build options
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Linus Torvalds <torvalds@linux-foundation.org>
+
+commit 3ce120b16cc548472f80cf8644f90eda958cf1b6 upstream.
+
+It appears that hardened gentoo enables "-fstack-check" by default for
+gcc.
+
+That doesn't work _at_all_ for the kernel, because the kernel stack
+doesn't act like a user stack at all: it's much smaller, and it doesn't
+auto-expand on use.  So the extra "probe one page below the stack" code
+generated by -fstack-check just breaks the kernel in horrible ways,
+causing infinite double faults etc.
+
+[ I have to say, that the particular code gcc generates looks very
+  stupid even for user space where it works, but that's a separate
+  issue.  ]
+
+Reported-and-tested-by: Alexander Tsoy <alexander@tsoy.me>
+Reported-and-tested-by: Toralf Förster <toralf.foerster@gmx.de>
+Cc: Dave Hansen <dave.hansen@intel.com>
+Cc: Jiri Kosina <jikos@kernel.org>
+Cc: Andy Lutomirski <luto@amacapital.net>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ Makefile |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/Makefile
++++ b/Makefile
+@@ -802,6 +802,9 @@ KBUILD_CFLAGS += $(call cc-disable-warni
+ # disable invalid "can't wrap" optimizations for signed / pointers
+ KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
++# Make sure -fstack-check isn't enabled (like gentoo apparently did)
++KBUILD_CFLAGS  += $(call cc-option,-fno-stack-check,)
++
+ # conserve stack if available
+ KBUILD_CFLAGS   += $(call cc-option,-fconserve-stack)
index 681d35384498df116b39d9a46d13ede92447ae09..a830d40a1b7cc342a41edc817d57c3addf268ff5 100644 (file)
@@ -55,3 +55,4 @@ alsa-hda-fix-missing-coef-init-for-alc225-295-299.patch
 cpufreq-schedutil-use-idle_calls-counter-of-the-remote-cpu.patch
 block-fix-blk_rq_append_bio.patch
 block-don-t-let-passthrough-io-go-into-.make_request_fn.patch
+kbuild-add-fno-stack-check-to-kernel-build-options.patch