]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Feb 2018 13:02:08 +0000 (14:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Feb 2018 13:02:08 +0000 (14:02 +0100)
added patches:
arm64-mm-don-t-write-garbage-into-ttbr1_el1-register.patch
kconfig.h-include-compiler-types-to-avoid-missed-struct-attributes.patch
mips-boot-define-__assembly__-for-its.s-build.patch

queue-4.14/arm64-mm-don-t-write-garbage-into-ttbr1_el1-register.patch [new file with mode: 0644]
queue-4.14/kconfig.h-include-compiler-types-to-avoid-missed-struct-attributes.patch [new file with mode: 0644]
queue-4.14/mips-boot-define-__assembly__-for-its.s-build.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/arm64-mm-don-t-write-garbage-into-ttbr1_el1-register.patch b/queue-4.14/arm64-mm-don-t-write-garbage-into-ttbr1_el1-register.patch
new file mode 100644 (file)
index 0000000..2d994f0
--- /dev/null
@@ -0,0 +1,36 @@
+From ard.biesheuvel@linaro.org  Mon Feb 26 13:53:22 2018
+From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+Date: Fri, 23 Feb 2018 18:29:02 +0000
+Subject: arm64: mm: don't write garbage into TTBR1_EL1 register
+To: linux-arm-kernel@lists.infradead.org
+Cc: catalin.marinas@arm.com, will.deacon@arm.com, marc.zyngier@arm.com, mark.rutland@arm.com, nicolas.dechesne@linaro.org, gregkh@linuxfoundation.org, Ard Biesheuvel <ard.biesheuvel@linaro.org>
+Message-ID: <20180223182902.24873-1-ard.biesheuvel@linaro.org>
+
+From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+
+Stable backport commit 173358a49173 ("arm64: kpti: Add ->enable callback
+to remap swapper using nG mappings") of upstream commit f992b4dfd58b did
+not survive the backporting process unscathed, and ends up writing garbage
+into the TTBR1_EL1 register, rather than pointing it to the zero page to
+disable translations. Fix that.
+
+Cc: <stable@vger.kernel.org> #v4.14
+Reported-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
+Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+Acked-by: Will Deacon <will.deacon@arm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/arm64/mm/proc.S |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/arm64/mm/proc.S
++++ b/arch/arm64/mm/proc.S
+@@ -155,7 +155,7 @@ ENDPROC(cpu_do_switch_mm)
+ .macro        __idmap_cpu_set_reserved_ttbr1, tmp1, tmp2
+       adrp    \tmp1, empty_zero_page
+-      msr     ttbr1_el1, \tmp2
++      msr     ttbr1_el1, \tmp1
+       isb
+       tlbi    vmalle1
+       dsb     nsh
diff --git a/queue-4.14/kconfig.h-include-compiler-types-to-avoid-missed-struct-attributes.patch b/queue-4.14/kconfig.h-include-compiler-types-to-avoid-missed-struct-attributes.patch
new file mode 100644 (file)
index 0000000..49a07c9
--- /dev/null
@@ -0,0 +1,41 @@
+From 28128c61e08eaeced9cc8ec0e6b5d677b5b94690 Mon Sep 17 00:00:00 2001
+From: Kees Cook <keescook@chromium.org>
+Date: Thu, 22 Feb 2018 09:41:40 -0800
+Subject: kconfig.h: Include compiler types to avoid missed struct attributes
+
+From: Kees Cook <keescook@chromium.org>
+
+commit 28128c61e08eaeced9cc8ec0e6b5d677b5b94690 upstream.
+
+The header files for some structures could get included in such a way
+that struct attributes (specifically __randomize_layout from path.h) would
+be parsed as variable names instead of attributes. This could lead to
+some instances of a structure being unrandomized, causing nasty GPFs, etc.
+
+This patch makes sure the compiler_types.h header is included in
+kconfig.h so that we've always got types and struct attributes defined,
+since kconfig.h is included from the compiler command line.
+
+Reported-by: Patrick McLean <chutzpah@gentoo.org>
+Root-caused-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
+Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
+Tested-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
+Fixes: 3859a271a003 ("randstruct: Mark various structs for randomization")
+Signed-off-by: Kees Cook <keescook@chromium.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/kconfig.h |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/include/linux/kconfig.h
++++ b/include/linux/kconfig.h
+@@ -64,4 +64,7 @@
+  */
+ #define IS_ENABLED(option) __or(IS_BUILTIN(option), IS_MODULE(option))
++/* Make sure we always have all types and struct attributes defined. */
++#include <linux/compiler_types.h>
++
+ #endif /* __LINUX_KCONFIG_H */
diff --git a/queue-4.14/mips-boot-define-__assembly__-for-its.s-build.patch b/queue-4.14/mips-boot-define-__assembly__-for-its.s-build.patch
new file mode 100644 (file)
index 0000000..1408dcd
--- /dev/null
@@ -0,0 +1,41 @@
+From 0f9da844d87796ac31b04e81ee95e155e9043132 Mon Sep 17 00:00:00 2001
+From: Kees Cook <keescook@chromium.org>
+Date: Thu, 22 Feb 2018 16:59:26 -0800
+Subject: MIPS: boot: Define __ASSEMBLY__ for its.S build
+
+From: Kees Cook <keescook@chromium.org>
+
+commit 0f9da844d87796ac31b04e81ee95e155e9043132 upstream.
+
+The MIPS %.its.S compiler command did not define __ASSEMBLY__, which meant
+when compiler_types.h was added to kconfig.h, unexpected things appeared
+(e.g. struct declarations) which should not have been present. As done in
+the general %.S compiler command, __ASSEMBLY__ is now included here too.
+
+The failure was:
+
+    Error: arch/mips/boot/vmlinux.gz.its:201.1-2 syntax error
+    FATAL ERROR: Unable to parse input tree
+    /usr/bin/mkimage: Can't read arch/mips/boot/vmlinux.gz.itb.tmp: Invalid argument
+    /usr/bin/mkimage Can't add hashes to FIT blob
+
+Reported-by: kbuild test robot <lkp@intel.com>
+Fixes: 28128c61e08e ("kconfig.h: Include compiler types to avoid missed struct attributes")
+Signed-off-by: Kees Cook <keescook@chromium.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/mips/boot/Makefile |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/mips/boot/Makefile
++++ b/arch/mips/boot/Makefile
+@@ -126,6 +126,7 @@ $(obj)/vmlinux.its.S: $(addprefix $(srct
+ quiet_cmd_cpp_its_S = ITS     $@
+       cmd_cpp_its_S = $(CPP) $(cpp_flags) -P -C -o $@ $< \
++                      -D__ASSEMBLY__ \
+                       -DKERNEL_NAME="\"Linux $(KERNELRELEASE)\"" \
+                       -DVMLINUX_BINARY="\"$(3)\"" \
+                       -DVMLINUX_COMPRESSION="\"$(2)\"" \
index f4e4ea61f8331f849e4fc77d7901a6517f971060..d0c5fd2acf6f25db93ed04a8748e607b38ca5df0 100644 (file)
@@ -1 +1,4 @@
 netfilter-drop-outermost-socket-lock-in-getsockopt.patch
+arm64-mm-don-t-write-garbage-into-ttbr1_el1-register.patch
+kconfig.h-include-compiler-types-to-avoid-missed-struct-attributes.patch
+mips-boot-define-__assembly__-for-its.s-build.patch