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: <20131210110157.5eb1498e@gandalf.local.home>
Date:	Tue, 10 Dec 2013 11:01:57 -0500
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Borislav Petkov <bp@...en8.de>
Cc:	Petr Mladek <pmladek@...e.cz>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	Jiri Kosina <jkosina@...e.cz>, linux-kernel@...r.kernel.org,
	x86@...nel.org
Subject: Re: [PATCH v6 2/8] x86: allow to call text_poke_bp during boot

On Tue, 10 Dec 2013 16:46:12 +0100
Borislav Petkov <bp@...en8.de> wrote:

> On Tue, Dec 10, 2013 at 04:42:14PM +0100, Petr Mladek wrote:
> > We would like to use text_poke_bp in ftrace. It might be called also during
> > boot when there is only one CPU and we do not need to sync the others.
> > 
> > The check is must to have because there are also disabled interrupts during
> > the boot. Then the call would cause a deadlock, see the warning in
> > "smp_call_function_many", kernel/smp.c:371.
> > 
> > The change is inspired by the code in arch/x86/kernel/ftrace.c.
> > 
> > Signed-off-by: Petr Mladek <pmladek@...e.cz>
> > Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
> > ---
> >  arch/x86/kernel/alternative.c | 17 ++++++++++++++---
> >  1 file changed, 14 insertions(+), 3 deletions(-)
> > 
> > diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
> > index eabed9326d2a..6436beec7b0c 100644
> > --- a/arch/x86/kernel/alternative.c
> > +++ b/arch/x86/kernel/alternative.c
> > @@ -599,6 +599,17 @@ static void do_sync_core(void *info)
> >  	sync_core();
> >  }
> >  
> > +static void run_sync(void)
> 
> Can we call this sync_cores()?
> 
> It is what it does. :)

That can be changed in a later patch if needed. It's a static function
so the visibility is limited. Not to mention, it was just moved from
ftrace.c which calls it run_sync(). We need to keep the same name for
the move to not confuse the history of where it came from.

-- Steve

> 
> > +{
> > +	/*
> > +	 * We do not need to sync other cores during boot when there is only one
> > +	 * CPU enabled. In fact, we must not because there are also disabled
> > +	 * interrupts. The call would fail because of a potential deadlock.
> > +	 */
> > +	if (num_online_cpus() != 1)
> > +		on_each_cpu(do_sync_core, NULL, 1);
> > +}
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ