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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 2FFAAC433DB for ; Tue, 19 Jan 2021 01:49:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E765E20643 for ; Tue, 19 Jan 2021 01:49:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392571AbhASBsv (ORCPT ); Mon, 18 Jan 2021 20:48:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727788AbhASBss (ORCPT ); Mon, 18 Jan 2021 20:48:48 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA5EEC061573 for ; Mon, 18 Jan 2021 17:48:07 -0800 (PST) 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.