From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752982AbdC2E7Q (ORCPT ); Wed, 29 Mar 2017 00:59:16 -0400 Received: from mail.kernel.org ([198.145.29.136]:42020 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752482AbdC2E7H (ORCPT ); Wed, 29 Mar 2017 00:59:07 -0400 From: Masami Hiramatsu To: linux-kernel@vger.kernel.org, Ingo Molnar Cc: Peter Zijlstra , Thomas Gleixner , "H . Peter Anvin" , Ananth N Mavinakayanahalli , Anil S Keshavamurthy , "David S . Miller" , Andrey Ryabinin , Ye Xiaolong , mhiramat@kernel.org Subject: [RFC PATCH tip/master V3 2/8] kprobes/x86: Fix the description of __copy_instruction() Date: Wed, 29 Mar 2017 13:58:06 +0900 Message-Id: <149076347582.22469.3775133607244923462.stgit@devbox> X-Mailer: git-send-email 2.9.3 In-Reply-To: <149076333370.22469.11135086121721120819.stgit@devbox> References: <149076333370.22469.11135086121721120819.stgit@devbox> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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;