Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1225185pxb; Wed, 10 Feb 2021 03:22:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJwVU5s0Br/UyM8bcdkjbrz5lbcI00t7wgzZdoGJj9eZCwwL6rlY1VJ9kxWWGWYugQMtkgME X-Received: by 2002:a17:906:7e42:: with SMTP id z2mr2420158ejr.177.1612956129388; Wed, 10 Feb 2021 03:22:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612956129; cv=none; d=google.com; s=arc-20160816; b=V3jONFrCIJ6n0ild1BeEep2CbTxwtKzKpDJjn/nVibEby+6CeA7HWAjYSfmtFiGpOS XLEVOi10P1yBxEvAVCo+plseuKTS100Tv3fEJOnkKRQhsJuXzDZ0Xg3E3xLVaV3twfKK P7l0JwvVlsdfv3QCUPpcA7ITekb+D+im0XiaUOngptpIJK41v5rwz8kh5/9iXIFRC2uc kguteguLA6EUh/9mVZakfKWo3ke/CQ6IFGVKclFCHTDidH1FT3/aK4f3UAQFxcng6bPm PaqcRDD9NuBOq/vQ2gBM2LyRnV7EzK2i6f3w4qZef4oRlll1v3gumI6bKcpGjLp0WDIu t7Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=+4PQbDkgN9ma23iEvdVJptQ3V05007RBQo09oRIADY0=; b=y4Uv8diawTYN+KM9IyJ51D8X0WEV0jS22oynVjVu7AqlhKSakVn7CU08MQS7Ub061g VDwvh8A0DosiNBXVCfCU3cg0NqJ8EdfR+9JiQjx/gKez8q9eKyQtXWVgPMjjgFXNgR5/ HcS4tlhyz+wcC5dsuhJJ0LX39Wx62PkwZ544nMSM/IJO/Uget89EtZZmndVJDPr3vJcK Sxu1QvkRIzESCmlDXEoh4jodQSVW9rmJvB20pygdzZSbWXSptOsOz4MFPwAuw5kER2Dz R6c1Jt2cSzN4ikdM8C5nhAf0RZdT16k3F+MuUGA7ap9mbOLSLJFcvADg1bl7psWM5t3F xDvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=cAGrzzuD; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n12si1073409eja.210.2021.02.10.03.21.46; Wed, 10 Feb 2021 03:22:09 -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=@google.com header.s=20161025 header.b=cAGrzzuD; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230473AbhBJLSm (ORCPT + 99 others); Wed, 10 Feb 2021 06:18:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229650AbhBJLMU (ORCPT ); Wed, 10 Feb 2021 06:12:20 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A14F4C0613D6 for ; Wed, 10 Feb 2021 03:11:39 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id r21so1985794wrr.9 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=enqnzRyPu2Y7xu1NicgKRLAEGscwVOyIgslv1Or5ip8HAt5CZJkew5O7H8lCpwsGYX 2hK/WK48xw26vduHudWhuzBjZWczOEVQ4zwg1FyqvB1aU3LIwPSDnwPTUoQGv+lUGgn+ tAqVmBgoJXRRgWO25LNtVHNf6R08VHsZv5wZG3FJeS9osOYx2LlFfrpupIsAXBB8Ql9g Rq+BoJLRg0YvsU3uKUp+xazlOh/GxvIE283Svio8T6kX4BYxT0KnVzRBCbSHLotqZIcX IW2RNC0hWHVGgQgFRJj638th0KfCMnyS/RYrsaM2/GBoDnqQoZ7f1HWYHJRYZX7eiAwI VYWQ== X-Gm-Message-State: AOAM531zkaXFhBj3pgCQQL9IAC3Gk1KQfVEqCubfBsZ2e/fYDvdu7zHN WFY1XElgj/422LtNG3772n86sA== 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 Content-Transfer-Encoding: 8bit In-Reply-To: <20210210051814.845713-1-timur@kernel.org> User-Agent: Mutt/2.0.2 (2020-11-20) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 09, 2021 at 11:18PM -0600, Timur Tabi wrote: > [accidentally sent from the wrong email address, so resending] > > [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(). > > 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 > > .../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 ‘test_bitmap_init’: | lib/../tools/testing/selftests/kselftest_module.h:45:48: error: ‘skipped_tests’ undeclared (first use in this function); did you mean ‘failed_tests’? | 45 | return kstm_report(total_tests, failed_tests, skipped_tests); \ | | ^~~~~~~~~~~~~ | lib/test_bitmap.c:637:1: note: in expansion of macro ‘KSTM_MODULE_LOADERS’ | 637 | KSTM_MODULE_LOADERS(test_bitmap); | | ^~~~~~~~~~~~~~~~~~~ | lib/../tools/testing/selftests/kselftest_module.h:45:48: note: each undeclared 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 ‘KSTM_MODULE_LOADERS’ | 637 | KSTM_MODULE_LOADERS(test_bitmap); | | ^~~~~~~~~~~~~~~~~~~ | lib/../tools/testing/selftests/kselftest_module.h:46:1: error: control reaches end of non-void function [-Werror=return-type] | 46 | } \ | | ^ | lib/test_bitmap.c:637:1: note: in expansion of macro ‘KSTM_MODULE_LOADERS’ | 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. Thanks, -- Marco