summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Boyer <jwboyer@fedoraproject.org>2015-09-04 13:19:48 -0400
committerJosh Boyer <jwboyer@fedoraproject.org>2015-09-04 13:19:48 -0400
commit4e416f8cf70b8cd3604f5716039fddc0f6ef83ff (patch)
tree34004f58b213e71f0246a5be9c07dfbda5f06d4b
parenta80cbfad26820e3b4ca703988168e85f2da7a2bf (diff)
downloadkernel-4e416f8cf70b8cd3604f5716039fddc0f6ef83ff.tar.gz
kernel-4e416f8cf70b8cd3604f5716039fddc0f6ef83ff.tar.xz
kernel-4e416f8cf70b8cd3604f5716039fddc0f6ef83ff.zip
Add patch to fix alternatives oops from Thomas Gleixner (rhbz 1258223)
-rw-r--r--kernel.spec6
-rw-r--r--x86-alternatives-Make-optimize_nops-interrupt-safe-a.patch41
2 files changed, 47 insertions, 0 deletions
diff --git a/kernel.spec b/kernel.spec
index 1c1ef688d..06cdeaee8 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -600,6 +600,9 @@ Patch518: drm-vmwgfx-Allow-dropped-masters-render-node-like-ac.patch
Patch519: security-device_cgroup-fix-RCU-lockdep-splat.patch
Patch520: ARM-dts-Fix-Makefile-target-for-sun4i-a10-itead-itea.patch
+#rhbz 1258223
+Patch521: x86-alternatives-Make-optimize_nops-interrupt-safe-a.patch
+
Patch904: kdbus.patch
# END OF PATCH DEFINITIONS
@@ -2047,6 +2050,9 @@ fi
#
#
%changelog
+* Fri Sep 04 2015 Josh Boyer <jwboyer@fedoraproject.org>
+- Add patch to fix alternatives oops from Thomas Gleixner (rhbz 1258223)
+
* Fri Sep 04 2015 Josh Boyer <jwboyer@fedoraproject.org> - 4.3.0-0.rc0.git7.1
- Linux v4.2-6663-g807249d3ada1
diff --git a/x86-alternatives-Make-optimize_nops-interrupt-safe-a.patch b/x86-alternatives-Make-optimize_nops-interrupt-safe-a.patch
new file mode 100644
index 000000000..e2e130aa8
--- /dev/null
+++ b/x86-alternatives-Make-optimize_nops-interrupt-safe-a.patch
@@ -0,0 +1,41 @@
+From 0279e7aded382011be52a2ad340fbfdbf15e75be Mon Sep 17 00:00:00 2001
+From: Thomas Gleixner <tglx@linutronix.de>
+Date: Thu, 3 Sep 2015 12:41:47 +0200
+Subject: [PATCH] x86/alternatives: Make optimize_nops() interrupt safe and
+ synced
+
+optimize_nops() is buggy in two aspects:
+
+- It's not disabling interrupts across the modification
+- It's lacking a sync_core() call
+
+Fixes: 4fd4b6e5537c 'x86/alternatives: Use optimized NOPs for padding'
+Reported-by: "Richard W.M. Jones" <rjones@redhat.com>
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+---
+ arch/x86/kernel/alternative.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
+index c42827eb86cf..25f909362b7a 100644
+--- a/arch/x86/kernel/alternative.c
++++ b/arch/x86/kernel/alternative.c
+@@ -338,10 +338,15 @@ done:
+
+ static void __init_or_module optimize_nops(struct alt_instr *a, u8 *instr)
+ {
++ unsigned long flags;
++
+ if (instr[0] != 0x90)
+ return;
+
++ local_irq_save(flags);
+ add_nops(instr + (a->instrlen - a->padlen), a->padlen);
++ sync_core();
++ local_irq_restore(flags);
+
+ DUMP_BYTES(instr, a->instrlen, "%p: [%d:%d) optimized NOPs: ",
+ instr, a->instrlen - a->padlen, a->padlen);
+--
+2.4.3
+