From patchwork Wed Feb 10 21:34:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timur Tabi X-Patchwork-Id: 12081809 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1C18C433E0 for ; Wed, 10 Feb 2021 21:35:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 37B2A64EDF for ; Wed, 10 Feb 2021 21:35:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 37B2A64EDF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 993B76B0005; Wed, 10 Feb 2021 16:35:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 944396B0006; Wed, 10 Feb 2021 16:35:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 859EE6B006C; Wed, 10 Feb 2021 16:35:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0019.hostedemail.com [216.40.44.19]) by kanga.kvack.org (Postfix) with ESMTP id 6DE876B0005 for ; Wed, 10 Feb 2021 16:35:08 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 3BDA316905 for ; Wed, 10 Feb 2021 21:35:08 +0000 (UTC) X-FDA: 77803663896.12.rice01_340d2c127613 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id 1D4E8182EB6EB for ; Wed, 10 Feb 2021 21:35:08 +0000 (UTC) X-HE-Tag: rice01_340d2c127613 X-Filterd-Recvd-Size: 3376 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Wed, 10 Feb 2021 21:35:07 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id AD3EB64E66; Wed, 10 Feb 2021 21:35:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612992906; bh=0CN0AXiGt7nS0p519elCd69YpBiDbXO8I+Tu+S7YevM=; h=From:To:Subject:Date:From; b=GY3Ey79AcOJsn6SXpnwj+p7UeBnWrMw4tW7uB4AfzKlO3ztuZoUCnadvMtyxZYJLS sJDlVXSg7r+H5vr0QYTBqF9XerUDznqFk2C8N0P6EjfqiA598Gb4x+3eY58B2sTXM9 ENa6icxWjUVBuXha3U8rxbjsdUZ286EXmZofloYm7LVZYzC8XfHCcR1Qw3e6r7ETzL cX3wa8lupzQSKpnZTy3icoYluGQQR1DsGxvXoRxqOtZ3ILPb3Z6lBrRHwnqUdp9fm+ p+rRgmz9rjly8IJ92gbXCljl4A0tQRSFG5/WE/ZOi1IoXPnLA+YlXWeKeeR5kTrzGl 9A5EpLLktcJ0w== From: Timur Tabi To: Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Vlastimil Babka , Andy Shevchenko , Matthew Wilcox , akpm@linux-foundation.org, Linus Torvalds , roman.fietze@magna.com, Kees Cook , John Ogness , akinobu.mita@gmail.com, glider@google.com, Andrey Konovalov , Marco Elver , Rasmus Villemoes , Pavel Machek , Tetsuo Handa , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 0/3][v3] add support for never printing hashed addresses Date: Wed, 10 Feb 2021 15:34:50 -0600 Message-Id: <20210210213453.1504219-1-timur@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: [The list of email addresses on CC: is getting quite lengthy, so I hope I've included everyone.] Although hashing addresses printed via printk does make the kernel more secure, it interferes with debugging, especially with some functions like print_hex_dump() which always uses hashed addresses. To avoid having to choose between %p and %px, it's easier to add a kernel command line that treats all %p as %px. This encourages developers to use %p more without making debugging more difficult. Patches #1 and #2 upgrade the kselftest framework so that it can report on tests that were skipped outright. This is needed for the test_printf module which will now skip %p hashing tests if hashing is disabled. Patch #2 upgrades the printf library to check the command line. It also updates test_printf(). Full series: Acked-by: Marco Elver Timur Tabi (3): [v3] lib: use KSTM_MODULE_GLOBALS macro in kselftest drivers [v3] kselftest: add support for skipped tests [v3] lib/vsprintf: debug_never_hash_pointers prints all addresses as unhashed .../admin-guide/kernel-parameters.txt | 15 ++++++++ lib/test_bitmap.c | 3 +- lib/test_printf.c | 12 +++++- lib/vsprintf.c | 38 ++++++++++++++++++- tools/testing/selftests/kselftest_module.h | 18 ++++++--- 5 files changed, 74 insertions(+), 12 deletions(-)