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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 26 Apr 2018 10:44:18 +0900
From:   Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To:     Petr Mladek <pmladek@...e.com>
Cc:     Steven Rostedt <rostedt@...dmis.org>,
        Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        linux-kernel@...r.kernel.org,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>
Subject: Re: [RFC][PATCH] printk: do not call console drivers from
 printk_safe context

On (04/25/18 16:48), Petr Mladek wrote:
[..]
> 
> The above paragraph is not easy to understand. I wonder if the
> following might be more clear:
> 
> "Calling console drivers from printk_safe() context does not really
> make call_console_drivers() any safer. They are never called
> recursively thanks to console_trylock() in vprintk_emit()."

Yes, looks good.

[..]
> Unfortunately printk_safe context helps only when console_unlock() is
> called with IRQs disabled. Otherwise, the per-CPU buffer is flushed
> in every for(;;) cycle.

Right. I thought about it. If console_unlock() is called with IRQs
disabled then we postpone flush until we return from console_unlock()
and enable local IRQs. But then we have printk_safe() flush, which
uses printk_deferred() -> queue irq_work -> irq work -> console_unlock(),
so quite likely we still print out printk_safe() buffer from atomic
context (from irq in this case).

> So I agree that printk_safe context does not help much. And I fine
> with this patch.

Thanks.

	-ss

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ