lkml.org 
[lkml]   [2021]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/3] lib/vsprintf: make-printk-non-secret printks all addresses as unhashed
From
Date


On 2/10/21 7:41 AM, Petr Mladek wrote:
>
> The option causes that vsprintf() will not hash pointers. Yes, it is
> primary used by printk(). But it is used also in some other
> interfaces, especially trace_printk(), seq_buf() API. The naked
> pointers might appear more or less anywhere, including procfs,
> sysfs, debugfs.

Fair point. Shouldn't calls to seq_buf_printf() (and any printk usage
that always exists in the context of a user-space process) use %pK anyway?

Hmmm.... maybe vsprintf() should automatically replace %p with %pK if it
detects a user-space context?

> IMHO, we should fix this. The long discussion was about how to make
> this option safe. Users should be aware that it is not only about
> the kernel log.

Agreed.

> I suggest to rename the parameter "debug_never_hash_pointer" and use
> the same name for the parameter and the variable.

Will do.

> We also should make the warning more generic. I suggest to replace the
> first paragraph with something like:
>
> pr_warn("** The hashing of printed pointers has been disabled **\n");
> pr_warn("** for debugging purposes. **\n");
>
> Feel free to use a better wording. I am not a native speaker.

You could have fooled me.

> Of course, also kernel-parameters.txt has to be updated accordingly.

Ok.

\
 
 \ /
  Last update: 2021-02-10 18:30    [W:0.111 / U:0.976 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site