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.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 8FDA9C433E0 for ; Tue, 26 Jan 2021 17:14:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 00F46230FD for ; Tue, 26 Jan 2021 17:14:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 00F46230FD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6FCD18D00F7; Tue, 26 Jan 2021 12:14:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6AC2A8D00B0; Tue, 26 Jan 2021 12:14:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5C2188D00F7; Tue, 26 Jan 2021 12:14:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0020.hostedemail.com [216.40.44.20]) by kanga.kvack.org (Postfix) with ESMTP id 42DE28D00B0 for ; Tue, 26 Jan 2021 12:14:56 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id E83093635 for ; Tue, 26 Jan 2021 17:14:55 +0000 (UTC) X-FDA: 77748576150.09.stick12_3d0b94b27590 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin09.hostedemail.com (Postfix) with ESMTP id C9657180ACC35 for ; Tue, 26 Jan 2021 17:14:55 +0000 (UTC) X-HE-Tag: stick12_3d0b94b27590 X-Filterd-Recvd-Size: 3878 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Tue, 26 Jan 2021 17:14:53 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 64A15B913; Tue, 26 Jan 2021 17:14:52 +0000 (UTC) To: Timur Tabi , Sergey Senozhatsky , Matthew Wilcox Cc: 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 References: <20210116220950.47078-1-timur@kernel.org> <20210118182635.GD2260413@casper.infradead.org> <20210119014725.GH2260413@casper.infradead.org> <09c70d6b-c989-ca23-7ee8-b404bb0490f0@suse.cz> From: Vlastimil Babka Subject: Re: [PATCH 0/2] introduce DUMP_PREFIX_UNHASHED for hex dumps Message-ID: <083dd940-60c1-4cc8-fc89-8815b253d5c5@suse.cz> Date: Tue, 26 Jan 2021 18:14:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000006, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 1/26/21 5:59 PM, Timur Tabi wrote: > On 1/26/21 10:47 AM, Vlastimil Babka wrote: >> Given Linus' current stance later in this thread, could we revive the = idea of a >> boot time option, or at least a CONFIG (I assume a runtime toggle woul= d be too >> much, even if limited to !kernel_lockdown:)=C2=A0 , that would disable= all hashing? >> It would be really useful for a development/active debugging, as evide= nced >> below. Thanks. >=20 > So you're saying: >=20 > if CONFIG_PRINTK_NEVER_HASH is disabled, then %p prints hashed addresse= s and %px > prints unhashed. >=20 > If CONFIG_PRINTK_NEVER_HASH is enabled, then %p and %px both print unha= shed > addresses. Minimally, yes. KASLR is configurable like this, so why not printing of k= ernel pointers? > I like this idea, and I would accept it as a solution if I had to, but = I still > would also like for an option for print_hex_dump() to print unhashed ad= dresses > even when CONFIG_PRINTK_NEVER_HASH is disabled.=C2=A0 I can't always re= compile the > entire kernel for my testing purposes. Yeah, obviously a boot option would be nicer. The discussion Kees pointed= to [1] seemed to be about papering over problems with entropy? Not about making development/debugging easier. But I understand it was not the first time = and I didn't check the older ones. > The only drawback to this idea is: what happens if distros start enabli= ng > CONFIG_PRINTK_NEVER_HASH by default, just because it makes debugging ea= sier? There's tons of other options already where the choice is between securit= y and performance, and distros make their choice (including, again, KASLR itsel= f). Pointer hashing would be just another one. If it was a boot option, I would personally be for leaving hashing enable= d by default, with opt-in boot option to disable it. Then if I'm instructing a= user to boot the distro kernel (without recompile) with e.g. slub_debug or debug_pagealloc or page_owner in order to debug some issue, I would addit= ionally instruct them to add the 'no_pointer_hashing' parameter. [1] https://lore.kernel.org/lkml/CA+55aFwieC1-nAs+NFq9RTwaR8ef9hWa4MjNBWL41F-= 8wM49eA@mail.gmail.com/