]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jun 2018 16:18:18 +0000 (18:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jun 2018 16:18:18 +0000 (18:18 +0200)
added patches:
complete-e390f9a-port-for-v4.9.106.patch
dm-bufio-avoid-false-positive-wmaybe-uninitialized-warning.patch
kvm-vmx-expose-ssbd-properly-to-guests-4.9-supplement.patch
objtool-fix-gcov-check-for-older-versions-of-gcc.patch

queue-4.9/complete-e390f9a-port-for-v4.9.106.patch [new file with mode: 0644]
queue-4.9/dm-bufio-avoid-false-positive-wmaybe-uninitialized-warning.patch [new file with mode: 0644]
queue-4.9/kvm-vmx-expose-ssbd-properly-to-guests-4.9-supplement.patch [new file with mode: 0644]
queue-4.9/objtool-fix-gcov-check-for-older-versions-of-gcc.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/complete-e390f9a-port-for-v4.9.106.patch b/queue-4.9/complete-e390f9a-port-for-v4.9.106.patch
new file mode 100644 (file)
index 0000000..4a71be4
--- /dev/null
@@ -0,0 +1,65 @@
+From philm@manjaro.org  Tue Jun 12 18:15:35 2018
+From: "Philip Müller" <philm@manjaro.org>
+Date: Sat, 9 Jun 2018 13:42:05 +0200
+Subject: complete e390f9a port for v4.9.106
+To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Cc: stable@vger.kernel.org, oberon <oberon@manjaro.org>
+Message-ID: <0a69a276-d3ad-75a5-c678-06a94ccf0e09@manjaro.org>
+
+From: "Philip Müller" <philm@manjaro.org>
+
+objtool ports introduced in v4.9.106 were not totally complete. Therefore
+they resulted in issues like:
+
+  module: overflow in relocation type 10 val XXXXXXXXXXX
+  ‘usbcore’ likely not compiled with -mcmodel=kernel
+  module: overflow in relocation type 10 val XXXXXXXXXXX
+  ‘scsi_mod’ likely not compiled with -mcmodel=kernel
+
+Missing part was the complete backport of commit e390f9a.
+
+Original notes by Josh Poimboeuf:
+
+The '__unreachable' and '__func_stack_frame_non_standard' sections are
+only used at compile time.  They're discarded for vmlinux but they
+should also be discarded for modules.
+
+Since this is a recurring pattern, prefix the section names with
+".discard.".  It's a nice convention and vmlinux.lds.h already discards
+such sections.
+
+Also remove the 'a' (allocatable) flag from the __unreachable section
+since it doesn't make sense for a discarded section.
+
+Signed-off-by: Philip Müller <philm@manjaro.org>
+Fixes: d1091c7fa3d5 ("objtool: Improve detection of BUG() and other dead ends")
+Link: https://gitlab.manjaro.org/packages/core/linux49/issues/2
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/kernel/vmlinux.lds.S |    2 --
+ include/linux/compiler-gcc.h  |    2 +-
+ 2 files changed, 1 insertion(+), 3 deletions(-)
+
+--- a/arch/x86/kernel/vmlinux.lds.S
++++ b/arch/x86/kernel/vmlinux.lds.S
+@@ -352,8 +352,6 @@ SECTIONS
+       DISCARDS
+       /DISCARD/ : {
+               *(.eh_frame)
+-              *(__func_stack_frame_non_standard)
+-              *(__unreachable)
+       }
+ }
+--- a/include/linux/compiler-gcc.h
++++ b/include/linux/compiler-gcc.h
+@@ -206,7 +206,7 @@
+ #ifdef CONFIG_STACK_VALIDATION
+ #define annotate_unreachable() ({                                     \
+       asm("1:\t\n"                                                    \
+-          ".pushsection __unreachable, \"a\"\t\n"                     \
++          ".pushsection .discard.unreachable\t\n"                     \
+           ".long 1b\t\n"                                              \
+           ".popsection\t\n");                                         \
+ })
diff --git a/queue-4.9/dm-bufio-avoid-false-positive-wmaybe-uninitialized-warning.patch b/queue-4.9/dm-bufio-avoid-false-positive-wmaybe-uninitialized-warning.patch
new file mode 100644 (file)
index 0000000..13faaf6
--- /dev/null
@@ -0,0 +1,76 @@
+From 590347e4000356f55eb10b03ced2686bd74dab40 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Thu, 22 Feb 2018 16:56:16 +0100
+Subject: dm bufio: avoid false-positive Wmaybe-uninitialized warning
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit 590347e4000356f55eb10b03ced2686bd74dab40 upstream.
+
+gcc-6.3 and earlier show a new warning after a seemingly unrelated
+change to the arm64 PAGE_KERNEL definition:
+
+In file included from drivers/md/dm-bufio.c:14:0:
+drivers/md/dm-bufio.c: In function 'alloc_buffer':
+include/linux/sched/mm.h:182:56: warning: 'noio_flag' may be used uninitialized in this function [-Wmaybe-uninitialized]
+  current->flags = (current->flags & ~PF_MEMALLOC_NOIO) | flags;
+                                                        ^
+
+The same warning happened earlier on linux-3.18 for MIPS and I did a
+workaround for that, but now it's come back.
+
+gcc-7 and newer are apparently smart enough to figure this out, and
+other architectures don't show it, so the best I could come up with is
+to rework the caller slightly in a way that makes it obvious enough to
+all arm64 compilers what is happening here.
+
+Fixes: 41acec624087 ("arm64: kpti: Make use of nG dependent on arm64_kernel_unmapped_at_el0()")
+Link: https://patchwork.kernel.org/patch/9692829/
+Cc: stable@vger.kernel.org
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+[snitzer: moved declarations inside conditional, altered vmalloc return]
+Signed-off-by: Mike Snitzer <snitzer@redhat.com>
+[nc: Backport to 4.9, adjust context for lack of 19809c2da28a]
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/md/dm-bufio.c |   17 +++++++----------
+ 1 file changed, 7 insertions(+), 10 deletions(-)
+
+--- a/drivers/md/dm-bufio.c
++++ b/drivers/md/dm-bufio.c
+@@ -373,9 +373,6 @@ static void __cache_size_refresh(void)
+ static void *alloc_buffer_data(struct dm_bufio_client *c, gfp_t gfp_mask,
+                              enum data_mode *data_mode)
+ {
+-      unsigned noio_flag;
+-      void *ptr;
+-
+       if (c->block_size <= DM_BUFIO_BLOCK_SIZE_SLAB_LIMIT) {
+               *data_mode = DATA_MODE_SLAB;
+               return kmem_cache_alloc(DM_BUFIO_CACHE(c), gfp_mask);
+@@ -399,16 +396,16 @@ static void *alloc_buffer_data(struct dm
+        * all allocations done by this process (including pagetables) are done
+        * as if GFP_NOIO was specified.
+        */
++      if (gfp_mask & __GFP_NORETRY) {
++              unsigned noio_flag = memalloc_noio_save();
++              void *ptr = __vmalloc(c->block_size, gfp_mask | __GFP_HIGHMEM,
++                                    PAGE_KERNEL);
+-      if (gfp_mask & __GFP_NORETRY)
+-              noio_flag = memalloc_noio_save();
+-
+-      ptr = __vmalloc(c->block_size, gfp_mask | __GFP_HIGHMEM, PAGE_KERNEL);
+-
+-      if (gfp_mask & __GFP_NORETRY)
+               memalloc_noio_restore(noio_flag);
++              return ptr;
++      }
+-      return ptr;
++      return __vmalloc(c->block_size, gfp_mask | __GFP_HIGHMEM, PAGE_KERNEL);
+ }
+ /*
diff --git a/queue-4.9/kvm-vmx-expose-ssbd-properly-to-guests-4.9-supplement.patch b/queue-4.9/kvm-vmx-expose-ssbd-properly-to-guests-4.9-supplement.patch
new file mode 100644 (file)
index 0000000..25615bd
--- /dev/null
@@ -0,0 +1,39 @@
+From ben@decadent.org.uk  Tue Jun 12 18:08:12 2018
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Tue, 12 Jun 2018 01:14:34 +0100
+Subject: KVM: VMX: Expose SSBD properly to guests, 4.9 supplement
+To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, Thomas Gleixner <tglx@linutronix.de>, David Woodhouse <dwmw@amazon.co.uk>, kvm@vger.kernel.org, stable@vger.kernel.org
+Message-ID: <20180612001433.GA14131@decadent.org.uk>
+Content-Disposition: inline
+
+From: Ben Hutchings <ben@decadent.org.uk>
+
+Fix an additional misuse of X86_FEATURE_SSBD in
+guest_cpuid_has_spec_ctrl().  This function was introduced in the
+backport of SSBD support to 4.9 and is not present upstream, so it was
+not fixed by commit 43462d908821 "KVM: VMX: Expose SSBD properly to
+guests."
+
+Fixes: 52817587e706 ("x86/cpufeatures: Disentangle SSBD enumeration")
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: David Woodhouse <dwmw@amazon.co.uk>
+Cc: kvm@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/x86/kvm/cpuid.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/x86/kvm/cpuid.h
++++ b/arch/x86/kvm/cpuid.h
+@@ -179,7 +179,7 @@ static inline bool guest_cpuid_has_spec_
+       if (best && (best->ebx & bit(X86_FEATURE_AMD_IBRS)))
+               return true;
+       best = kvm_find_cpuid_entry(vcpu, 7, 0);
+-      return best && (best->edx & (bit(X86_FEATURE_SPEC_CTRL) | bit(X86_FEATURE_SSBD)));
++      return best && (best->edx & (bit(X86_FEATURE_SPEC_CTRL) | bit(X86_FEATURE_SPEC_CTRL_SSBD)));
+ }
+ static inline bool guest_cpuid_has_arch_capabilities(struct kvm_vcpu *vcpu)
diff --git a/queue-4.9/objtool-fix-gcov-check-for-older-versions-of-gcc.patch b/queue-4.9/objtool-fix-gcov-check-for-older-versions-of-gcc.patch
new file mode 100644 (file)
index 0000000..f95396e
--- /dev/null
@@ -0,0 +1,54 @@
+From 867ac9d737094e46a6c33213f16dd1ec9e8bd5d5 Mon Sep 17 00:00:00 2001
+From: Josh Poimboeuf <jpoimboe@redhat.com>
+Date: Mon, 24 Jul 2017 18:34:14 -0500
+Subject: objtool: Fix gcov check for older versions of GCC
+
+From: Josh Poimboeuf <jpoimboe@redhat.com>
+
+commit 867ac9d737094e46a6c33213f16dd1ec9e8bd5d5 upstream.
+
+Objtool tries to silence 'unreachable instruction' warnings when it
+detects gcov is enabled, because gcov produces a lot of unreachable
+instructions and they don't really matter.
+
+However, the 0-day bot is still reporting some unreachable instruction
+warnings with CONFIG_GCOV_KERNEL=y on GCC 4.6.4.
+
+As it turns out, objtool's gcov detection doesn't work with older
+versions of GCC because they don't create a bunch of symbols with the
+'gcov.' prefix like newer versions of GCC do.
+
+Move the gcov check out of objtool and instead just create a new
+'--no-unreachable' flag which can be passed in by the kernel Makefile
+when CONFIG_GCOV_KERNEL is defined.
+
+Also rename the 'nofp' variable to 'no_fp' for consistency with the new
+'no_unreachable' variable.
+
+Reported-by: kbuild test robot <fengguang.wu@intel.com>
+Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Fixes: 9cfffb116887 ("objtool: Skip all "unreachable instruction" warnings for gcov kernels")
+Link: http://lkml.kernel.org/r/c243dc78eb2ffdabb6e927844dea39b6033cd395.1500939244.git.jpoimboe@redhat.com
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+[just Makefile.build as the other parts of this patch already applied - gregkh]
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ scripts/Makefile.build |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/scripts/Makefile.build
++++ b/scripts/Makefile.build
+@@ -253,6 +253,9 @@ objtool_args = check
+ ifndef CONFIG_FRAME_POINTER
+ objtool_args += --no-fp
+ endif
++ifdef CONFIG_GCOV_KERNEL
++objtool_args += --no-unreachable
++endif
+ # 'OBJECT_FILES_NON_STANDARD := y': skip objtool checking for a directory
+ # 'OBJECT_FILES_NON_STANDARD_foo.o := 'y': skip objtool checking for a file
index 2ea7e86fee2f3b52536e5f0f6efc33ac1ef7fc36..f28c0ac51682cd0df65f52986ba954805ec7f64e 100644 (file)
@@ -25,3 +25,7 @@ net-mlx4-fix-irq-unsafe-spinlock-usage.patch
 rtnetlink-validate-attributes-in-do_setlink.patch
 net-phy-broadcom-fix-bcm_write_exp.patch
 net-metrics-add-proper-netlink-validation.patch
+kvm-vmx-expose-ssbd-properly-to-guests-4.9-supplement.patch
+dm-bufio-avoid-false-positive-wmaybe-uninitialized-warning.patch
+objtool-fix-gcov-check-for-older-versions-of-gcc.patch
+complete-e390f9a-port-for-v4.9.106.patch