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 +- Add patch to fix alternatives oops from Thomas Gleixner (rhbz 1258223) + * Fri Sep 04 2015 Josh Boyer - 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 +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" +Signed-off-by: Thomas Gleixner +--- + 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 +