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: <4661330ae686768ddbb249f54d6df5f4806cf40d.1764272407.git.chris@chrisdown.name>
Date: Fri, 28 Nov 2025 03:43:21 +0800
From: Chris Down <chris@...isdown.name>
To: Petr Mladek <pmladek@...e.com>
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: [PATCH v8 03/21] printk: Prioritise user-specified configuration
 over SPCR/DT

ACPI firmware routinely calls add_preferred_console() via
acpi_parse_spcr() before we ever look at the kernel command line. After
that first registration we short-circuit on every duplicate name/index
match, so the subsequent console=ttyS0,... parameter never refreshes the
UART options that the firmware supplied.

Historically that just meant you couldn't tweak baud/flow control for a
firmware-provided serial console unless you picked a different device
name, but the per-console loglevel plumbing in this series relies on
those later console= entries being able to update the stored option
string. Without that, console=ttyS0,loglevel:5 simply never takes effect
on machines that get their console from SPCR/DT.

Teach __add_preferred_console() to update the existing slot when the
same console is mentioned again: we keep the original slot, but replace
its option string (and re-run braille option parsing) so that later
callers can override what firmware seeded. This keeps today's behaviour
unchanged for drivers, while allowing the cmdline UART parameters (and
soon the loglevel hints) to override the ACPI defaults.

Signed-off-by: Chris Down <chris@...isdown.name>
---
 kernel/printk/printk.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index a3072ea39e5e..447d9c28f180 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2560,7 +2560,12 @@ static int __add_preferred_console(const char *name, const short idx,
 		    (devname && strcmp(c->devname, devname) == 0)) {
 			if (!brl_options)
 				preferred_console = i;
+
+			if (options)
+				c->options = options;
+
 			set_user_specified(c, user_specified);
+			braille_set_options(c, brl_options);
 			return 0;
 		}
 	}
-- 
2.51.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ