lkml.org 
[lkml]   [2021]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][RESEND] lib/vsprintf: make-printk-non-secret printks all addresses as unhashed
On Wed, 3 Feb 2021 15:56:20 -0600
Timur Tabi <timur@kernel.org> wrote:

> On 2/3/21 2:47 PM, Steven Rostedt wrote:
> > static void __init
> > plain(void)
> > {
> > int err;
> >
> > + if (debug_never_hash_pointers)
> > + return;
>
> So, I have a stupid question. What's the best way for test_printf.c to
> read the command line parameter? Should I just do this in vsprintf.c:
>
> /* Disable pointer hashing if requested */
> static bool debug_never_hash_pointers __ro_after_init;

It wont be static.

> EXPORT_SYMBOL_GPL(debug_never_hash_pointers);
>
> I'm not crazy about exporting this variable to other drivers. It could
> be used to disable hashing by any driver.

But it is set as "__ro_after_init". That is, every module will see it as
read only. IOW, they wont be able to modify it.

>
> AFAIK, the only command-line parameter code that works in drivers is
> module_parm, and that expects the module prefix on the command-line.

This is just a constant variable for others to see. The command line itself
is visible (see saved_command_line, it's even exported to modules in sparc).


-- Steve

\
 
 \ /
  Last update: 2021-02-03 23:40    [W:0.382 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site