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: <20080627145845.GA9229@linux.vnet.ibm.com>
Date:	Fri, 27 Jun 2008 07:58:45 -0700
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Dhaval Giani <dhaval@...ux.vnet.ibm.com>
Cc:	Dipankar Sarma <dipankar@...ibm.com>,
	Gautham R Shenoy <ego@...ibm.com>,
	Ingo Molnar <mingo@...e.hu>, laijs@...fujitsu.com,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	lkml <linux-kernel@...r.kernel.org>,
	Rusty Russel <rusty@...tcorp.com.au>
Subject: Re: [PATCH] fix rcu vs hotplug race

On Fri, Jun 27, 2008 at 11:19:59AM +0530, Dhaval Giani wrote:
> On Fri, Jun 27, 2008 at 10:48:55AM +0530, Dipankar Sarma wrote:
> > On Fri, Jun 27, 2008 at 10:17:38AM +0530, Gautham R Shenoy wrote:
> > > IMHO the warning is a spurious one.
> > > Here's the timeline.
> > > CPU_A						 CPU_B
> > > --------------------------------------------------------------
> > > cpu_down():					.
> > > .					   	.
> > > .						.
> > > stop_machine(): /* disables preemption,		.
> > > 		 * and irqs */			.
> > > .						.
> > > .						.
> > > take_cpu_down();				.
> > > .						.
> > > .						.
> > > .						.
> > > cpu_disable(); /*this removes cpu 		.
> > > 		*from cpu_online_map 		.
> > > 		*/				.
> > > .						.
> > > .						.
> > > restart_machine(); /* enables irqs */		.
> > > ------WINDOW DURING WHICH rcp->cpumask is stale ---------------
> > > .						call_rcu();
> > > .						/* disables irqs here */
> > > .						.force_quiescent_state();
> > > .CPU_DEAD:					.for_each_cpu(rcp->cpumask)
> > > .						.   smp_send_reschedule();
> > > .						.
> > > .						.   WARN_ON() for offlined CPU!
> > > .
> > 
> > Exactly. The call_rcu()s are coming from a different subsystem
> > and can happen anytime during the CPU hotplug path. So, RCU subsystem
> > doesn't have anything to do to keep rcu->cpumask consistent.
> > It is *safe* even if we miss poking a cpu or two while
> > forcing quiescent state in all CPUs. The worst that can happen
> > is a delay in grace period. No correctness problem here.
> > 
> 
> One question. What is preventing a CPU from clearing its mask after we
> have checked whether it is online but before we have called into
> smp_send_reschedule?

This is my concern as well.  Gautham, at which point in the above
timeline is the offlining CPU marked DYING?  Before stop_machine(), right?

If so, can't we just disable irqs, check for DYING or DEAD, and invoke
smp_send_reschedule() only if not DYING or DEAD?

							Thanx, Paul
--
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