From mboxrd@z Thu Jan 1 00:00:00 1970 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=-15.1 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 BB78AC433E0 for ; Wed, 10 Feb 2021 11:11:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 53FC964E32 for ; Wed, 10 Feb 2021 11:11:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 53FC964E32 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A023C6B0006; Wed, 10 Feb 2021 06:11:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 98B686B006C; Wed, 10 Feb 2021 06:11:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 82AA06B006E; Wed, 10 Feb 2021 06:11:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0084.hostedemail.com [216.40.44.84]) by kanga.kvack.org (Postfix) with ESMTP id 680C56B0006 for ; Wed, 10 Feb 2021 06:11:40 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 37DFA1800104F for ; Wed, 10 Feb 2021 11:11:40 +0000 (UTC) X-FDA: 77802092760.12.ant23_3e119b02760f Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id 1B7C6180548F3 for ; Wed, 10 Feb 2021 11:11:40 +0000 (UTC) X-HE-Tag: ant23_3e119b02760f X-Filterd-Recvd-Size: 6908 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Wed, 10 Feb 2021 11:11:39 +0000 (UTC) Received: by mail-wr1-f43.google.com with SMTP id l12so2036160wry.2 for ; Wed, 10 Feb 2021 03:11:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=+4PQbDkgN9ma23iEvdVJptQ3V05007RBQo09oRIADY0=; b=cAGrzzuDpMyMx9zeHVxV8zzXndWSOBxcAiA8Q2fzJpvwbWPzBwJX+Ks5FoY/wEcAMb U5yVawsoLPVK/aIKDXL5HcywijuYJML4X3/NcMTGsA5oKoAXaejqn5hKaBZNn78r4qm9 zsip4sZMqdAt1JNkr4CDubIDtTF/6J/27d8O0TbEOqrcxmzBbFgtsmGuIFnyJy5MBCPW KH/voTqThO5o3pbw8VXfgxDN6y4S7lcDrDizA8uLaf+m1JSprazI3dMmAr/7zltJiUYy 1oRem3Gc2w9HZ6TXk3Ug5lgQ4Sdqzb1LMFTEO+YShKgs975lrU4SeZ2GVpdLG3OLvwyb Cazw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=+4PQbDkgN9ma23iEvdVJptQ3V05007RBQo09oRIADY0=; b=QHM//OID3UZNZ1z2hJ/3KpW8T0yjX9qoLO64x+KXiCJK1DA0cfzpIAlp38aR00cgpJ 0KJuW1ZctcU1Yh2pIHFA8pousAVK4OYSKkfZNZ8BcAvAvXDcVx59c1hLuV6wcRFt5qtz tR15l51l9RXdKAW2YHdgQzee9aj5t6i4WB0t1tZGfPuJg/S7KSzhP3Y0JXcmf44JsrRc ILnfSmynbk0QRlEjjkiFCOBNffZjrGlAwQ5s1wsyMRPCoOVrQwbDVtpMTWDcZI/zeoPC LdwCU22qX4f90hwDvFMhDQpVqDGSp05MIYm5Z84cdi4dr1xevkLe0FBmm9ZCetGnJXVP 4T/w== X-Gm-Message-State: AOAM5319YuDxwlnboFrVJMlzjbRfoYXs2sZ+s2PgDpTRIHnPjWH7/lOz csXI9uTRbMkg9eFMxEpOzBoGMw== X-Google-Smtp-Source: ABdhPJylZFyEw0m+WWAQyCxMXaWhtWJF3P157jdX/UsfgWQDUHkMuezWf4uQ7pspK79rtEJEKtL+rQ== X-Received: by 2002:adf:f647:: with SMTP id x7mr2941035wrp.160.1612955498200; Wed, 10 Feb 2021 03:11:38 -0800 (PST) Received: from elver.google.com ([2a00:79e0:15:13:a559:3455:b3db:9311]) by smtp.gmail.com with ESMTPSA id t15sm1889365wmi.48.2021.02.10.03.11.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Feb 2021 03:11:37 -0800 (PST) Date: Wed, 10 Feb 2021 12:11:31 +0100 From: Marco Elver To: Timur Tabi Cc: 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 , Rasmus Villemoes , Pavel Machek , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 0/3][RESEND] add support for never printing hashed addresses Message-ID: References: <20210210051814.845713-1-timur@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210210051814.845713-1-timur@kernel.org> User-Agent: Mutt/2.0.2 (2020-11-20) Content-Transfer-Encoding: quoted-printable 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: On Tue, Feb 09, 2021 at 11:18PM -0600, Timur Tabi wrote: > [accidentally sent from the wrong email address, so resending] >=20 > [The list of email addresses on CC: is getting quite lengthy, > so I hope I've included everyone.] >=20 > 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. >=20 > 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. >=20 > 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. >=20 > Patch #2 upgrades the printf library to check the command > line. It also updates test_printf(). >=20 > Timur Tabi (3): > lib/test_printf: use KSTM_MODULE_GLOBALS macro > kselftest: add support for skipped tests > [v2] lib/vsprintf: make-printk-non-secret printks all addresses as > unhashed >=20 > .../admin-guide/kernel-parameters.txt | 15 +++++++ > lib/test_printf.c | 12 +++++- > lib/vsprintf.c | 40 ++++++++++++++++++- > tools/testing/selftests/kselftest_module.h | 18 ++++++--- > 4 files changed, 75 insertions(+), 10 deletions(-) I wanted to test this for deciding if we can show sensitive info in KFENCE reports, which works just fine now that debug_never_hash_pointers is non-static. FWIW, Acked-by: Marco Elver But unfortunately this series broke some other test: | In file included from lib/test_bitmap.c:17: | lib/test_bitmap.c: In function =E2=80=98test_bitmap_init=E2=80=99: | lib/../tools/testing/selftests/kselftest_module.h:45:48: error: =E2=80=98= skipped_tests=E2=80=99 undeclared (first use in this function); did you m= ean =E2=80=98failed_tests=E2=80=99? | 45 | return kstm_report(total_tests, failed_tests, skipped_tests); = \ | | ^~~~~~~~~~~~~ | lib/test_bitmap.c:637:1: note: in expansion of macro =E2=80=98KSTM_MODU= LE_LOADERS=E2=80=99 | 637 | KSTM_MODULE_LOADERS(test_bitmap); | | ^~~~~~~~~~~~~~~~~~~ | lib/../tools/testing/selftests/kselftest_module.h:45:48: note: each und= eclared identifier is reported only once for each function it appears in | 45 | return kstm_report(total_tests, failed_tests, skipped_tests); = \ | | ^~~~~~~~~~~~~ | lib/test_bitmap.c:637:1: note: in expansion of macro =E2=80=98KSTM_MODU= LE_LOADERS=E2=80=99 | 637 | KSTM_MODULE_LOADERS(test_bitmap); | | ^~~~~~~~~~~~~~~~~~~ | lib/../tools/testing/selftests/kselftest_module.h:46:1: error: control = reaches end of non-void function [-Werror=3Dreturn-type] | 46 | } \ | | ^ | lib/test_bitmap.c:637:1: note: in expansion of macro =E2=80=98KSTM_MODU= LE_LOADERS=E2=80=99 | 637 | KSTM_MODULE_LOADERS(test_bitmap); | | ^~~~~~~~~~~~~~~~~~~ My allyesconfig build suggests test_bitmap.c is the only one, so it should probably be fixed up in this series. =20 Thanks, -- Marco