summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/alternative.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2020-08-18 15:57:47 +0200
committerIngo Molnar <mingo@kernel.org>2020-09-01 09:58:05 +0200
commitc43a43e439e00ad2a4d98716895d961ade6bbbfc (patch)
treef0432ac71a822b7167a53d524b1a8f09e754f60d /arch/x86/kernel/alternative.c
parentf03c412915f5f69f2d17bcd20ecdd69320bcbf7b (diff)
downloadlinux-stable-c43a43e439e00ad2a4d98716895d961ade6bbbfc.tar.gz
linux-stable-c43a43e439e00ad2a4d98716895d961ade6bbbfc.tar.bz2
linux-stable-c43a43e439e00ad2a4d98716895d961ade6bbbfc.zip
x86/alternatives: Teach text_poke_bp() to emulate RET
Future patches will need to poke a RET instruction, provide the infrastructure required for this. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Cc: Masami Hiramatsu <mhiramat@kernel.org> Link: https://lore.kernel.org/r/20200818135804.982214828@infradead.org
Diffstat (limited to 'arch/x86/kernel/alternative.c')
-rw-r--r--arch/x86/kernel/alternative.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index cdaab30880b9..4adbe65afe23 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -1103,6 +1103,10 @@ noinstr int poke_int3_handler(struct pt_regs *regs)
*/
goto out_put;
+ case RET_INSN_OPCODE:
+ int3_emulate_ret(regs);
+ break;
+
case CALL_INSN_OPCODE:
int3_emulate_call(regs, (long)ip + tp->rel32);
break;
@@ -1277,6 +1281,7 @@ static void text_poke_loc_init(struct text_poke_loc *tp, void *addr,
switch (tp->opcode) {
case INT3_INSN_OPCODE:
+ case RET_INSN_OPCODE:
break;
case CALL_INSN_OPCODE: