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: <20180528122732.shvdlvc3pmg5k5rj@pathway.suse.cz>
Date:   Mon, 28 May 2018 14:27:32 +0200
From:   Petr Mladek <pmladek@...e.com>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>,
        linux-kernel@...r.kernel.org, "4 . 13+" <stable@...r.kernel.org>
Subject: Re: [PATCH] printk/nmi: Prevent deadlock when serializing NMI
 backtraces

On Wed 2018-05-23 11:01:07, Sergey Senozhatsky wrote:
> On (05/22/18 17:43), Steven Rostedt wrote:
> > > CPU0			CPU1			CPU2
> > > 
> > > printk()
> > >   vprintk_emit()
> > >     spin_lock(&logbuf_lock)
> > > 
> > > 						trigger_all_cpu_backtrace()
> > > 						  raise()
> > > 
> > > 			nmi_enter()
> > > 			  printk_nmi_enter()
> > > 			    if (this_cpu_read(printk_context)
> > > 			      & PRINTK_SAFE_CONTEXT_MASK)
> > > 			      // false
> > > 			    else
> > > 			      // looks safe to use printk_deferred()
> > > 			      this_cpu_or(printk_context,
> > > 				PRINTK_NMI_DEFERRED_CONTEXT_MASK);
> > > 
> > > 			  nmi_cpu_backtrace()
> > > 			    arch_spin_lock(&lock);
> > 
> > What branch is this based on, because I can't find the
> > "arch_spin_lock()" you are talking about here.
> 
> This arch_spin_lock() is in lib/nmi_backtrace.c
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/nmi_backtrace.c?h=v4.17-rc6#n94

JFYI, I have pushed the patch into printk.git, for-4.18 branch, see
https://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk.git/commit/?h=for-4.18&id=42f139d887cbb2c396dd61f4f13d4facfde5739e

Best Regards,
Petr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ