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:   Thu, 2 Feb 2017 09:30:11 -0500
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Petr Mladek <pmladek@...e.com>
Cc:     Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>,
        Peter Zijlstra <peterz@...radead.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jiri Slaby <jslaby@...e.cz>, linux-fbdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] printk: Correctly handle preemption in
 console_unlock()

On Wed, 25 Jan 2017 15:08:45 +0100
Petr Mladek <pmladek@...e.com> wrote:

> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> index 7180088cbb23..cc90c0a5ae21 100644
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -2158,19 +2158,18 @@ void console_unlock(void)
>  	}
>  
>  	/*
> -	 * Console drivers are called under logbuf_lock, so
> -	 * @console_may_schedule should be cleared before; however, we may
> -	 * end up dumping a lot of lines, for example, if called from
> -	 * console registration path, and should invoke cond_resched()
> -	 * between lines if allowable.  Not doing so can cause a very long
> -	 * scheduling stall on a slow console leading to RCU stall and
> -	 * softlockup warnings which exacerbate the issue with more
> -	 * messages practically incapacitating the system.

Why did you remove the comment about invoking cond_resched()? It's
still pertinent to the code, as there still exists a:

	if (do_cond_resched)
		cond_resched();

And the rational in the comment is still correct.

-- Steve

> +	 * Console drivers are called with interrupts disabled, so
> +	 * @console_may_schedule must be cleared before. The original
> +	 * value must be stored so that we could schedule between lines.
> +	 *
> +	 * console_trylock() is not able to detect the preemtible
> +	 * context reliably. Therefore the value must be stored before
> +	 * and cleared after the the "again" goto label.
>  	 */
>  	do_cond_resched = console_may_schedule;
> +again:
>  	console_may_schedule = 0;
>  
> -again:
>  	/*
>  	 * We released the console_sem lock, so we need to recheck if
>  	 * cpu is online and (if not) is there at least one CON_ANYTIME

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ