Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1609282
| From | Masami Hiramatsu <mhiramat@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [RFC PATCH tip/master 2/8] kprobes/x86: Fix the description of __copy_instruction() |
| Date | 2017-03-26 05:30 +0200 |
| Message-ID | <tp72q-2dq-11@gated-at.bofh.it> (permalink) |
| References | <tp72p-2dq-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Fix the description comment of __copy_instruction() function
since it has already been changed to return the length of
copied instruction.
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
arch/x86/kernel/kprobes/core.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
index 9eae5a6..81d4dc7 100644
--- a/arch/x86/kernel/kprobes/core.c
+++ b/arch/x86/kernel/kprobes/core.c
@@ -350,11 +350,10 @@ static int is_IF_modifier(kprobe_opcode_t *insn)
}
/*
- * Copy an instruction and adjust the displacement if the instruction
- * uses the %rip-relative addressing mode.
- * If it does, Return the address of the 32-bit displacement word.
- * If not, return null.
- * Only applicable to 64-bit x86.
+ * Copy an instruction with recovering modified instruction by kprobes
+ * and adjust the displacement if the instruction uses the %rip-relative
+ * addressing mode.
+ * This returns the length of copied instruction, or 0 if it has an error.
*/
int __copy_instruction(u8 *dest, u8 *src)
{
@@ -376,6 +375,7 @@ int __copy_instruction(u8 *dest, u8 *src)
memcpy(dest, insn.kaddr, length);
#ifdef CONFIG_X86_64
+ /* Only x86_64 has RIP relative instructions */
if (insn_rip_relative(&insn)) {
s64 newdisp;
u8 *disp;
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC PATCH tip/master 0/8] kprobes/x86: Make kprobes instruction buffers read-only Masami Hiramatsu <mhiramat@kernel.org> - 2017-03-26 05:30 +0200
[RFC PATCH tip/master 2/8] kprobes/x86: Fix the description of __copy_instruction() Masami Hiramatsu <mhiramat@kernel.org> - 2017-03-26 05:30 +0200
[RFC PATCH tip/master 3/8] kprobes/x86: Use instruction decoder for booster Masami Hiramatsu <mhiramat@kernel.org> - 2017-03-26 05:30 +0200
[RFC PATCH tip/master 6/8] kprobes/x86: Set kprobes pages readonly Masami Hiramatsu <mhiramat@kernel.org> - 2017-03-26 05:40 +0200
[RFC PATCH tip/master 8/8] kprobes/x86: Consolidate insn decoder users for copying code Masami Hiramatsu <mhiramat@kernel.org> - 2017-03-26 05:40 +0200
Re: [RFC PATCH tip/master 8/8] kprobes/x86: Consolidate insn decoder users for copying code Masami Hiramatsu <mhiramat@kernel.org> - 2017-03-27 00:50 +0200
[RFC PATCH tip/master 5/8] kprobes/x86: Make boostable flag boolean Masami Hiramatsu <mhiramat@kernel.org> - 2017-03-26 05:40 +0200
[RFC PATCH tip/master 7/8] kprobes/x86: Use probe_kernel_read instead of memcpy Masami Hiramatsu <mhiramat@kernel.org> - 2017-03-26 06:00 +0200
csiph-web