x86_64: Add gap to int3 to allow for call emulation
authorJosh Poimboeuf <jpoimboe@redhat.com>
Fri, 30 Nov 2018 18:39:17 +0000 (12:39 -0600)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 8 May 2019 16:13:06 +0000 (12:13 -0400)
commit2700fefdb2d9751c416ad56897e27d41e409324a
treed61960991476d2696cef04b7a491d09813640e59
parent03197fc02b356606355d7ede343b18e3e3737771
x86_64: Add gap to int3 to allow for call emulation

To allow an int3 handler to emulate a call instruction, it must be able to
push a return address onto the stack. Add a gap to the stack to allow the
int3 handler to push the return address and change the return from int3 to
jump straight to the emulated called function target.

Link: http://lkml.kernel.org/r/20181130183917.hxmti5josgq4clti@treble
Link: http://lkml.kernel.org/r/20190502162133.GX2623@hirez.programming.kicks-ass.net
[
  Note, this is needed to allow Live Kernel Patching to not miss calling a
  patched function when tracing is enabled. -- Steven Rostedt
]

Cc: stable@vger.kernel.org
Fixes: b700e7f03df5 ("livepatch: kernel: add support for live patching")
Tested-by: Nicolai Stange <nstange@suse.de>
Reviewed-by: Nicolai Stange <nstange@suse.de>
Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
arch/x86/entry/entry_64.S