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: <20191211020149.GN88619@google.com>
Date:   Wed, 11 Dec 2019 11:01:49 +0900
From:   Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To:     Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc:     Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
        linux-kernel@...r.kernel.org, Petr Mladek <pmladek@...e.com>,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [RFC/PATCH] printk: Fix preferred console selection with
 multiple matches

On (19/12/11 09:26), Benjamin Herrenschmidt wrote:
[..]
> No not exactly. Architectures/platforms use add_preferred_console()
> (such as arm64 with ACPI but powerpc at least does it too) based on
> various factors to select a reasonable "default" for that specific
> platform. Without that the kernel will basically default to the first
> one to register which may not be what you want.
> 
> The command line ones however want to override the defaults (provided
> they exist, ie, it's possible that whever is specified on the command
> line doesn't actually exist, and thus shall be ignored. That typically
> happens when there is either no match or ->setup fails).
> 
> > Hmm.
> > 
> > The patch may affect setups where alias matching is expected to
> > happen. E.g.:
> > 
> > 	console=uartFOO,BAR
> > 
> > Is 8250 the only console that does alias matching?
> 
> Why would the patch affect this negatively ? Today we stop on the first
> match, mark the driver enabled, and make it preferred if the match
> index matches preferred_console.

As far as I know, ->match() does not only match but also does ->setup().
If we have two console list entries that match (one via aliasing and one
via exact match) then the console driver is setup twice. Do all console
drivers handle it? [double setup]

If we could perform simple alias matching, without ->setup() call, and
exact matching (strcmp()), and then, if newcon would match two entries,
we would pick up the last matching entry and configure newcon only once.

This changes the order, tho.

[..]
>  - Another match that is marked preferred_console, in which case in
> addition to being enabled, the newly registered console will also be
> made the default console (ie, first in the list with CONSDEV set). This
> is actually what we want ! IE. The console matches the last specified
> one on the command line.

Well, it still looks to me that what you want is to "ignore alias
match and prefer exact match".

	-ss

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ