x86/kprobe: Add comments to arch_{,un}optimize_kprobes()
authorPeter Zijlstra <peterz@infradead.org>
Mon, 11 Nov 2019 13:02:10 +0000 (14:02 +0100)
committerIngo Molnar <mingo@kernel.org>
Wed, 27 Nov 2019 06:44:25 +0000 (07:44 +0100)
commitf2cb4f95b7571f2bebcf226cd92b448fd58950ca
tree90fdcc1b05666267186ea47bd45fc7c3f71e0c6b
parent04ae87a52074e2d448fc66143f1bd2c7d694d2b9
x86/kprobe: Add comments to arch_{,un}optimize_kprobes()

Add a few words describing how it is safe to overwrite the 4 bytes
after a kprobe. In specific it is possible the JMP.d32 required for
the optimized kprobe overwrites multiple instructions.

Tested-by: Alexei Starovoitov <ast@kernel.org>
Tested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20191111132458.401696663@infradead.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/kprobes/opt.c