Received: by 10.223.176.46 with SMTP id f43csp1675435wra; Wed, 24 Jan 2018 21:29:06 -0800 (PST) X-Google-Smtp-Source: AH8x2240rpGI19IkeJ2MxDWRGy5AWSlFEFMIue6eBLJ+LUX70kdt35f3wg3jzwLhJgIGPByZ3oDr X-Received: by 2002:a17:902:34a:: with SMTP id 68-v6mr10410299pld.276.1516858146746; Wed, 24 Jan 2018 21:29:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516858146; cv=none; d=google.com; s=arc-20160816; b=O0p2xxcrZAg8kcrzeiGFwQxu1dL0aNHzXDOUgu8jyT5iPTy3M22AMs9awUKLpXqMyt lsZ7f6gHZXMeFb+dmSg/VNAJXqJQ3q8BVk6y6DW7dkPiVIchV7VCkIpdWVbv/FFaUN4h a/hY6Hwn26CMGZWFfI1qFSnUbRpWyfUMZM9QsTO24ZxIHDC2wP1F8ty4MyOgxZIguzll fyXrbUio7V3icW/12LUt8u6f8xVF53+3a/LNQGFKJ6ANi2sitY7oeA6ic/+EUA526oUw Qls8dC8wCNJb/GzhLl9k3SyWqNqnzaqH20RDIRYM/1UaMwztSh0oq4tPgjrwl6LVftyv +xpw== 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=J4gNBbUmb0KJrminql0B9SbEfOBm56OuSlDXU5uQtuc=; b=p8OtpOoCEwGhbpZpwWmct0OEAsSPVggRlUnaaUI6p4XmAanM18QObM4l2yyyS2hN1i KeDuB1Ba4J0CfCRs6urwF+/R7+ruj4S6GLk09iGrjOXY3GTSDrIlFRbEA9rlZYhU7jmx vbkMiy27FStOzNxHaUXthQ6F8Hl3OziLJ47yQUCnuMv0rUQdC3+GdAuC2etKuiCr9Q/W yyF+lqJfZcZi5oVk89rX0tBp0BGzkEsAVBKUz9AK34qimChZL9mHJEuv+J+jnLna0Kex 7pp5xOlOjxGPv/rKBY1rGNjeLWNalwRB7iL6o6amPNUoxyUX5iQCuYdWdS0ybTE2nK/4 Hfgg== 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 m184si4034357pfb.373.2018.01.24.21.28.19; Wed, 24 Jan 2018 21:29:06 -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 S1751184AbeAYF13 (ORCPT + 99 others); Thu, 25 Jan 2018 00:27:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:41788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751154AbeAYF12 (ORCPT ); Thu, 25 Jan 2018 00:27:28 -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 4E02C21781; Thu, 25 Jan 2018 05:27:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E02C21781 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 1/8] kprobes: Show blacklist addresses as same as kallsyms does Date: Thu, 25 Jan 2018 14:27:03 +0900 Message-Id: <151685802318.3099.14391385436778328009.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 Show kprobes blacklist addresses under same condition of showing kallsyms addresses. Since there are several name conflict for local symbols, kprobe blacklist needs to show each addresses so that user can identify where is on blacklist by comparing with kallsyms. Signed-off-by: Masami Hiramatsu --- kernel/kprobes.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/kernel/kprobes.c b/kernel/kprobes.c index da2ccf142358..cb15991ba676 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c @@ -2382,9 +2382,17 @@ static int kprobe_blacklist_seq_show(struct seq_file *m, void *v) { struct kprobe_blacklist_entry *ent = list_entry(v, struct kprobe_blacklist_entry, list); + void *start = (void *)ent->start_addr, *end = (void *)ent->end_addr; - seq_printf(m, "0x%p-0x%p\t%ps\n", (void *)ent->start_addr, - (void *)ent->end_addr, (void *)ent->start_addr); + /* + * As long as kallsyms shows the address, kprobes blacklist also + * show it, Or, it shows null address and symbol. + */ + if (!kallsyms_show_value()) + start = end = NULL; + + seq_printf(m, "0x%px-0x%px\t%ps\n", start, end, + (void *)ent->start_addr); return 0; }