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: <ZdjAUZiEDRCEROXk@alley>
Date: Fri, 23 Feb 2024 16:57:05 +0100
From: Petr Mladek <pmladek@...e.com>
To: John Ogness <john.ogness@...utronix.de>
Cc: Sergey Senozhatsky <senozhatsky@...omium.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Thomas Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH printk v2 15/26] printk: Track registered boot consoles

On Sun 2024-02-18 20:03:15, John Ogness wrote:
> Unfortunately it is not known if a boot console and a regular
> (legacy or nbcon) console use the same hardware. For this reason
> they must not be allowed to print simultaneously.
> 
> For legacy consoles this is not an issue because they are
> already synchronized with the boot consoles using the console
> lock. However nbcon consoles can be triggered separately.
> 
> Add a global flag @have_boot_console to identify if any boot
> consoles are registered. This will be used in follow-up commits
> to ensure that boot consoles and nbcon consoles cannot print
> simultaneously.
> 
> Signed-off-by: John Ogness <john.ogness@...utronix.de>

Reviewed-by: Petr Mladek <pmladek@...e.com>

Just a nit below.

> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -3598,6 +3611,17 @@ static int unregister_console_locked(struct console *console)
>  	if (console->exit)
>  		res = console->exit(console);
>  
> +	/*
> +	 * With this console gone, the global flags tracking registered
> +	 * console types may have changed. Update them.
> +	 */
> +	for_each_console(c) {
> +		if (c->flags & CON_BOOT)
> +			found_boot_con = true;
> +	}
> +	if (!found_boot_con)
> +		have_boot_console = false;

I would use:

	have_boot_console = found_boot_console;

But I do not have strong opinion. Maybe, you wanted to make
it obvious that the function only clears the flag.

Best Regards,
Petr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ