Received: by 10.223.176.46 with SMTP id f43csp1677047wra; Wed, 24 Jan 2018 21:30:47 -0800 (PST) X-Google-Smtp-Source: AH8x227d15rAawkNKOoTOde248+NEH3nL1KppqLou+JFRyhl6RHWm3GRugpI9GrWOk96D/VtDqT5 X-Received: by 2002:a17:902:d24:: with SMTP id 33-v6mr10146101plu.40.1516858247859; Wed, 24 Jan 2018 21:30:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516858247; cv=none; d=google.com; s=arc-20160816; b=y7gN4Eu1cojSpvrgJdz489Pb06VwaI3ZC2wMMmCPwBHW1anMGzspNkR5S86Ot4XMMv mJn7w8r9gRQumQSIgqdZp5ZzJ1qFQ1fM9CvWST8D8WGTCDTco1TTZnNAHrtRAJKrfbJW wx8VcqS5e6/iAAqdD+T5w27QxelDhfS29rE8Q/jlcecpcGm9OI2CJvsmPel31eHtzrS2 wYKWP5vwdE2wiv12kOWY5I4k7uXseIthNhnDw/VnHr8D5WWv3Rb4ly/wA6uLZzUI5rrF cff8GAX4XViYRrs/+sFM8Jx/s3rtJH4bcouOdFt4B4KjhiyxAqyTOt0GnCkEe+yyhGMs 8egw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dmarc-filter:arc-authentication-results; bh=NPzpf7Y95BepGBfajNCyFBhMdA3vsY5HD+O6mCOBhqw=; b=vcA0JTdCK4/A0+CW7xwxI3dChbNChMYg2l5+UISQtlGqIl7k3YZGJk0J071Y9RMe2E uiWt8gHT/Zw7BFjBIg3HVFqTcwciWq2Hhrfky/CVtn9o3vCyZq2fJphsNEjBeBfh1Gds vgawBGiy6kDRcDwoDQOajx731vOjMkMmC1WXHCY1bRNokTVrQO29/pMFqF3RPCCY+Z5N 7fRnAvLkUdqNMKVrhrUgYL7e3STmvo8i6DDqh8F2SYuVGzDP5N8Kp4gqgFwygtOX5mBT 1+DG/4Kl3gHRI5ONe1Qtfzcm/fd9MXPLYEl5saWSh4WUTBRu1qUldR6xy6GxjadM8nXl CzGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o1-v6si918822plb.686.2018.01.24.21.30.34; Wed, 24 Jan 2018 21:30:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751256AbeAYF26 (ORCPT + 99 others); Thu, 25 Jan 2018 00:28:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:42280 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750769AbeAYF25 (ORCPT ); Thu, 25 Jan 2018 00:28:57 -0500 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5BB1420856; Thu, 25 Jan 2018 05:28:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5BB1420856 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=mhiramat@kernel.org From: Masami Hiramatsu To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Cc: Ingo Molnar , "H . Peter Anvin" , x86@kernel.org, Masami Hiramatsu , Ananth N Mavinakayanahalli , Anil S Keshavamurthy , "David S . Miller" , Jon Medhurst , Will Deacon , Arnd Bergmann , David Howells , Heiko Carstens , "Tobin C . Harding" , Linus Torvalds Subject: [PATCH 4/8] kprobes/x86: Fix %p uses in error messages Date: Thu, 25 Jan 2018 14:28:32 +0900 Message-Id: <151685811228.3099.12831193108489765339.stgit@devbox> X-Mailer: git-send-email 2.13.6 In-Reply-To: <151685799071.3099.10383062804474021403.stgit@devbox> References: <151685799071.3099.10383062804474021403.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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix %p uses in error messages in kprobes/x86. - Some %p uses are not needed. Just remove it (or remove message). - One %p use is right before the BUG() so replaced with %px. Signed-off-by: Masami Hiramatsu --- arch/x86/kernel/kprobes/core.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c index bd36f3c33cd0..aea956aedad7 100644 --- a/arch/x86/kernel/kprobes/core.c +++ b/arch/x86/kernel/kprobes/core.c @@ -391,8 +391,6 @@ int __copy_instruction(u8 *dest, u8 *src, u8 *real, struct insn *insn) - (u8 *) real; if ((s64) (s32) newdisp != newdisp) { pr_err("Kprobes error: new displacement does not fit into s32 (%llx)\n", newdisp); - pr_err("\tSrc: %p, Dest: %p, old disp: %x\n", - src, real, insn->displacement.value); return 0; } disp = (u8 *) dest + insn_offset_displacement(insn); @@ -636,8 +634,7 @@ static int reenter_kprobe(struct kprobe *p, struct pt_regs *regs, * Raise a BUG or we'll continue in an endless reentering loop * and eventually a stack overflow. */ - printk(KERN_WARNING "Unrecoverable kprobe detected at %p.\n", - p->addr); + pr_err("Unrecoverable kprobe detected.\n"); dump_kprobe(p); BUG(); default: @@ -1146,12 +1143,11 @@ int longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) (addr < (u8 *) jprobe_return_end)) { if (stack_addr(regs) != saved_sp) { struct pt_regs *saved_regs = &kcb->jprobe_saved_regs; - printk(KERN_ERR - "current sp %p does not match saved sp %p\n", + pr_err("current sp %px does not match saved sp %px\n", stack_addr(regs), saved_sp); - printk(KERN_ERR "Saved registers for jprobe %p\n", jp); + pr_err("Saved registers for jprobe\n"); show_regs(saved_regs); - printk(KERN_ERR "Current registers\n"); + pr_err("Current registers\n"); show_regs(regs); BUG(); }