Received: by 10.223.176.46 with SMTP id f43csp1675436wra; Wed, 24 Jan 2018 21:29:06 -0800 (PST) X-Google-Smtp-Source: AH8x2253rKlhCBuTZaHOlDMA6bGg8CD342820KFPDP5Qutr1yvmai0w/7T4KqdLYWhNkgsZmpbgi X-Received: by 2002:a17:902:f:: with SMTP id 15-v6mr10211743pla.419.1516858146753; 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=iYDCwmUfqD/wlDXjVCYwwbJWyDg6u4DQTnN/jpGsuaz+41gbRV/3pGUpITwezOadGJ 003qopTA+1MCsk8n+U1YpLinu+79X0nsQyXCAHRlDrZkuXkL/E7Z4JF2BhTAgyv7OcBP FOPRuZwyse/j9PPUNWavafIMQ0qv4b9m9DHllVCp9YQ+4paHaI2YVcFS5DZtvhuS7bKu IRrsmIuWLD2mvwR6Q/T5ZFZSGKPVHvs3vMOnHa0BsuSMDTEzFuYBhbfK1DvYLdeXcyyD MZ2Ic4yRL5etUXv88gz+s/FrkaV2Ja6T33LVa2J4b6QGDMONJrX1Qs1W5EYioynui4s7 6tJA== 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:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=xZHBTsfcP1AHNHrd6+U3YAsujSYZ2zHDRGpq8yyeflE=; b=0Y3nESaHiy5zw3dJ0js1dflmSSKsrgZ5bgWotKJX6Mw7ssYtQNGDz/oXN18AqK7LmX CNOzJs4Vuwkc2ZwIXbanoKYjBIcwoyZeDcxFy0aReP6SUPlWKOyiMWV51VUvX8pNIgpE gBmoc0kvVBfzUjcMaVcMI9biArs4dgcbZ2xkTlY8s3GDk/SOXf74SM7mJSe3k0WRZPUG kGkGUoCJI93VlBn90kQHPruITIlE1fbGk+hZMu/ECihIVSEPwid07RRsK0maC91uXEHw cw4nyfdOhL5hwKvjUg102N0B3PNtWOkN0r8993xdrgIE0B9ZDXQiFyGh7A3J64NGch+7 2CxQ== 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 t190si1105370pgb.190.2018.01.24.21.27.59; 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 S1750965AbeAYF07 (ORCPT + 99 others); Thu, 25 Jan 2018 00:26:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:41608 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750734AbeAYF06 (ORCPT ); Thu, 25 Jan 2018 00:26:58 -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 85E9D20856; Thu, 25 Jan 2018 05:26:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 85E9D20856 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 0/8] kprobes: Fix %p in kprobes Date: Thu, 25 Jan 2018 14:26:31 +0900 Message-Id: <151685799071.3099.10383062804474021403.stgit@devbox> X-Mailer: git-send-email 2.13.6 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 Hi, This series fixes %p uses in kprobes. Some by replacing with %pS, some by replacing with %px but masking with kallsyms_show_value(). I've read the thread about %pK and if I understand correctly we shouldn't print kernel addresses. However, kprobes debugfs interface can not stop to show the actual probe address because it should be compared with addresses in kallsyms for debugging. So, it depends on that kallsyms_show_value() allows to show address to user, because if it returns true, anyway that user can dump /proc/kallsyms. Other error messages are replaced it with %pS, and one critical function uses %px which is called right before BUG(). Also, I tried to fix this issue on each arch port. I searched it by # find arch/* | grep -e 'kprobe.*c' | xargs grep -w %p And fixed all %p uses in those files. Thank you, --- Masami Hiramatsu (8): kprobes: Show blacklist addresses as same as kallsyms does kprobes: Show address of kprobes if kallsyms does kprobes: Replace %p with other pointer types kprobes/x86: Fix %p uses in error messages kprobes/arm: Fix %p uses in error messages kprobes/arm64: Fix %p uses in error messages kprobes/MN10300: Fix %p uses in error messages kprobes/s390: Fix %p uses in error messages arch/arm/probes/kprobes/core.c | 10 ++++---- arch/arm/probes/kprobes/test-core.c | 1 - arch/arm64/kernel/probes/kprobes.c | 4 ++- arch/mn10300/kernel/kprobes.c | 6 +++-- arch/s390/kernel/kprobes.c | 2 +- arch/x86/kernel/kprobes/core.c | 12 +++------- kernel/kprobes.c | 42 ++++++++++++++++++++++------------- 7 files changed, 41 insertions(+), 36 deletions(-) -- Masami Hiramatsu (Linaro)