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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 95E47C433E0 for ; Tue, 19 Jan 2021 01:48:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DC2B020773 for ; Tue, 19 Jan 2021 01:48:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC2B020773 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 197A26B0277; Mon, 18 Jan 2021 20:48:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 121A46B0278; Mon, 18 Jan 2021 20:48:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 018B26B0279; Mon, 18 Jan 2021 20:48:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0059.hostedemail.com [216.40.44.59]) by kanga.kvack.org (Postfix) with ESMTP id DBC9D6B0277 for ; Mon, 18 Jan 2021 20:48:23 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 975BB181AF5C7 for ; Tue, 19 Jan 2021 01:48:23 +0000 (UTC) X-FDA: 77720839686.15.bikes02_5512d092754e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id 776FD1814B0F3 for ; Tue, 19 Jan 2021 01:48:23 +0000 (UTC) X-HE-Tag: bikes02_5512d092754e X-Filterd-Recvd-Size: 3517 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Tue, 19 Jan 2021 01:48:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=BLuACzj/hxlsdh8jmjBAmpxbJLlwSm10yHZoCOzYH4Y=; b=gEj1IYRa3NsonURFIRgd2StEg8 8p4oaSLFOswN8bjnemVQhFRC3BwX0oBab/SCthJUm7lExQXT7kfQEiqasWpgCEQZ45GSezK8OV4+v E3kLsb17szO3nUrs7/YANNt2JfbbG2dVKpkxMfQPISJO/COfiQPhFLwKnS1SEKJAzqQayqH1Bx6XT 1DCyD9/9QXkBOztjDNpMFMvb22M/dnMHPNaYdZZYyk6m6aDhkVO40c1eCLSbvuiwZI0jEOzj1i9eM lDwxOI/DGcqIEKAgsSUG+dR+FIecS/GGLIH0TzNjBEiCyeuS5/otzbYHIk2bWw4yR14hRd8UMbFRE 0Vz23AnQ==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1l1g7B-00DeJl-T8; Tue, 19 Jan 2021 01:47:45 +0000 Date: Tue, 19 Jan 2021 01:47:25 +0000 From: Matthew Wilcox To: Sergey Senozhatsky Cc: Timur Tabi , Andrew Morton , linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, Petr Mladek , roman.fietze@magna.com, keescook@chromium.org, Steven Rostedt , John Ogness , linux-mm@kvack.org, Akinobu Mita Subject: Re: [PATCH 0/2] introduce DUMP_PREFIX_UNHASHED for hex dumps Message-ID: <20210119014725.GH2260413@casper.infradead.org> References: <20210116220950.47078-1-timur@kernel.org> <20210118182635.GD2260413@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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, Jan 19, 2021 at 09:53:01AM +0900, Sergey Senozhatsky wrote: > On (21/01/18 13:03), Timur Tabi wrote: > > On 1/18/21 12:26 PM, Matthew Wilcox wrote: > > > Don't make it easy. And don't make it look like they're doing > > > something innocent. DUMP_PREFIX_SECURITY_HOLE would be OK > > > by me. DUMP_PREFIX_LEAK_INFORMATION would work fine too. > > > DUMP_PREFIX_MAKE_ATTACKERS_LIFE_EASY might be a bit too far. > > > > It's already extremely easy to replace %p with %px in your own printks, so I > > don't really understand your argument. > > I like the idea of a more radical name, e.g. DUMP_PREFIX_RAW_POINTERS or > something similar. > > > Seriously, this patch should not be so contentious. If you want hashed > > addresses, then nothing changes. If you need unhashed addresses while > > debugging, then use DUMP_PREFIX_UNHASHED. Just like you can use %px in > > printk. I never use %p in my printks, but then I never submit code upstream > > that prints addresses, hashed or unhashed. I'm glad to hear you never make mistakes. I make lots of mistakes, so I prefer them to be big, loud and obvious so they're easy for people to spot. > So maybe DUMP_PREFIX_UNHASHED can do the unhashed dump only when > CONFIG_DEBUG_KERNEL=y and fallback to DUMP_PREFIX_ADDRESS otherwise? Distros enable CONFIG_DEBUG_KERNEL. If you want to add CONFIG_DEBUG_LEAK_ADDRESSES, then that's great, and you won't even have to change users, you can just change how %p behaves.