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: <ZtXJVvtDNDV7ZaTZ@pathway.suse.cz>
Date: Mon, 2 Sep 2024 16:19:02 +0200
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,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH printk v5 06/17] printk: nbcon: Introduce printer kthreads

On Fri 2024-08-30 17:35:05, John Ogness wrote:
> From: Thomas Gleixner <tglx@...utronix.de>
> 
> Provide the main implementation for running a printer kthread
> per nbcon console that is takeover/handover aware. This
> includes:
> 
> - new mandatory write_thread() callback
> - kthread creation
> - kthread main printing loop
> - kthread wakeup mechanism
> - kthread shutdown

I have found one more small problem.

> --- a/kernel/printk/nbcon.c
> +++ b/kernel/printk/nbcon.c
> @@ -1036,6 +1042,225 @@ static bool nbcon_emit_next_record(struct nbcon_write_context *wctxt, bool use_a
[...]
> +/**
> + * nbcon_kthreads_wake - Wake up printing threads using irq_work
> + */
> +void nbcon_kthreads_wake(void)
> +{
> +	struct console *con;
> +	int cookie;
> +
> +	if (!printk_kthreads_running)
> +		return;
> +
> +	cookie = console_srcu_read_lock();
> +	for_each_console_srcu(con) {
> +		/*
> +		 * Only schedule irq_work if the printing thread is
> +		 * actively waiting. If not waiting, the thread will
> +		 * notice by itself that it has work to do.
> +		 */
> +		if (rcuwait_has_sleeper(&con->rcuwait))

This is called for all consoles but con->rcuwait is initialized
only for nbcon consoles.

I would add above this check:

+		if (!(console_srcu_read_flags(con) & CON_NBCON))
+			continue;

> +			irq_work_queue(&con->irq_work);
> +	}
> +	console_srcu_read_unlock(cookie);
> +}
> +

With the added check:

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

Best Regards,
Petr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ