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:   Wed, 5 Jul 2017 11:23:47 -0700
From:   Linus Torvalds <torvalds@...ux-foundation.org>
To:     Petr Mladek <pmladek@...e.com>
Cc:     Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [GIT PULL] printk for 4.13

On Mon, Jul 3, 2017 at 7:24 AM, Petr Mladek <pmladek@...e.com> wrote:
>
> - Store printk() messages into the main log buffer directly even in NMI
>   when the lock is available. It is the best effort to print even large
>   chunk of text. It is handy, for example, when all ftrace messages
>   are printed during the system panic in NMI.

No, this is entirely buggered.

You can't just do

   raw_spin_is_locked(&logbuf_lock)

to test whether you can get the logbuf_lock and then call vprintk_default().

It's not just about deadlock avoidance, the code will call things like
down_trylock() on the console semaphore, and that operation is
fundamentally not NMI-safe. The semaphore count is literally protected
by a irq-safe (BUT NOT NMI-SAFE!) semaphore spinlock.

So now you can instead deadlock just on the internal console semaphore
spinlock (ie somebody is doing "console_lock()", NMI comes in, *BOOM*.

Maybe I'm missing something, but I'm skipping this pull request as
"completely broken".

                     Linus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ