Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Thumshirn <jthumshirn@suse.de>2018-08-23 11:21:45 +0200
committerJohannes Thumshirn <jthumshirn@suse.de>2018-08-23 11:21:45 +0200
commit2ccd2c2062cc13161ce5a2779f2879cb59b128fb (patch)
tree643fd5e943e3d3282d1dcecd681967c2f755d1bc
parent28443b37172426f7d607af818ee85d9f80a281f5 (diff)
s390: Prevent hotplug rwsem recursion (bsc#1105731).
-rw-r--r--patches.arch/s390-prevent-hotplug-rwsem-recursion.patch67
-rw-r--r--series.conf1
2 files changed, 68 insertions, 0 deletions
diff --git a/patches.arch/s390-prevent-hotplug-rwsem-recursion.patch b/patches.arch/s390-prevent-hotplug-rwsem-recursion.patch
new file mode 100644
index 0000000000..0b5326c6a6
--- /dev/null
+++ b/patches.arch/s390-prevent-hotplug-rwsem-recursion.patch
@@ -0,0 +1,67 @@
+From: Thomas Gleixner <tglx@linutronix.de>
+Date: Wed, 24 May 2017 10:15:39 +0200
+Subject: s390: Prevent hotplug rwsem recursion
+Git-commit: 5d5dbc4ef27e72104dea6102e4d1a1bf5a8ed971
+Patch-mainline: v4.13-rc1
+References: bsc#1105731
+
+The text patching functions which are invoked from jump_label and kprobes
+code are protected against cpu hotplug at the call sites.
+
+Use stop_machine_cpuslocked() to avoid recursion on the cpu hotplug
+rwsem. stop_machine_cpuslocked() contains a lockdep assertion to catch any
+unprotected callers.
+
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Acked-by: Ingo Molnar <mingo@kernel.org>
+Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
+Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Cc: linux-s390@vger.kernel.org
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Sebastian Siewior <bigeasy@linutronix.de>
+Cc: Steven Rostedt <rostedt@goodmis.org>
+Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Link: http://lkml.kernel.org/r/20170524081549.354513406@linutronix.de
+
+Acked-by: Johannes Thumshirn <jthumshirn@suse.de>
+---
+ arch/s390/kernel/jump_label.c | 2 +-
+ arch/s390/kernel/kprobes.c | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/arch/s390/kernel/jump_label.c b/arch/s390/kernel/jump_label.c
+index 6aa630a8d24f..262506cee4c3 100644
+--- a/arch/s390/kernel/jump_label.c
++++ b/arch/s390/kernel/jump_label.c
+@@ -93,7 +93,7 @@ void arch_jump_label_transform(struct jump_entry *entry,
+ args.entry = entry;
+ args.type = type;
+
+- stop_machine(__sm_arch_jump_label_transform, &args, NULL);
++ stop_machine_cpuslocked(__sm_arch_jump_label_transform, &args, NULL);
+ }
+
+ void arch_jump_label_transform_static(struct jump_entry *entry,
+diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c
+index 3d6a99746454..6842e4501e2e 100644
+--- a/arch/s390/kernel/kprobes.c
++++ b/arch/s390/kernel/kprobes.c
+@@ -196,7 +196,7 @@ void arch_arm_kprobe(struct kprobe *p)
+ {
+ struct swap_insn_args args = {.p = p, .arm_kprobe = 1};
+
+- stop_machine(swap_instruction, &args, NULL);
++ stop_machine_cpuslocked(swap_instruction, &args, NULL);
+ }
+ NOKPROBE_SYMBOL(arch_arm_kprobe);
+
+@@ -204,7 +204,7 @@ void arch_disarm_kprobe(struct kprobe *p)
+ {
+ struct swap_insn_args args = {.p = p, .arm_kprobe = 0};
+
+- stop_machine(swap_instruction, &args, NULL);
++ stop_machine_cpuslocked(swap_instruction, &args, NULL);
+ }
+ NOKPROBE_SYMBOL(arch_disarm_kprobe);
+
+
diff --git a/series.conf b/series.conf
index d39c753578..5979dbb9c1 100644
--- a/series.conf
+++ b/series.conf
@@ -1219,6 +1219,7 @@
patches.arch/cpu-hotplug-Provide-lockdep_assert_cpus_held.patch
patches.arch/stop_machine-Provide-stop_machine_cpuslocked.patch
patches.arch/00-jump_label-reorder-hotplug-lock-and-jump_label_lock.patch
+ patches.arch/s390-prevent-hotplug-rwsem-recursion.patch
patches.fixes/cpu-hotplug-Remove-unused-check_for_tasks-function.patch
patches.arch/powerpc-Only-obtain-cpu_hotplug_lock-if-called-by-rt.patch
patches.fixes/xen-mce-dont-issue-error-message.patch