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: <20210111115026.GC242508@lothringen>
Date:   Mon, 11 Jan 2021 12:50:26 +0100
From:   Frederic Weisbecker <frederic@...nel.org>
To:     "Paul E. McKenney" <paulmck@...nel.org>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        LKML <linux-kernel@...r.kernel.org>,
        "Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
        Ingo Molnar <mingo@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>, stable@...r.kernel.org
Subject: Re: [RFC PATCH 5/8] entry: Explicitly flush pending rcuog wakeup
 before last rescheduling points

On Sun, Jan 10, 2021 at 09:13:18PM -0800, Paul E. McKenney wrote:
> On Mon, Jan 11, 2021 at 01:40:14AM +0100, Frederic Weisbecker wrote:
> > On Sat, Jan 09, 2021 at 03:05:33AM +0100, Frederic Weisbecker wrote:
> > > Following the idle loop model, cleanly check for pending rcuog wakeup
> > > before the last rescheduling point on resuming to user mode. This
> > > way we can avoid to do it from rcu_user_enter() with the last resort
> > > self-IPI hack that enforces rescheduling.
> > > 
> > > Signed-off-by: Frederic Weisbecker <frederic@...nel.org>
> > > Cc: Peter Zijlstra <peterz@...radead.org>
> > > Cc: Thomas Gleixner <tglx@...utronix.de>
> > > Cc: Ingo Molnar<mingo@...nel.org>
> > > Cc: Paul E. McKenney <paulmck@...nel.org>
> > > Cc: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> > > ---
> > >  kernel/entry/common.c |  6 ++++++
> > >  kernel/rcu/tree.c     | 12 +++++++-----
> > >  2 files changed, 13 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/kernel/entry/common.c b/kernel/entry/common.c
> > > index 378341642f94..8f3292b5f9b7 100644
> > > --- a/kernel/entry/common.c
> > > +++ b/kernel/entry/common.c
> > > @@ -178,6 +178,9 @@ static unsigned long exit_to_user_mode_loop(struct pt_regs *regs,
> > >  		/* Architecture specific TIF work */
> > >  		arch_exit_to_user_mode_work(regs, ti_work);
> > >  
> > > +		/* Check if any of the above work has queued a deferred wakeup */
> > > +		rcu_nocb_flush_deferred_wakeup();
> > 
> > So this needs to be moved to the IRQs disabled section, just a few lines later,
> > otherwise preemption may schedule another task that in turn do call_rcu() and create
> > new deferred wake up (thank Paul for the warning). Not to mention moving to
> > another CPU with its own deferred wakeups to flush...
> > 
> > I'll fix that for the next version.
> 
> Ah, so it was not just my laptop dying, then!  ;-)

Note that it fixes the "smp_processor_id() in preemptible" warnings you
reported but it shouldn't fix the other issues.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ