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]
Date:	Mon, 29 Sep 2014 19:00:22 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Kirill Tkhai <ktkhai@...allels.com>
Cc:	Sasha Levin <sasha.levin@...cle.com>, mingo@...nel.org,
	torvalds@...ux-foundation.org, paulmck@...ux.vnet.ibm.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sched: Use RCU read lock on all calls to dl_bw_of()

On Mon, Sep 29, 2014 at 06:54:18PM +0200, Peter Zijlstra wrote:
> On Mon, Sep 29, 2014 at 08:43:47PM +0400, Kirill Tkhai wrote:
> > Thanks for your report. It looks like your fix is not enough, because
> > we check for rcu_read_lock_sched_held() in dl_bw_of(). It still warns
> > even if rcu_read_lock() is held.
> > 
> > I used rcu_read_lock_sched_held() because we free root_domain using
> > call_rcu_sched(). So, it's necessary to held rcu_read_lock_sched(),
> > and my initial commit has this problem too.
> > 
> > It looks like we should fix it in a way like this:
> > 
> > [PATCH]sched: Use dl_bw_of() under rcu_read_lock_sched()
> > 
> > rq->rd is freed using call_rcu_sched(), and it's accessed with preemption
> > disabled in the most cases.
> > 
> > So in other places we should use rcu_read_lock_sched() to access it to fit
> > the scheme:
> > 
> > rcu_read_lock_sched() or preempt_disable() <==> call_rcu_sched().
> 
> Hmm, sad that. I cannot remember why that is rcu_sched, I suspect
> because we rely on it someplace but I cannot remember where.
> 
> We could of course do a double take on that and use call_rcu after
> call_rcu_sched(), such that either or both are sufficient.
> 
> I would very much prefer not to add extra preempt_disable()s if
> possible.

Ah wait, if we simply move that preempt_disable() inside the
for_each_cpu() loop there's no harm done. Having them outside is painful
though.
--
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