Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9489cc8f authored by Thomas Gleixner's avatar Thomas Gleixner
Browse files

arm: Prevent hotplug rwsem recursion



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: default avatarThomas Gleixner <tglx@linutronix.de>
Acked-by: default avatarIngo Molnar <mingo@kernel.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sebastian Siewior <bigeasy@linutronix.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/20170524081549.275871311@linutronix.de
parent c23a4656
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -124,5 +124,5 @@ void __kprobes patch_text(void *addr, unsigned int insn)
		.insn = insn,
	};

	stop_machine(patch_text_stop_machine, &patch, NULL);
	stop_machine_cpuslocked(patch_text_stop_machine, &patch, NULL);
}
+2 −1
Original line number Diff line number Diff line
@@ -182,7 +182,8 @@ void __kprobes kprobes_remove_breakpoint(void *addr, unsigned int insn)
		.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)