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: <20220621111919.GD7891@pathway.suse.cz>
Date:   Tue, 21 Jun 2022 13:19:19 +0200
From:   Petr Mladek <pmladek@...e.com>
To:     Sergey Senozhatsky <senozhatsky@...omium.org>
Cc:     John Ogness <john.ogness@...utronix.de>,
        Marek Behún <kabel@...nel.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Rasmus Villemoes <linux@...musvillemoes.dk>,
        Jan Kara <jack@...e.cz>, Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH v2] printk/console: Enable console kthreads only when
 there is no boot console left

On Tue 2022-06-21 18:16:18, Sergey Senozhatsky wrote:
> On (22/06/21 11:09), Petr Mladek wrote:
> > Threaded console printing does not take into consideration that boot
> > consoles may be accessing the same hardware as normal consoles and thus
> > must not be called in parallel.
> > 
> > Since it is currently not possible to identify which consoles are
> > accessing the same hardware, delay threaded console printing activation
> > until it is known that there are no boot consoles registered.
> > 
> > Link: https://lore.kernel.org/r/20220619204949.50d9154d@thinkpad
> > Link: https://lore.kernel.org/r/2a82eae7-a256-f70c-fd82-4e510750906e@samsung.com
> > Link: https://lore.kernel.org/r/20220619204949.50d9154d@thinkpad
> > Reported-by: Marek Behún <kabel@...nel.org>
> > [john.ogness@...utronix.de: Better description of the problem.]
> > Signed-off-by: Petr Mladek <pmladek@...e.com>
> > Tested-by: Marek Behún <kabel@...nel.org>
> 
> Reviewed-by: Sergey Senozhatsky <senozhatsky@...omium.org>

Thanks.

> > -static int __init printk_activate_kthreads(void)
> > -{
> > -	struct console *con;
> >  
> > -	console_lock();
> > -	printk_kthreads_available = true;
> > -	for_each_console(con)
> > -		printk_start_kthread(con);
> > -	console_unlock();
> > +	/*
> > +	 * Boot consoles may be accessing the same hardware as normal
> > +	 * consoles and thus must not be called in parallel. Therefore
> > +	 * only activate threaded console printing if it is known that
> > +	 * there are no boot consoles registered.
> > +	 */
> > +	if (no_bootcon)
> > +		printk_activate_kthreads();
> 
> A quick question. Here we still can have bootcon which can unregistered
> later, right? Do you think it'll make sense to check if printing kthreads
> can be safely started and start them if so (if no CON_BOOT found and kthreads
> are not already created) at the end of unregister_console()?

Yeah, that's my plan how to optimize it in the future. I just
wanted to do something simple and be on the safe side for 5.19.

Best Regards,
Petr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ