Re: [PATCH][RESEND] lib/vsprintf: make-printk-non-secret printks all addresses as unhashed

From: Steven Rostedt
Date: Wed Feb 03 2021 - 17:39:12 EST


On Wed, 3 Feb 2021 15:56:20 -0600
Timur Tabi <timur@xxxxxxxxxx> 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