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]
Message-ID: <ZzYv7SznkX34Wulr@pathway.suse.cz>
Date: Thu, 14 Nov 2024 18:14:21 +0100
From: Petr Mladek <pmladek@...e.com>
To: Chris Down <chris@...isdown.name>
Cc: linux-kernel@...r.kernel.org,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Sergey Senozhatsky <senozhatsky@...omium.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	John Ogness <john.ogness@...utronix.de>,
	Geert Uytterhoeven <geert@...ux-m68k.org>,
	Tony Lindgren <tony.lindgren@...ux.intel.com>, kernel-team@...com
Subject: syslog warning: was: Re: [PATCH v6 04/11] printk: Support toggling
 per-console loglevel via syslog() and cmdline

On Mon 2024-10-28 16:45:40, Chris Down wrote:
> A new module parameter (ignore_per_console_loglevel) is added, which can
> be set via the kernel command line or at runtime through
> /sys/module/printk/parameters/ignore_per_console_loglevel. When set, the
> per-console loglevels are ignored, and the global console loglevel
> (console_loglevel) is used for all consoles.
> 
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -1836,19 +1862,28 @@ int do_syslog(int type, char __user *buf, int len, int source)
>  		break;
>  	/* Disable logging to console */
>  	case SYSLOG_ACTION_CONSOLE_OFF:
> -		if (saved_console_loglevel == LOGLEVEL_DEFAULT)
> +		if (saved_console_loglevel == LOGLEVEL_DEFAULT) {
>  			saved_console_loglevel = console_loglevel;
> +			saved_ignore_per_console_loglevel =
> +				ignore_per_console_loglevel;
> +		}
>  		console_loglevel = minimum_console_loglevel;
> +		ignore_per_console_loglevel = true;
>  		break;
>  	/* Enable logging to console */
>  	case SYSLOG_ACTION_CONSOLE_ON:
>  		if (saved_console_loglevel != LOGLEVEL_DEFAULT) {
>  			console_loglevel = saved_console_loglevel;
> +			ignore_per_console_loglevel =
> +				saved_ignore_per_console_loglevel;
>  			saved_console_loglevel = LOGLEVEL_DEFAULT;
>  		}
>  		break;
>  	/* Set level of messages printed to console */
>  	case SYSLOG_ACTION_CONSOLE_LEVEL:
> +		if (!ignore_per_console_loglevel)
> +			pr_warn_once(
> +				"SYSLOG_ACTION_CONSOLE_LEVEL is ignored by consoles with an explicitly set per-console loglevel, see Documentation/admin-guide/per-console-loglevel.rst\n");

I see this warning during every boot because rsyslogd() modifies the
global loglevel.

I am afraid that admins might not like it. I might live in dreams but
I guess that everyone would like to reach a clean boot without any
warning.

One the other hand, we should warn when it does not work as expected.

A compromise would be to warn only when there is a console with
the console specific loglevel set.

I am not sure if we have already discussed this in the past.
But I would prefer the compromise after all.

What do you think, please?

Best Regards,
Petr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ