Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4375613pxb; Sun, 14 Feb 2021 08:15:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJwaMI9EC5qFplFmOfjyzQRnJmqtLcRKkc4nHADydzqIYuurTd+LhsgUlqldJ47jM7SRpsHR X-Received: by 2002:a50:fe86:: with SMTP id d6mr12037809edt.80.1613319325659; Sun, 14 Feb 2021 08:15:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613319325; cv=none; d=google.com; s=arc-20160816; b=eThHt4z/4It6indxX5iAq6HN57d3MPYLkM2gzOALx/NlcbpM2Oke0IyGuOpoZgjOsL hLopDXHNunseTpq59ahKGYbDVbMf9GF7EG5WFFWyOExQ/CADzOhNyZfsH2XqFn6PWVMj VERl9Tsb0r3Vzk3KDIJhEin4vtGf0/GflRfR20Pqly2pidxnUCuLZ+gGlaRmFdSKWAeL kncJp6u+hdh2GHLT10I9/m1k3NVDWqykiafEVRuBG9i1BHYMyD8hlwLszLbBPWlp8jfr eWigHALMlqnrVFiBl5T1JqTCBRpdVWNwur5e4q5WeTjbuMsS3OA4rm7G3B3cg5f1dUuU qAqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=sR+HDLR9VzGJq5ogk2NXf/cWL6MnMbRd2B/kf5P5cKI=; b=yFaZJyEolSB8Zmfmj3U7tOqGvyMDcf3ZFrbP57WDjcFYmVi51CuCwrt+Pbj4td8K4z /dTOZdMpTKDWEVM5Lzs5sNybpFB7TnMyfS52i5zK8o2HMDlBPkgA1+ofv2DTH+wPKrWg AEaVWNtXx8OQ0NvPHgqQIo16tTTVnm0KVw2Wbguo7poar3APsTZky2FTPZAeJ0ZVw2oj tO9lH2GPPU2X36QJfuYZ1yPfqUl5ZSox6NsMPj/ZR49dc2eZW1JHiBzFiP48YNy47ybm ahg/orpkTP5+/pw7EylSCKMX2j1PLYV3svJr0fTSOEjwsKGodY5JQ4P//wIVqgNG7qoV TKMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O00k2kQ0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ha21si12351629ejb.180.2021.02.14.08.15.01; Sun, 14 Feb 2021 08:15:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O00k2kQ0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229730AbhBNQOe (ORCPT + 99 others); Sun, 14 Feb 2021 11:14:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:38902 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229576AbhBNQOd (ORCPT ); Sun, 14 Feb 2021 11:14:33 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 333E264DAD; Sun, 14 Feb 2021 16:13:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613319232; bh=oHf15gSHKcdfrEuxcuEmshOdx1i9DIeGN5nSxvWb/No=; h=From:To:Subject:Date:From; b=O00k2kQ07nI0dSl2MUzumJwYSH1LWk6XWq2zYi1z1zxrGtqBxnLrwv0udEZb5j/Br xgezU5+xgLN5qGdt9t3IIM8LKMtDC8RNqbJd3Zp/ADvGfYnaZ9DAKG6mBUn+QaNFzB fFF5cHZ+6XRRt97tswNUL6njcYd283UQgEUiJKfdK9fbo5Md8rwDdWpcl2hTScAY9a 0o9rZEnVY63o3OTraf33OKNLxNm4MKVIA1/3iNm3PCqnvrCbntdVCiaqGuG9elHGr8 iduzTsrlfo9/nrbsaXuDnUu8Tkj5gSYo4a/jsV/WVqLRD+ML2wQx9Ab/YnF87eTB7t gWMJ18zYRaraA== 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][v4] add support for never printing hashed addresses Date: Sun, 14 Feb 2021 10:13:45 -0600 Message-Id: <20210214161348.369023-1-timur@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(). Timur Tabi (3): [v4] lib: use KSTM_MODULE_GLOBALS macro in kselftest drivers [v4] kselftest: add support for skipped tests [v4] 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(-) -- 2.25.1