Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1649239

[patch V3 27/32] arm: Prevent hotplug rwsem recursion

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject [patch V3 27/32] arm: Prevent hotplug rwsem recursion
Date 2017-05-24 10:30 +0200
Message-ID <tKzQ7-8hN-31@gated-at.bofh.it> (permalink)
References <tKzQ6-8hN-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Russell King <linux@armlinux.org.uk>
---
 arch/arm/kernel/patch.c        |    2 +-
 arch/arm/probes/kprobes/core.c |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

--- a/arch/arm/kernel/patch.c
+++ b/arch/arm/kernel/patch.c
@@ -124,5 +124,5 @@ void __kprobes patch_text(void *addr, un
 		.insn = insn,
 	};
 
-	stop_machine(patch_text_stop_machine, &patch, NULL);
+	stop_machine_cpuslocked(patch_text_stop_machine, &patch, NULL);
 }
--- a/arch/arm/probes/kprobes/core.c
+++ b/arch/arm/probes/kprobes/core.c
@@ -182,7 +182,8 @@ void __kprobes kprobes_remove_breakpoint
 		.addr = addr,
 		.insn = insn,
 	};
-	stop_machine(__kprobes_remove_breakpoint, &p, cpu_online_mask);
+	stop_machine_cpuslocked(__kprobes_remove_breakpoint, &p,
+				cpu_online_mask);
 }
 
 void __kprobes arch_disarm_kprobe(struct kprobe *p)

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[patch V3 27/32] arm: Prevent hotplug rwsem recursion Thomas Gleixner <tglx@linutronix.de> - 2017-05-24 10:30 +0200

csiph-web