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=-6.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 5C36EC433DB for ; Wed, 3 Feb 2021 20:35:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CA92764F58 for ; Wed, 3 Feb 2021 20:35:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA92764F58 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2C4396B0005; Wed, 3 Feb 2021 15:35:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2753E6B006C; Wed, 3 Feb 2021 15:35:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 16C6E6B006E; Wed, 3 Feb 2021 15:35:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0205.hostedemail.com [216.40.44.205]) by kanga.kvack.org (Postfix) with ESMTP id F3DFB6B0005 for ; Wed, 3 Feb 2021 15:35:11 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id A16341EE6 for ; Wed, 3 Feb 2021 20:35:11 +0000 (UTC) X-FDA: 77778111222.20.cover16_2e163cc275d6 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id 665C0180C07AB for ; Wed, 3 Feb 2021 20:35:11 +0000 (UTC) X-HE-Tag: cover16_2e163cc275d6 X-Filterd-Recvd-Size: 4770 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Wed, 3 Feb 2021 20:35:10 +0000 (UTC) Received: by mail-pf1-f181.google.com with SMTP id i63so579256pfg.7 for ; Wed, 03 Feb 2021 12:35:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ctpZix2vdpsWlT58CTksomBebLVeiR0jpEeIeen1iD4=; b=R+iJ2/PVt8eXXtNb0UBgNjBP3+Ne7x/JiSY+KQ/U0xq8U7bdSk9jxNoz10LRy/yK1N 6qXw5MZn5Zsso4+1uPJzvjCXAack+UHQ3H66wH4hmCOCXVTM8zlwiH5i9KQgKxGpHF5y AE5VKH3s+FuYVSovVvsXwXsHGgLNGxO+gb9xA= 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:in-reply-to; bh=ctpZix2vdpsWlT58CTksomBebLVeiR0jpEeIeen1iD4=; b=Y37S6eFUvEMjNYzvDInSLBGAJSDRX8KllmJD0SHL2BnbUwaIGZBPF94NxyjF/oW5ae AiCCqutl2XJ9mGBjbxibjm4ZOaH2Rn3MAE2klQ7BywmUv3e9fwE7jVAJUmQstVALw9v3 4Wttuf9D288EKZhVAyx+fC6EGGWPvKbblMDblJgvBGc/PV1qyloJNdV4Xa4pZn08mqBE CMOTjd9lPO5xllABr9JRK3x2kGM3W2mQGVVgGzbnyI1QMoMWmTSZzze5V7mbrzVmezKL 9PEUx7dGYa1oW8uKteFIkZ/UjW45Uu85NxL+7Gdl14pM3Cyr+kksk1/dtvK1ZZy60E5w vniQ== X-Gm-Message-State: AOAM531POhAvDykfToowP/7smquYC/O776FkiWiG8mNsFHY3d5tBY2RN ttk7F56VzXAfcfNSYfKPWXgP7A== X-Google-Smtp-Source: ABdhPJwXUA/dXsJaA9jxmgNGitJw3u7SCmOQCBw4IiJAy6ZehY0vVxUrfwPVtq4pl873LCWPMm3J0g== X-Received: by 2002:aa7:904c:0:b029:1c9:c2ed:b229 with SMTP id n12-20020aa7904c0000b02901c9c2edb229mr4806193pfo.11.1612384509887; Wed, 03 Feb 2021 12:35:09 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id 34sm3968558pgn.56.2021.02.03.12.35.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 12:35:08 -0800 (PST) Date: Wed, 3 Feb 2021 12:35:07 -0800 From: Kees Cook To: Steven Rostedt Cc: Timur Tabi , Petr Mladek , Sergey Senozhatsky , linux-kernel@vger.kernel.org, vbabka@suse.cz, linux-mm@kvack.org, willy@infradead.org, akpm@linux-foundation.org, torvalds@linux-foundation.org, roman.fietze@magna.com, john.ogness@linutronix.de, Andy Shevchenko , Rasmus Villemoes , akinobu.mita@gmail.com Subject: Re: [PATCH][RESEND] lib/vsprintf: make-printk-non-secret printks all addresses as unhashed Message-ID: <202102031234.9BF349F@keescook> References: <20210202213633.755469-1-timur@kernel.org> <19c1c17e-d0b3-326e-97ec-a4ec1ebee749@kernel.org> <202102031201.FFED9547D@keescook> <20210203152513.34492916@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210203152513.34492916@gandalf.local.home> 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 Wed, Feb 03, 2021 at 03:25:13PM -0500, Steven Rostedt wrote: > On Wed, 3 Feb 2021 12:02:05 -0800 > Kees Cook wrote: > > > On Wed, Feb 03, 2021 at 12:58:41PM -0600, Timur Tabi wrote: > > > On 2/3/21 7:31 AM, Petr Mladek wrote: > > > > Also please make sure that lib/test_printf.c will work with > > > > the new option. > > > > > > As you suspected, it doesn't work: > > > > > > [ 206.966478] test_printf: loaded. > > > [ 206.966528] test_printf: plain 'p' does not appear to be hashed > > > [ 206.966740] test_printf: failed 1 out of 388 tests > > > > > > What should I do about this? > > > > > > On one hand, it is working as expected: %p is not hashed, and that should be > > > a warning. > > > > > > On the other hand, maybe test_printf should be aware of the command line > > > parameter and test to make sure that %p is NOT hashed? > > > > It seems like it'd be best for the test to fail, yes? It _is_ a problem > > that %p is unhashed; it's just that the failure was intended. > > > > I disagree. > > With a big notice that all pointers of unhashed, I don't think we need to > print it failed when we expect it to fail. > > If anything, skip the test and state: > > test_printf: hash test skipped because "make-printk-non-secret" is on the > command line. Yeah, I'm fine with "fail" or "skip". "pass" is mainly what I don't like. :) -- Kees Cook