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:   Tue, 11 Feb 2020 15:41:34 +0100
From:   Petr Mladek <pmladek@...e.com>
To:     Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc:     Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 2/3] printk: Fix preferred console selection with
 multiple matches

On Thu 2020-02-06 15:02:25, Benjamin Herrenschmidt wrote:
> In the following circumstances, the rule of selecting the console
> corresponding to the last "console=" entry on the command line as
> the preferred console (CON_CONSDEV, ie, /dev/console) fails. This
> is a specific example, but it could happen with different consoles
> that have a similar name aliasing mechanism.
> 
> This tentative fix register_console() to scan first for consoles
> specified on the command line, and only if none is found, to then
> scan for consoles specified by the architecture.
> 
> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> index 17602d7b7ffc..5cf47a7b880c 100644
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -2674,8 +2679,13 @@ static int try_enable_new_console(struct console *newcon)
>  	/*
>           * Some consoles, such as pstore and netconsole, can be enabled even
>           * without matching.
> +	 *
> +	 * Note: We only do this test on the !user_specified pass so that such
> +	 * a statically enabled console that isn't user specified gets a chance
> +	 * to have its match() or setup() function called on our second pass
> +	 * through this function.

I had some troubles to part the comment. I wonder if the following is
more clear:

	* Accept pre-enabled consoles only when match() and setup()
	* was called.

And I would do the same check as in the for cycle:

	if (newcon->flags & CON_ENABLED && c->user_specified ==	user_specified)
		return 0;

With the above change:

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

I could do the change when pushing if you agree and v4 is not needed
for other reasons.

Best Regards,
Petr

PS: JFYI, I am going to look at the 3rd patch tomorrow. I have to go now.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ