lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 23 Oct 2020 11:46:13 +0200
From:   Petr Mladek <pmladek@...e.com>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        John Ogness <john.ogness@...utronix.de>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Guenter Roeck <linux@...ck-us.net>,
        Shreyas Joshi <shreyas.joshi@...mp.com>,
        shreyasjoshi15@...il.com,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [RFC 1/2] printk: Add kernel parameter: mute_console

On Thu 2020-10-22 09:45:12, Steven Rostedt wrote:
> On Thu, 22 Oct 2020 13:42:27 +0200
> Petr Mladek <pmladek@...e.com> wrote:
> 
> > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> > index fe64a49344bf..63fb96630767 100644
> > --- a/kernel/printk/printk.c
> > +++ b/kernel/printk/printk.c
> > @@ -1207,6 +1207,19 @@ void __init setup_log_buf(int early)
> >  	memblock_free(__pa(new_log_buf), new_log_buf_len);
> >  }
> >  
> > +static bool mute_console;
> > +
> > +static int __init mute_console_setup(char *str)
> > +{
> > +	mute_console = true;
> > +	pr_info("All consoles muted.\n");
> > +
> > +	return 0;
> > +}
> > +
> > +early_param("mute_console", mute_console_setup);
> > +module_param(mute_console, bool, 0644);
> > +
> 
> Why have both early_param and module_param? What's the purpose of
> module_param? Usually that's there to just set a variable, without a need
> for another interface. But if you have early_param() that sets
> mute_console, isn't that redundant?

I was surprised as well. But both seem to be needed:

   + early_param allows to enable it on the command line.
     Note that module_param would need to be set via
     printk.mute_console

   + module_param() allows to modify the state at runtime

IMHO, both should be possible. It is supposed to be used similar
way like ignore_loglevel.

Best Regards,
Petr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ