[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <09c70d6b-c989-ca23-7ee8-b404bb0490f0@suse.cz>
Date: Tue, 26 Jan 2021 17:47:33 +0100
From: Vlastimil Babka <vbabka@...e.cz>
To: Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Matthew Wilcox <willy@...radead.org>
Cc: Timur Tabi <timur@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
Petr Mladek <pmladek@...e.com>, roman.fietze@...na.com,
keescook@...omium.org, Steven Rostedt <rostedt@...dmis.org>,
John Ogness <john.ogness@...utronix.de>, linux-mm@...ck.org,
Akinobu Mita <akinobu.mita@...il.com>
Subject: Re: [PATCH 0/2] introduce DUMP_PREFIX_UNHASHED for hex dumps
On 1/19/21 11:38 AM, Sergey Senozhatsky wrote:
> On (21/01/19 01:47), Matthew Wilcox wrote:
> [..]
>>
>> > 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.
>
> Oh, I see.
>
>> 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.
>
> I like the name. config dependent behaviour of %p wouldn't be new,
> well, to some extent, e.g. XFS does something similar (see below).
> I don't think Linus will be sold on this, however.
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 would be too
much, even if limited to !kernel_lockdown :) , that would disable all hashing?
It would be really useful for a development/active debugging, as evidenced
below. Thanks.
> fs/xfs/xfs_linux.h:
>
> /*
> * Starting in Linux 4.15, the %p (raw pointer value) printk modifier
> * prints a hashed version of the pointer to avoid leaking kernel
> * pointers into dmesg. If we're trying to debug the kernel we want the
> * raw values, so override this behavior as best we can.
> */
> #ifdef DEBUG
> # define PTR_FMT "%px"
> #else
> # define PTR_FMT "%p"
> #endif
>
> And then they just use it as
>
> xfs_alert(mp, "%s: bad inode magic number, dip = "ptr_fmt",
> dino bp = "ptr_fmt", ino = %ld",
> __func__, dip, bp, in_f->ilf_ino);
>
> -ss
>
Powered by blists - more mailing lists